1 (edited by shagbark 2016-01-16 20:49:16)

Topic: [SOLVED] What data gets moved when you resize an extended partition?

I need to resize a Windows 7 boot partition.  It completely fills an extended partition.  So I need to first expand the extended partition to the left.

Last I heard, if I resize the LEFT end of a Windows 7 boot partition with GParted, and set Align to anything other than 'None', it will move the data, and the partition won't boot anymore, supposedly because of some magic data Windows 7+ requires before the start of a boot partition.  (This is a long-standing bug in GParted, and it REALLY ought to be documented in the FAQ, or, better, fixed.)

I thought: Maybe I can align the extended partition to a megabyte boundary when I resize that.  Then I can expand the boot partition, but not align it.  I'll just expand it all the way to the left of the extended partition, which is aligned, so the boot partition will be aligned, too, but the data won't be moved and so MAYBE it will still boot.

I don't see how the secret Windows data before the start of the partition won't get overwritten, though.

Anyway, when I ask GParted to expand the extended partition, it reports that it's going to do a move and a resize, whether I ask it to align it or not.

Does that mean it's going to move all of the data inside the extended partition, including the data in the boot partition?  I need that not to happen.

Has anyone tried expanding a Windows 7, Vista, or 10 boot partition to the left?

2

Re: [SOLVED] What data gets moved when you resize an extended partition?

shagbark wrote:

Last I heard, if I resize the LEFT end of a Windows 7 boot partition with GParted, and set Align to anything other than 'None', it will move the data, and the partition won't boot anymore, supposedly because of some magic data Windows 7+ requires before the start of a boot partition.  (This is a long-standing bug in GParted, and it REALLY ought to be documented in the FAQ, or, better, fixed.)

It is only a long-standing bug if you continue to use GParted versions less than 0.4.4.
This issue was fixed in GParted 0.4.4 back on April 2, 2009.
See Bug 571151 - gparted moves partition to the left even if unneeded.

If you move the start of the Windows boot partition, you may need to restore the ability to boot using the Windows install media.  See the GParted FAQ for more information.

3 (edited by shagbark 2016-01-16 02:42:08)

Re: [SOLVED] What data gets moved when you resize an extended partition?

gedakc wrote:

If you move the start of the Windows boot partition, you may need to restore the ability to boot using the Windows install media.  See the GParted FAQ for more information.

I'm glad that this will deal with my problem, but it sounds from your reply, and from the linked-to bug tracking, like the problem still exists.  Putting a notice in the FAQ linking to a repair procedure doesn't count as fixing a bug.  Particularly since a user who runs afoul of it can't check the FAQ, since they can't boot their computer.  Also particularly since many Windows PCs come without install media these days.  It is definitely a bug if, for 90% of desktop PCs (the percentage which run Windows), a user trying to move the most-common type of partition (the boot partition) will often find their computer unusable afterwards.

If moving a Windows boot partition can still make it unbootable, I think it would help a lot to give a user moving a Windows boot partition a prompt like this:

"WARNING: After moving a Windows boot partition, you may have to repair it using the Windows install CD before it will boot.  See <URL here>.  Do you really want to do this? (Y/N)"


Do you know if resizing an extended partition moves the data on the partitions inside that extended partition?

4

Re: [SOLVED] What data gets moved when you resize an extended partition?

shagbark wrote:

If moving a Windows boot partition can still make it unbootable, I think it would help a lot to give a user moving a Windows boot partition a prompt like this:

"WARNING: After moving a Windows boot partition, you may have to repair it using the Windows install CD before it will boot.  See <URL here>.  Do you really want to do this? (Y/N)"

There are different ways that Windows versions boot, so after moving the Windows boot partition it may or may not boot.  Assuming you are using a recent version of GParted (the latest is 0.24.0) then a warning is issued when moving a partition and it provides a link to the GParted FAQ.

shagbark wrote:

Do you know if resizing an extended partition moves the data on the partitions inside that extended partition?

