LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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

Reply
 
Search this Thread
Old 03-31-2011, 10:15 PM   #1
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 113

Rep: Reputation: 23
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:
  1. Boot with a Slackware 13.1 installation DVD.
  2. Backup the three Linux's to an external disk; using "cp -a".
  3. Repartition the internal disk.
  4. Restore the 3 Linux's to the same partition they before. Again using "cp -a".
  5. Reboot with FreeBSD 8.2 installation DVD; and install FreeBSD 8.2.
  6. Reboot after installing FreeBSD.
  7. 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
}

Does anyone have any idea what is going wrong ?

Thanks;
--ET
 
Old 04-01-2011, 05:38 AM   #2
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Run the command

os-prober

then

update-grub
 
Old 04-01-2011, 06:25 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,425

Rep: Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055
With grub2, update-grub automagically runs os-prober
 
Old 04-01-2011, 06:37 AM   #4
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Quote:
Originally Posted by syg00 View Post
With grub2, update-grub automagically runs os-prober
Thanks for the info, as usual covering my back
 
Old 04-01-2011, 09:03 AM   #5
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 113

Original Poster
Rep: Reputation: 23
Hmm; thanks. But there is no update-grub.

The grub on my system only has the following:

Code:
root@laptop:~# ls /usr/local/bin/*grub*
/usr/local/bin/grub-editenv*  /usr/local/bin/grub-fstest*  /usr/local/bin/grub-mkelfimage*  /usr/local/bin/grub-mkfont*  /usr/local/bin/grub-mkimage*  /usr/local/bin/grub-mkrescue*
root@laptop:~# ls /usr/local/sbin/*grub*
/usr/local/sbin/grub-emu*  /usr/local/sbin/grub-install*  /usr/local/sbin/grub-mkconfig*  /usr/local/sbin/grub-mkdevicemap*  /usr/local/sbin/grub-probe*  /usr/local/sbin/grub-setup*
root@laptop:~#
and I've tried them all.

--ET
 
Old 04-01-2011, 11:04 AM   #6
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
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.
 
Old 04-01-2011, 11:07 AM   #7
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 113

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by Larry Webb View Post
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.

--ET
 
Old 04-01-2011, 12:11 PM   #8
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
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.
 
Old 04-01-2011, 02:31 PM   #9
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 113

Original Poster
Rep: Reputation: 23
Well now; this is peculiar.
Slackware, FreeBSD, and Windows all see partitions 6 + 7.
But Grub does not.

When issuing an "ls" from Grub's command line prompt. I get the following:
Code:
sh:grub> ls
(hd0) (hd0,5) (hd0,3) (hd0,2,b) (hd0,2,a) (hd0,2) (hd0,1) (fd0)
error: no such disk
sh:grub>
Hmm; why doesn't grub2 see partitions 6 + 7 ?
(It saw them before expanding partitions 1 through 5.)

--ET

Last edited by slacker_et; 04-01-2011 at 02:36 PM.
 
Old 04-01-2011, 03:50 PM   #10
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 113

Original Poster
Rep: Reputation: 23
Lightbulb

Solved it !

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.

Thanks for the replies;
--ET
 
Old 04-01-2011, 05:37 PM   #11
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
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.
 
Old 04-04-2011, 08:01 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,677

Rep: Reputation: Disabled
Please mark this thread as [SOLVED] in the thread-tools at the top so others may easier find it as reference.

<edit> Uuups, fast work </edit>

Last edited by JZL240I-U; 04-04-2011 at 08:04 AM.
 
Old 04-04-2011, 08:08 AM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,425

Rep: Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055
Erk - haven't seen that in 4-5 years. Can't you get a BIOS update ?.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub2 failing to load xinquan Linux - General 10 06-12-2011 03:21 PM
[SOLVED] Expanding Partitions. sandgroper Linux - General 12 05-29-2010 12:37 PM
[SOLVED] trouble expanding 4+TB GPT partition after expanding hardware RAID-5 volume muad'dib Linux - Enterprise 6 09-26-2009 06:01 PM
Expanding Root Partition and Other Partitions scoobs Linux - Software 2 12-06-2005 03:57 AM
Mandriva - Ndiswrapper won`t load konfusionrave Linux - Wireless Networking 1 08-29-2005 08:52 AM


All times are GMT -5. The time now is 12:11 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration