LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-26-2011, 05:01 AM   #1
mike54
LQ Newbie
 
Registered: Apr 2011
Distribution: Arch
Posts: 9

Rep: Reputation: 0
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
Attached Thumbnails
Click image for larger version

Name:	partitions.png
Views:	37
Size:	68.4 KB
ID:	8247  

Last edited by mike54; 10-26-2011 at 05:49 AM.
 
Old 10-26-2011, 10:18 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
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.
 
Old 10-26-2011, 11:11 AM   #3
mike54
LQ Newbie
 
Registered: Apr 2011
Distribution: Arch
Posts: 9

Original Poster
Rep: Reputation: 0
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?

Last edited by mike54; 10-26-2011 at 11:15 AM.
 
Old 10-26-2011, 12:39 PM   #4
mike54
LQ Newbie
 
Registered: Apr 2011
Distribution: Arch
Posts: 9

Original Poster
Rep: Reputation: 0
UPDATE: output of EasyBCD:

Code:
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?

Last edited by mike54; 10-26-2011 at 12:44 PM.
 
Old 10-26-2011, 02:06 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
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.
 
Old 10-28-2011, 02:18 PM   #6
mike54
LQ Newbie
 
Registered: Apr 2011
Distribution: Arch
Posts: 9

Original Poster
Rep: Reputation: 0
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.

Last edited by mike54; 10-31-2011 at 02:10 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Error 0xc0000225 after resizing partition in Linux, can't boot Windows 7 now qwertz333 Linux - General 1 10-22-2010 05:00 AM
Can't boot after empty primary partition was made unallocated Azazwa Linux - Newbie 8 06-17-2010 08:44 AM
Resizing the windows partition danielcory Linux - Newbie 3 06-03-2008 06:32 AM
Resizing Windows Partition with FC6 hammanu Fedora - Installation 7 01-19-2007 10:50 PM
Messed up partition table and Windows' partition boot sector pyromithrandir Linux - General 32 04-08-2006 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration