0

I have a BIOS-based system running Windows 7 on a MBR partitioned 1TB HDD. This HDD is partitioned as following:

  • P0: 60 GB NTFS for Windows and Program files
  • P1: 940 GB NTFS for data

As this disk is going to be full, my purpose is to migrate the existing installation to a new 3TB HDD, with following partitions:

  • P0: 60 GB NTFS the same as 1B/P0
  • P1: 2940 GB NTFS with the content of 1TB/P1, plus more free space

As this partition is > 2TB, MBR cannot handle them and I switch the 3TB HDD partition table to GPT but:

  • Windows 7 cannot boot from BIOS+GPT systems

So I investigated here and seems that GRUB is able to boot Windows 7 from GPT disks with a trick: a virtual HDD file (VHD) MBR formatted that contains the Windows boot files that, once loaded, load Windows from the GPT partition.

So I did the following:

  • P0: special GRUB 1MiB partition for GPT systems (see here, installed by grub-install from a live Linux image)
  • P1: 120MiB ext2 partition to host GRUB files (grub.cfg f.e.) and the bootmgr.vhd files
  • P3: 60 GB NTFS partition where I copied all 1TB/Partition 0 files
  • P4: 2940 GB (or a bit less) NTFS partition where I copied all 1TB/Partition 1 files

In the VHD there's an MBR NTFS partition with the Windows boot files generated with commands:

