1

Topic: How to repair a dual boot system after enlarging the Windows partition

My hard drive has 3 partitions.  The first is a primary partition with Windows 7 installed (C: drive).  The second is an extended  partition with two logical partitions. The first has has most of the windows applications installed in it.  There is unallocated space at the end of the extended partition.  The third partition is a primary partition with Ubuntu installed.  I guessed wrong when I first partitioned the hard drive and my Windows 7 partition is running out of space.  I intend to use gparted to move the logical partition in the extended drive to the right, into the unallocated space thus creating unallocated space at the begining of the extended drive (D:).

Then I'll shrink the extended drive to create unformatted space between the C: and D: drives (First and second partitions).

Then I can expand the first primary drive, which has my Windows 7 system installed into it to make more room.

I have GRUB 2 from the Ubuntu partition installed in the MBR.  The dual boot uses Grub and then the Windows loader to load Windows 7.

My first question is, can I really do all of this with gparted?  If I can,
at what point is my system likely to become unable to boot?  After shrinking the extended partition (D:), or after expanding the first primary partition (C:) or both?

If I can perform the noted re-partitioning how do I proceed to get the dual boot to work again?

2

Re: How to repair a dual boot system after enlarging the Windows partition

Yes, GParted can do everything you need.  Move logical and extended partitions, grow primary partition containing FAT32 or NTFS.

I'm no expert on GRUB 2, but I think booting will continue to work after your resizing because of the following:
I think your GRUB 2 boot setup is layed out like this:

  • Stage 1 - boot.img - in MBR, first 512 byte sector

  • Stage 1.5 - core.img - in unpartitioned space immediately following the MBR
    (At this point in the boot process GRUB 2 is capable of understanding partitions and reading file systems.  Your moving and resizing will maintain the same partition numbers so existing boot references will continue to work).

  • Stage 2 - /boot/grub directory - in a file system somewhere, presumable in /dev/sda3 (primary partition containing Ubuntu).

The on-line GParted Manual has a section on Restoring GRUB 2 Boot Loader.  Also the first search result for "Ubuntu Windows dual boot" finds this and points to this:

As always be prepared.  Have backups of data your care about.  Resizing and moving does put your data at risk and things can fail.

3

Re: How to repair a dual boot system after enlarging the Windows partition

Thanks for the advice.  I'll do the back up and take a shot the re-partitioning I laid out.