[SOLVED] Grub2 won't load some OS's after expanding partitions
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
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.
Grub2 won't load some OS's after expanding partitions
Hello,
I recently expanded some partitions on my laptop.
And now grub2 will not load two of the five OS's.
Here is my laptop's current partition layout:
Code:
root@laptop:~# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa8a8a8a8
Device Boot Start End Blocks Id System
/dev/sda1 1 8486 68163763+ 7 HPFS/NTFS
/dev/sda2 * 8487 12403 31463302+ a5 FreeBSD
/dev/sda3 12404 12926 4200997+ 82 Linux swap
/dev/sda4 12927 19457 52460257+ 5 Extended
/dev/sda5 12927 16843 31463271 83 Linux
/dev/sda6 16844 18149 10490413+ 83 Linux
/dev/sda7 18150 19455 10490413+ 83 Linux
root@laptop:~#
bash-4.1$
sda2 is FreeBSD 8.2
sda5 is Slackware 13.1 (and is the OS the has the grub2 bootloader.)
sda6 is Ubuntu 10.04
sda7 is SuSe 11.2
The only thing that changed was the size of partitions 1,2,3,4,and 5.
Partitions 6 + 7 are the same size as before.
AND all OS's are on the same partition #'s as before I did the expansion.
The steps I took were:
Boot with a Slackware 13.1 installation DVD.
Backup the three Linux's to an external disk; using "cp -a".
Repartition the internal disk.
Restore the 3 Linux's to the same partition they before. Again using "cp -a".
Reboot with FreeBSD 8.2 installation DVD; and install FreeBSD 8.2.
Reboot after installing FreeBSD.
Experience a few minutes of terror when the single OS I did not back up; Windows.
Would not boot. Until I realized that it's partition ID was set to 83 (Linux) instead of 7 (HPFS/NTFS). Oops.
After that little bit of a brain fart and correcting the Windows partition ID.
Windows, FreeBSD, and Slackware all booted without issue.
But when attempting to boot Ubuntu or Suse; I get the error message:
Code:
error : you need to load the kernel first
I've tried everything I can think of; reinstalling grub2, new grub probe, various incarnations of grub.cfg, making new initrd's for Ubuntu and Suse.
But nothing has worked. And all the online searching I've done has gotten nothing.
Although I really don't think the problem is with my grub.cfg.
Here it is anyway (same as before the partition changes):
Code:
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "FreeBSD 8.2" {
set root=(hd0,2,a)
#kernel /boot/loader
chainloader +1
}
menuentry "Slackware 13.1" {
insmod ext2
set root=(hd0,5)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot/vmlinuz-huge-smp-2.6.33.4-smp root=/dev/sda5 ro vga=773
}
menuentry "Ubuntu 10.04" {
insmod ext2
set root=(hd0,6)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot/vmlinuz-2.6.32-28-generic root=/dev/sda6 resume=/dev/hda3 splash=0 showopts ro vga=773
initrd /boot/initrd.img-2.6.32-28-generic
}
menuentry "openSUSE 11.2" {
insmod ext2
set root=(hd0,7)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot/vmlinuz-2.6.31.14-0.6-default root=/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJF0S952139-part7 resume=/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJF0S952139-part3 splash=silent quiet showopts vga=0x317
initrd /boot/initrd-2.6.31.14-0.6-default
}
menuentry "Failsafe -- openSUSE 11.2" {
insmod ext2
set root=(hd0,7)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot/vmlinuz-2.6.31.14-0.6-default root=/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJF0S952139-part7 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x317
initrd /boot/initrd-2.6.31.14-0.6-default
}
First if you are running grub2 from your ubuntu installation it should respond to the update-grub command. Anyway my suspicitions are the mapping of the partitions has changed. You can check your partition numbers and uuid numbers against those listed in the grub.cfg.
First if you are running grub2 from your ubuntu installation it should respond to the update-grub command. Anyway my suspicitions are the mapping of the partitions has changed. You can check your partition numbers and uuid numbers against those listed in the grub.cfg.
I'm running grub2 from the Slackware partition. And all the partition numbers are correct.
I think you may have corrupted some files then. You might try fsck. If that does not do the job it looks like a repair or new install is the only alternative. I know Suse has a repair option on their dvd that you might try.
It appears that by expanding the first 5 partitions. I pushed partitions 6 + 7 beyond a BIOS / drive limitation.
I stumbled across the following at https://help.ubuntu.com/community/Grub2:
Code:
error: no such partition
If you have an older computer it's possible the BIOS cannot see your GRUB 2 files if they reside past the BIOS limitations
(generally 33 GB on very old computers and 137 GB on slightly newer computers). If this is the case the boot will fail
and an error: no such partition message will be displayed.
If at the grub prompt, type ls and ENTER. If the command does not display all the partitions, reboot and enter your
computer's BIOS setup. Ensure the BIOS reports the full disk size. If it doesn't, check for LBA/partition settings
or obtain a BIOS update from the manufacturer.
If unable to eliminate the BIOS limitation, the user can create a separate /boot partition within the disk area seen by the BIOS.
CreateBootPartitionAfterInstall
So my solution (at least for now) was to copy the Ubuntu's and Suse's /boot directories to the Slackware filesystem (aka partition #5).
And then modify grub.cfg as follows:
Code:
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "FreeBSD 8.2" {
set root=(hd0,2,a)
#kernel /boot/loader
chainloader +1
}
menuentry "Slackware 13.1" {
insmod ext2
set root=(hd0,5)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot/vmlinuz-huge-smp-2.6.33.4-smp root=/dev/sda5 ro vga=773
}
menuentry "Ubuntu 10.04" {
insmod ext2
set root=(hd0,5)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot_ubuntu/vmlinuz-2.6.32-28-generic root=/dev/sda6 resume=/dev/hda3 splash=0 showopts ro vga=773
initrd /boot_ubuntu/initrd.img-2.6.32-28-generic
}
menuentry "openSUSE 11.2" {
insmod ext2
set root=(hd0,5)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot_suse/vmlinuz-2.6.31.14-0.6-default root=/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJF0S952139-part7 resume=/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJF0S952139-part3 splash=silent quiet showopts vga=0x317
initrd /boot_suse/initrd-2.6.31.14-0.6-default
}
menuentry "Failsafe -- openSUSE 11.2" {
insmod ext2
set root=(hd0,5)
#search --no-floppy --fs-uuid --set d363b0a3-88f5-480b-be7e-ff2d374d6538
linux /boot_suse/vmlinuz-2.6.31.14-0.6-default root=/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJF0S952139-part7 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x317
initrd /boot_suse/initrd-2.6.31.14-0.6-default
}
Hope this also helps anyone else who stumbles upon this error.
I had heard of that problem but you are the first I have seen with the problem. The link you listed to ubuntu's tutorial is one of the best and easiest to understand I have seen.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.