Boot Problems:search
From bootinfoscript
Contents |
Symptoms
Shortly after grub2 tries to boot an item on the Grub Menu, booting fails and the following error message appears:
error: no such device: 86d32ee3-aec6-490b-8dab-e5cfff9c7af9
(of course the actual string of letter and numbers could be different)
Or you might get:
error: no such disk
Background
The menuentry in grub-cfg for your OS contains the line
search --no-floppy --fs-uuid --set 86d32ee3-aec6-490b-8dab-e5cfff9c7af9
This instructs Grub 2 to search for the partition with UUID 86d32ee3-aec6-490b-8dab-e5cfff9c7af9 and use this partition as root.
Causes
The UUID listed in grub.cfg is wrong
In some cases the UUID in the above search line in grub.cfg is wrong. This can for example happen if the UUID has changed due to formatting or partitioning.
Bugs
The "search" function is plagued by various bugs (see [1], [2]), causing the search to fail.
Solution
Step 1: Boot into your OS
At the grub menu at boot up (you might have to hold the "shift" key or press "Esc" to get to the Grub menu) select the OS you are trying to boot. But do not press "enter", press "e" instead to edit the menuentry. Delete the line
search --no-floppy --fs-uuid --set 86d32ee3-aec6-490b-8dab-e5cfff9c7af9
and then press "Ctrl+X". This should boot your OS. If you were not able to boot into you OS, you are infected by a different problem and should not continue this howto.
Boot into the OS controlling Grub.
Step 2 (Optional): Investigate the cause of the Problem
Open an terminal and type
sudo blkid gksudo gedit /boot/grub/grub.cfg &
Compare the UUID's from blkid with the UUID's on grub.cfg. If the UUID's do not match, you might just have to update grub.cfg. But if they match, your problem is probably caused by a bug, and you will have to remove the search line. In any case, continue with Step 3.
Step 3 Update grub.cfg
Open a terminal and
sudo update-grub
or if you upgraded from Ubuntu 9.04 to 9.10
sudo update-grub2
to update grub.cfg. Reboot. If you are able to boot into your OS without removing the "search line" you are all set. Otherwise continue with
Step 4 Remove the "search lines from grub.cfg
grub.cfg is not meant to be edited directly, so you have to edit the program which generates grub.cfg:
Open the file "grub-mkconfig_lib" via
gksudo gedit /usr/lib/grub/grub-mkconfig_lib
Look for the lines:
# If there's a filesystem UUID that GRUB is capable of identifying, use it;
# otherwise set root as per value in device.map.
echo "set root=`${grub_probe} --device ${device} --target=drive`"
if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
fi
and add a "#" to the beginning of the last three lines:
# If there's a filesystem UUID that GRUB is capable of identifying, use it;
# otherwise set root as per value in device.map.
echo "set root=`${grub_probe} --device ${device} --target=drive`"
# if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
# echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
# fi
Save the file. Then
sudo update-grub
or if you upgraded from Ubuntu 9.04 to 9.10
sudo update-grub2
and the search line no-longer will appear in grub.cfg.
Variation
Some users do not need to deleted the whole search line, but just need to remove the "--no-floppy" option. In this case just change the above lines in grub-mkconfig_lib to
# If there's a filesystem UUID that GRUB is capable of identifying, use it;
# otherwise set root as per value in device.map.
echo "set root=`${grub_probe} --device ${device} --target=drive`"
if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
echo "search --fs-uuid --set ${fs_uuid}"
fi