Moving an extended partition may move metadata such as the Extended Boot Record, but will not move any data in logical partitions.  Moving the extended partition will not affect operating system boot.

5 (edited by shagbark 2016-01-22 18:20:03)

Re: [SOLVED] What data gets moved when you resize an extended partition?

How about my plan of aligning the extended partition, and then resizing the boot partition inside it setting align=None?  Would that skip the step of moving the data, and would that make it more likely the partition will still boot?

The instructions on how to repair the Windows partition after a GParted resize involve using the Win 7 install disk, but I think that will overwrite the GRUB2 boot loader I now have.  I have no way to reinstall GRUB2 other than by re-installing Ubuntu, since no Linux Live CDs will boot on my computer.  Do you know if the Windows repair disk installs the Windows boot manager and loses Linux?

ADDED:  I moved the boot partition, using GParted 0.25 with align=MiB.  It would no longer boot, but the Windows 7 repair disk fixed it, and didn't change the GRUB2 boot loader.

6

Re: [SOLVED] What data gets moved when you resize an extended partition?

shagbark wrote:

How about my plan of aligning the extended partition, and then resizing the boot partition inside it setting align=None?  Would that skip the step of moving the data, and would that make it more likely the partition will still boot?

Changing the alignment setting will not affect whether the data is moved.  The only thing that affects whether a partition is moved is if the Free space preceding value is changed.  See GParted Manual - Specifying Partition Alignment.

shagbark wrote:

I have no way to reinstall GRUB2 other than by re-installing Ubuntu, since no Linux Live CDs will boot on my computer.

Have you investigated why GNU/Linux Live CD's won't boot on this computer?  How did you get Ubuntu installed in the first place?  If using UEFI boot then did you disable Windows Fastboot and UEFI Trusted Boot?  Have you tried booting using a USB flash drive?

shagbark wrote:

I have no way to reinstall GRUB2 other than by re-installing Ubuntu, since no Linux Live CDs will boot on my computer.  Do you know if the Windows repair disk installs the Windows boot manager and loses Linux?

I don't have hands-on knowledge with this, but would bet that the Windows repair disk would do as you say - that is install the Windows boot manager and lose access to Linux.

7 (edited by shagbark 2016-01-22 20:33:25)

Re: [SOLVED] What data gets moved when you resize an extended partition?

gedakc wrote:

Changing the alignment setting will not affect whether the data is moved.  The only thing that affects whether a partition is moved is if the Free space preceding value is changed.  See GParted Manual - Specifying Partition Alignment.

I had already read that section on alignment.  I see now that the info about free space preceding is under "Advanced Partition Actions".  Sorry.

Have you investigated why GNU/Linux Live CD's won't boot on this computer?  How did you get Ubuntu installed in the first place?  If using UEFI boot then did you disable Windows Fastboot and UEFI Trusted Boot?  Have you tried booting using a USB flash drive?

I don't have trusted boot or fastboot as an option.  My motherboard is from 2007.  I wasn't accurate--the Windows repair CD is a live CD, and that works.  Gparted Live and Ubuntu live-boot don't work now, though both did a year ago on the same computer. Now they give dozens of cryptic error messages.  The Ubuntu DVD will boot the install program but not the live OS.  I haven't tried to diagnose them, nor tried a flash drive boot.

I've got my system configured as I want it now, so I'm not going to try any of that.  These mysterious hardware-conflict problems come and go; odds are good it will disappear as mysteriously as it appeared before I need to install another OS.

shagbark wrote:

Do you know if the Windows repair disk installs the Windows boot manager and loses Linux?

I don't have hands-on knowledge with this, but would bet that the Windows repair disk would do as you say - that is install the Windows boot manager and lose access to Linux.

See my previous message, which I edited after posting--the Windows repair disk fixed my boot partition without changing the boot manager.  All is well now.

Thanks for your help!

8

Re: [SOLVED] What data gets moved when you resize an extended partition?

You're welcome for the help.  'Glad to hear that all is well.  :-)