[SOLVED] Windows boot partition got unallocated after resizing partition
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Windows boot partition got unallocated after resizing partition
Hello,
I got a new laptop (Dell XPS15, it came with Win7 HP) and I wanted to install linux on it (dualboot). So I booted up Kubuntu (which I use for playing with partitions) and shrinked down the OS volume (sda3) to make some space at the end of the disk.
After restarting the PC, the windows bootloader couldn't find the system volume, so it scanned the whole disk for partitions. (This is the standard procedure, I think). After another reboot the bootloader appeared offering to boot into two different systems - Win7 HP (the original one, works fine) or Win7 Ultimate. At first I thought this was some kind of error, but I tried to boot it. Windows Ultimate appeared and logged me in. This was apparently a partition they used for testing the laptop - a diagnostic test ran upon startup and there was diagnostic software everywhere. And then there was one more partition (fat32) with diagnostic tools.
The problem is: There were originally 3 partitions - the bootloader, the Recovery partition and the system partition. Now there are four partitions (the maximum) - Recovery, OS, the WinUltimate diagnostic OS, and the fat32 diagnostic partition. The bootloader DISAPPEARED, yet it still works. There is 100MB unallocated space at the beginning of the disk (I'll add a screenshot).
The question is: how do I get the bootloader back into the partition table? Will formatting the diagnostic partitions and running system recovery again help?
Thanks for any help.
Code:
ubuntu@ubuntu:~$ sudo fdisk -l -u
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x07f2837e
Device Boot Start End Blocks Id System
/dev/sda1 974725120 976771071 1022976 c W95 FAT32 (LBA)
/dev/sda2 * 212992 41172991 20480000 7 HPFS/NTFS
/dev/sda3 41174595 812937194 385881300 7 HPFS/NTFS
Partition 3 does not start on physical sector boundary.
/dev/sda4 939907072 974725119 17409024 7 HPFS/NTFS
Partition table entries are not in disk order
You have a 1GB FAT32 partition (sda1) at the end of your drive which is a little unusual.
You have a Recovery partition (sda2) marked as active/bootable when your windows system files are on sda3.
You then have 60GB of unallocated/unusable space between sda3 and sda4.
Do you know what is on sda4 as it shows about 10GB used?
You might delete sda1 and then you would be able to use that to create an Extended partition in which you could create a logical partition on which you could install Linux using the unallocated space between sda3 and sda4.
Or you could delete sda4 and create an Extended partition which includes that space plus the unallocated.
Not knowing what you have on these partitions, I wouldn't recommend either at this point.
I'm not sure what you mean by booting Win7HP and win7 ultimate, do you have two different windows systems?
Quote:
Will formatting the diagnostic partitions and running system recovery again help?
You might get a better answer to this questions at a windows forum.
The 1GB FAT32 partition at the end is one of the diagnostic ones. Originally, there was the bootloader at the beginning (100MB), recovery (+- 20GB) and the OS (the rest). After I've shrinked the OS and rebooted, Windows went into recovery mode and re-created the partition table, adding two diagnostic partitions at the end of the disk (previously, they were overlapped by the OS partition). So I guess the sda1 was previously the bootloader. Now, sda2 is the "recovery", sda3 is the "OS" and sda4 and sda1 are the stupid diagnostic partitions.
By the way: when I was shrinking the OS partition, the KDE Partition Managed moved it about 800kB to the right, so it doesn't start on sector boundary now. Is that a big problem?
There are a total of 2 entries listed in the bootloader.
Default: Not set
Timeout: 2 seconds
EasyBCD Boot Device: F:\
Entry #1
Name: Windows 7 Home Premium
BCD ID: {current}
Drive: C:\
Bootloader Path: \Windows\system32\winload.exe
Entry #2
Name: Dell Diag Win7 Ultimate
BCD ID: {bec2087d-fcbd-11e0-a432-d1a94187a469}
Drive: F:\
Bootloader Path: \Windows\system32\winload.exe
That means the recovered diagnostic Win7 Ultimate partition is used as the bootloader. That's worse than I expected... But why is the sda2 marked as bootable?
Might have happened when it scanned the disk but I really have no idea.
If you can still boot win 7 it doesn't seem like it is that great a problem. If you are using EasyBCD to boot, you could set the default to the win7 partition. The info you posted doesn't show a default set.
You could try mounting sda1 and then sda4 to see what you have there. If there isn't anything useful in sda1, you might delete it and then you would be able to create an Extended partition and you could create a logical partition within it using the 60GB of unallocated space you now have. I'm not sure what problems this would create. In Linux, it would then change the other partition numbers but I have no idea what would happen with windows. If you don't feel you need whatever you have on sda4, you could delete that and create another partition or partitions. I'd take a look at what is on those partitions before doing anything. If you delete and create new partitions I would expect the uuid numbers to change also which could lead to problems.
So,
after I totally messed the system up playing with TestDisk, I've erased all the partitions and downloaded Win7 Pro x64 from MSDNAA. So this problem was eliminated. Now I have a different problem - I have sda1 as Win bootloader, sda2 as Win system partition and I've partitioned the rest like this: I've allocated & formated sda3 for GRUB (100MB, ext2) and created sda4 as an encrypted LVM for Arch Linux (paranoid me ). I've nearly successfully installed Arch to sda4, but GRUB wouldn't let me install the boot record to the sda3 partition. (it offers just one option - the MBR (/dev/sda)) I heard this is because of the v3 kernel. How can I now boot into Arch if I insist on not changing the MBR and using the Win bootloader as the "first bootloader"?
PS.: I've tried "grub-install /dev/sda3" from the Arch installation CD but I got an error message. I think it was something about devmapper. I'll post it here once I've got one more computer to type it on...
EDIT: I've sorted it out. Just go through the installation as usual and after you edit the /boot/grub/menu.lst file, hit cancel at the bootrecord selection screen. Exit the installation wizard and install GRUB manually with grub setup (hdx,y), where x is your disk & y your partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.