![]() |
Grub can't find grub.cfg when booting - error: no such device
When I boot I briefly see 'Grub loading...' then I get dumped in 'sh:grub>'.
I can then boot up manually: linux (hd0,1)/vmlinuz root=/dev/sda1 initrd (hd0,1)/initrd.img boot I'm very new at this, so all my attempts at correcting it has been through reading posts turned up by google searches. Previously, I was dumped at the grub_rescue> prompt (have another thread about that, but I think this is a new issue, so I'm hoping making a new thread won't bring any mod's wrath down on my head), but that seemed to solve itself through no influence of mine... What I've tried to solve the 'sh:grub>' issue: In /etc/default/grub: I tried disabling quiet splash, in hopes there would be some lines that would give me a clue as to what is going on, but it jumps directly from Grub loading to sh:grub> I tried commenting out Grub_Hidden_Timeout and setting it to a positive integer I tried uncommenting GRUB_DISABLE_LINUX_UUID=true In /etc/grub.d/10_linux: I tried commenting out 'if [ -n \${have_grubenv} ]; then save_env recordfail; fi' Then I tried typing 'search -f /boot/grub/grub.cfg' at the sh:grub> prompt and got 'error: no such device: /boot/grub/grub.cfg' which I guess meant all my previous attempts were void as grub couldn't even find grub.cfg :redface: I've tried to reinstall grub with 'grub-install --recheck /dev/sda'. Then I found this thread and tried out "grub-setup -r '(hd0,1)' /dev/sda", hoping it would point to my grub.cfg as well. No such luck. I'm pretty much in over my head here, and I don't know what to do. Any help would be very much appreciated. |
Can you give us a general idea of what your file system layout was like? For example mine I always make a boot partition first /boot = /dev/sda1. This may help us first.
When you boot up manually can you post what your menu.lst file shows? |
Quote:
Quote:
Quote:
Please be aware that any trailing spaces on any of the lines in any of the scripts in /etc/grub.d/ will cause grub2 to fail, silently, with no error message, and grub.cfg will not be updated. Once you have done all that, please do sudo update-grub Now check the date/time on grub.cfg - Was it updated? If not re-check the scripts in /etc/grub.d/ for spaces and syntax. Once you have been able to update grub.cfg then Reboot If it still doesn't work, please post your /boot/grub/grub.cfg file. I expect you have seen this: http://www.dedoimedo.com/computers/grub-2.html I hate grub2 ;) |
Quote:
|
I'm sorry, I should have said it was Grub2 :redface:
I put everything back the way they were when they didn't work. Checked the files, and I can't find any trailing spaces. That is, if trailing spaces are at the end of a line? I didn't check at the beginning. Will space instead of tab make a difference? Should I go over them again? My grub.cfg updated as it should - and according to the time stamp, did so previously as well - when I ran update-grub. No change on boot, though :( My grub.cfg file: Code:
#Oh... and I'm a she... ;) |
If your grub.cfg is being updated, the scripts in /etc/grub.d/ have to be OK.
Yes, "trailing spaces" are spaces at the end of a line, after the last printable character. Your grub.cfg looks OK, but obviously isn't working. Try sudo grub-install /dev/sda Any errors reported? If not, try a reboot now. If that fails, here are some things to think about: 1] grub.cfg is referring to disk partitions by UUID, you should check these are correct (as root) with fdisk -l and vol_id --uuid /dev/sda1 If they are not right, (or even if they are) you could try setting grub's default not to use UUIDs by editing /etc/default/grub and uncommenting GRUB_DISABLE_LINUX_UUID=true Then re-run update-grub Your grub.cfg should now refer to your root partition as root=/dev/sda1 and not root=UUID=... 2] Check the /boot/grub/device.map file. Yours should probably look like this: (hd0) /dev/sda [I am guessing that you just have one HDD with root and swap partitions, if not please post the output of fdisk -l and tell us what the partitions are.] If all this fails, there's a HOWTO for re-installing grub2 in the link I gave you in post #3 But I'd prefer we found and fixed the problem rather than blindly reinstalled grub. Quote:
Good luck, please let us know how you get on. |
Yay! 'sudo grub-install /dev/sda' did the trick! Now I get the grub menu ^^
Ofcourse, when I click one of the entries, I just get 'press any key to continue' >.< If it's not one thing, it's another <.< My current grub.cfg (I disabled UUID): Code:
#Oh... and... should I start panicking if fdisk -l returns nothing? vol_id returns 'command not found' (I'm on Ubuntu 64-bit... Another thing I forgot to tell... Not making it easy, am I? :redface:) The contents of my device.map is: (hd0) /dev/sda (hd1) /dev/sdb And while fdisk -l didn't return anything, I checked the contents of my /dev folder, and all my disks and partitions are there: sda, sda 1 (linux), sda 2 (I don't remember off the top of my head), sda 5 (swap) sdb, sdb1 (my files and random stuff), sdb2 (a failed Windows installation from before Ubuntu) |
Quote:
Quote:
It's up to you. Quote:
Quote:
Quote:
Your device.map looks fine. |
Yeah, not click, pick any entries... just getting my methods mixed up :P
Anyways, thanks a lot of all your help, I think I can maybe figure it out now... possibly... :) |
| All times are GMT -5. The time now is 07:22 PM. |