grub workaround for cannot find UUID in dual boot system fails and now grub won't boot anything

6,981

Well, since it really is a two part question, I can answer the implicit first one about how to get grub2 to at least boot ubuntu.

It goes like this:

  • Boot from LiveCD (x86 11.10 Desktop)

  • Mount the root of the Ubuntu 10.10 at /mnt

  • Change root

  • Remove workaround changes to /usr/lib/grub/grub-mkconfig_lib

  • Run update-grub

  • Reboot

The above steps are from near the bottom of the Ubuntu Community Documentation of Grub2

⋯the particulars are by example after booting from CD and running in terminal…

sudo -iI've spent too many years as su, but you shold use "sudo …" in front of each command

ubuntu@ubuntu:~$ sudo -i

fdisk -lthat's a lower case LFind the 11.10 installation partitions, (other disks snipped here)

fdisk -l

⋯ ⋯ ⋯

Disk /dev/sde: 300.1 GB, 300089646592 bytes
255 heads, 63 sectors/track, 36483 cylinders, total 586112591 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3f5ebeb

Device    Boot      Start         End      Blocks   Id  System
/dev/sde2       138464296   586110975   223823340    5  Extended
/dev/sde3   *        2048   138463231    69230592   83  Linux
/dev/sde5       138464298   313460279    87497991    7  HPFS/NTFS/exFAT
/dev/sde6       313460736   317650943     2095104   82  Linux swap / Solaris
/dev/sde7       317652992   581922815   132134912   83  Linux
/dev/sde8       581924864   586110975     2093056   82  Linux swap / Solaris

Partition table entries are not in disk order

mount /dev/sde3 /mntmy root partition, sde7 is my home partition

ls /mntjust checking to see if I got it right

root@ubuntu:~# mount /dev/sde3 /mnt
root@ubuntu:~# ls /mnt
bin   cdrom  etc   initrd.img      lib         media  opt   root  sbin     srv  tmp  var      vmlinuz.old
boot  dev    home  initrd.img.old  lost+found  mnt    proc  run   selinux  sys  usr  vmlinuz

for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; donedo as one line

chroot /mntchange the root

sudoedit /usr/lib/grub/grub-mkconfig_libhere I undo the changes

update-grubnow update grub

root@ubuntu:~# for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
root@ubuntu:~# chroot /mnt
root@ubuntu:/# sudoedit /usr/lib/grub/grub-mkconfig_lib
root@ubuntu:/# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.0.0-13-generic
Found initrd image: /boot/initrd.img-3.0.0-13-generic
Found linux image: /boot/vmlinuz-3.0.0-12-generic
Found initrd image: /boot/initrd.img-3.0.0-12-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sdc1
done

sudoedit /etc/default/grubcheck to see if changed (should be same as the original)

sudoedit /boot/grub/grub.cfgcheck to see if mounting by UUID as originally

And it was.

Now to file a bug report for the boot failure…

Share:
6,981

Related videos on Youtube

keepitsimpleengineer
Author by

keepitsimpleengineer

Retired from… System Admin (Unix/Linux) Oracle DBA/Developer GUI Application Developer Simulation Engineer·Real-time Hardware in Loop Technical Project Engineering College Instructor (programming) Flight Test Engineer Aerospace Engineer Flight Test Data Analysis …after 45 years. About time! Now I futz around with my six computers, two Windows systems and six Linux systems two archlinux, one Debian and two Ubuntus. Help out friends and post stuff that I have worked through and think might help others. Also dabble in cooking, photography, music and goofing off.

Updated on September 18, 2022

Comments

  • keepitsimpleengineer
    keepitsimpleengineer over 1 year

    New clean install of x86 11.10 desktop. Dual boot with windows XP and Linux on separate drives.

    After install grub will not boot Windows, but by changing boot drive boots fine.

    When I go to fix this I find from http://bootinfoscript.sourceforge.net/ and a link to http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:search my problem, the message on the grub boot error screen:

    error: no such device: 6⋯⋯⋯⋯⋯⋯⋯

    So I follow the Step2 and compare the output of:

    sudo blkid and

    sudo nano /boot/grub/grub.cfg

    The UUIDs in both match for the Windows drive, so I do the fix in Step 4 "remove the search lines for …" in /usr/lib/grub/grub-mkconfig_lib, commenting out the three lines as before⋯

    # if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
    # echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
    # fi
    

    I run sudo update-grub and check /etc/default/grub.cfg and see that it now identifies the Windows partition not by UUID, which I suppose is the workaround.

    But now when I try to boot 11.10 Desktop, I get:

    error: no such partition… …

    and when I try to boot Windows, I get:

    error: invalid signature.

    So Now, how do I fix this…

    The boot problem and find a workaround that works?