bootsect /nt60 b: /mbr
bcdboot c:\Windows /s b: (NOT with /mbr flag as it's a GPT disk)

where B is the VHD file and C is a Windows 7 x64 installation running on a VM. The VHD partition is set as primary and active.

To avoid also some other issues, I generated also in the new 3TB/P3 the boot files with:

bootsect /nt60 e:
bcdboot c:\Windows /s e:

Where E is the 3TB/P3 partition.

I tried booting with grub using this manually edited grub.cfg:

menuentry "Win7 root+chain" {
    set root=(hd0,gpt3)
    chainloader +1
}

menuentry "Win7 vhd+chain" {
    loopback loop (hd0,gpt2)/boot/bootmgr.vhd
    chainloader +1
}

The first give me a Windows Boot Manager message:

"Error 0xc000000e File:\Boot\BCD Message: An error occoured while attempting to read the boot configuration data"

The second seems a Grub message

"Invalid signature"

May you please help me? I'm doing something wrong with Grub?

phuclv
  • 26,555
  • 15
  • 113
  • 235
Fuzzo
  • 103
  • 2
  • > As this partition is > 2TB, MBR cannot handle them true and false. MBR can handle a limited number of addresses. With 512 byte sectors this means it maxes out at 2TiB. With 4K sectors (and any modern drive should have those) it maxes out at 16TiB. Secondly: > Windows 7 cannot boot from BIOS+GPT systems But windows can happily boot from BIOS & MBR systems and it can access GPT partitioned disks. So you could use the 1TB disk as bootdisk (MBR partition scheme) and add the 3TB disk as data disk (either with MBR partition scheme or if it is a really old disk with the GPT scheme) – Hennes Dec 12 '16 at 13:44
  • I do not want to use the old MBR 1TB hd. The VHD file should simulate Windows boot MBR disk, but i do not know hot to load it with Grub... – Fuzzo Dec 12 '16 at 14:14
  • I do not know enogh of grub to answer the question. I just wanted to point out another option where grub was not needed at all (e.g. with a AF disk). – Hennes Dec 12 '16 at 14:16
  • Is it an intentional typo that you misspelled `loopbakc` for the second entry? – Seth Dec 12 '16 at 14:23
  • Does your BIOS support UEFI ? Is your Windows 7 64-bit ? Information about your computer model and the 3TB disk model will help. – harrymc Dec 12 '16 at 14:50
  • No, the bios does not support UEFI. Windows 7 is 64 bit version. The 3TB disk is a WD Red, GPT partitioned – Fuzzo Dec 12 '16 at 14:51
  • Have you looked for a BIOS update that supports UEFI? (This is why I asked for the exact computer model.) – harrymc Dec 12 '16 at 14:56
  • The MB is an Intel D510MO and it runs the latest BIOS. – Fuzzo Dec 12 '16 at 15:12
  • The 3TB MBR limit only applies to the system disk that Windows exists on. Its possible to have a 3TB secondary disk that is formatted as MBR. Microsoft has a nice chart on their website that explains the limitations of MBR when it comes to Windows. – Ramhound Dec 12 '16 at 15:22
  • According [to Intel](https://communities.intel.com/thread/38182), this MB supports UEFI. Are you using BIOS [version 0524](https://downloadcenter.intel.com/download/20288/BIOS-Update-MOPNV10N-86A-)? – harrymc Dec 12 '16 at 16:17
  • The page you linked show the bios update for the MOPNV10N board, mine is MOPNV10J and refuses to install. – Fuzzo Dec 12 '16 at 19:15
  • Apparently you cannot update directly to version 0524 : You have to first update to [version 0400](https://downloadcenter.intel.com/download/19453/BIOS-Update-MOPNV10N-86A-) and then to 0524. Before starting, ensure you have the installation media for your current BIOS version ("Recovery BIOS Update" in.the release notes). – harrymc Dec 12 '16 at 21:04
  • @Hennes your conclusion re 4K sectors is incorrect. it is true that modern drives use 4K sectors internally. However, unless you are dealing with enterprise-class drives, they are all "512e" drives, meaning 512-byte emulation: they present 512-byte sectors at their SATA interface. So the firmware (BIOS or UEFI) and the operating system still see 512-byte sectors and if MFT partitioning is used it is still limited to 2 TiB. The drives that present 4K sectors at the interface are called "4Kn" (4K native) and the odds are very very good that the OP will not be using one of those. – Jamie Hanrahan Dec 15 '16 at 21:06
  • @Hennes: see also http://wp.xin.at/archives/2581 . – Jamie Hanrahan Dec 15 '16 at 21:22
  • That was interesting reading. Thanks for sharing that link. – Hennes Dec 15 '16 at 22:04

3 Answers3

2

This answer summarizes the comments on the post in a more orderly manner.

While no answer was received for making Grub work in this context, I did find out that the BIOS of the motherboard in question, MOPNV10J, does support UEFI, as answered (link) by an Intel person called Dan.

With UEFI support, the 3TB disk can be formatted as GPT and the entire disk then becomes addressable.

Since the poster's BIOS does not support UEFI, the question now becomes how to update it to the latest Version 0542.

It turns out that updating to that version needs to be done in two steps:

  1. Update the BIOS to Version 0400
  2. Update the BIOS to Version 0542

Before starting, ensure first that you have the installation media for your current BIOS version, called "Recovery BIOS Update" in the release notes. Otherwise a botched BIOS update can brick the computer.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • Thanks harrymc, i sucessfully updated by BIOS to 0542 from 0311 passing by 0400. – Fuzzo Dec 16 '16 at 15:16
  • I tried to install Win7 from USB, it boots but i cannot select ant GPT partition in which install it because "GPT disk". Please note that the only reference to UEFI in BIOS menù is "UEFI boot" that is Enabled. UEFI+GPT should be supported by Win7. Should i create in some ways an EFI System partition on that disk? – Fuzzo Dec 16 '16 at 15:18
  • Is the Win7 installation media for 64-bit ? – harrymc Dec 16 '16 at 16:21
  • Yes, it's a generated USB installation media from MSDN ISO 64 bit – Fuzzo Dec 16 '16 at 16:25
  • No need to create an EFI system partition. Just one filesystem (FAT32, **not NTFS**). No need for a bootsector. Just copy the contents of the iso file and manually copy the right EFI file to \EFI\BOOT\\BOOTX64.EFI. (The easiest way to get that file is to copy and rename C:\Windows\Boot\EFI\bootmgfw.efi to ) – Hennes Dec 16 '16 at 16:40
  • For me, if you are having problems installing Windows, the best and simplest solution is to quick-format the disk and let the installation do its job. If the PC was booted in UEFI mode it will automatically reformat the drive as GPT and the installation will also create the recovery partition. See the article [Windows Setup: Installing using the MBR or GPT partition style](https://technet.microsoft.com/en-us/library/dn336946.aspx). – harrymc Dec 16 '16 at 17:12
  • With BIOS 0542 and UEFI boot enabled i was able to install and boot Windows 7 x64 from GPT disk. The installer automatically creates a EFI System Partition. Thanks! – Fuzzo Dec 19 '16 at 14:24
0

Had you tried on grub with this?

menuentry "Win7 vhd+chain" {
    loopback loop (hd0,gpt2)/boot/bootmgr.vhd
    set root=(loop)
    chainloader +1
}

Or

menuentry "Win7 vhd+chain" {
    loopback loop (hd0,gpt2)/boot/bootmgr.vhd
    chainloader (loop)+1
}

And by the way, is /boot a folder inside the ext2 partition? or is it the ext2 partition itself? Also try without /boot inside the loopback:

menuentry "Win7 vhd+chain" {
    loopback loop (hd0,gpt2)/bootmgr.vhd
    chainloader (loop)+1
}

Hope something helps.

Long time ago i did something similar: Boot XP, Vista, 7, 8.1 & 10 on a one disk only system in GPT structure by using the VHD trick, memdisk & Grub4DOS for XP part... but do not remember excatly how.

Laura
  • 1
0

You don't actually need to migrate to GPT. MBR stores the partition's starting offset and size as unsigned 32-bit integers so the real limit is 233 - 2 sectors. That means it's possible to have a 4TB MBR disk with 512-byte sectors or a 16 TB MBR disk with 4 KB sectors, as long as the last partition begins before the 232 mark and covers the whole remaining space. So you can have for example a 4 TB HDD with one 1 TB partition, one 1 TB minus 1 MB partition and one 2 TB partition

In your case you can have P0: 60 GB, P1: 1 TB, P2: remaining space, or P0: 1.5 TB, P1: 1.5 TB. Or change to any other combinations as long as the last partition size is smaller than 2TB and starts before 2TB

For more details read Make 3TB hard drive appear as two (2TiB+750GiB) with MBR

That said, migrating to GPT is safer, because GPT has checksums and a backup table to recover in case of failure

phuclv
  • 26,555
  • 15
  • 113
  • 235