LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (https://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   Grub instead of LILO - before reboot (https://www.linuxquestions.org/questions/slackware-installation-40/grub-instead-of-lilo-before-reboot-568082/)

b0uncer 07-10-2007 07:54 AM

Grub instead of LILO - before reboot
 
Tried to search one older thread that, if I remember correctly, had something to do with this. I couldn't find it, so I'll post this newer one (also to make another thing clear).

Shortly: when installing Slackware it still has LILO as default. I intend to use GRUB, and so I'll have to install LILO first and then overwrite it after rebooting. That's too much (for me anyway) so..how do I install GRUB after setup before rebooting?
Code:

grub-install /dev/hda
does not seem to work, it complains something about not finding suitable /boot (I don't remember the exact phrase, but if you need it, I could probably get it later).

The other thing is that if there's Linux+GRUB on a harddisk and the MBR happens to get trashed (I do use MBR for a reason), for example because of a Windows installation, I can use a bootdisk to boot the OS ("rescue mode" or something) but again doing grub-install doesn't work. Creating a GRUB bootdisk isn't possible since there's no floppydrive available and I wouldn't like to waste a cd for that (if it even worked). grub-install works perfectly from a working, booted Linux (like my Slackware), but if it's booted off a live-cd of some kind (or "rescue mode"), it complains about /boot even though I've mounted the disk filesystems and chroot'ed..

Any ideas (thanks already, if any)?

Ahmed 07-10-2007 09:59 AM

You might want to try out

Code:

# grubconfig
Should give you a straightforward menu setup for it.

And by the way, under Slackware 12 nowadays you can create a boot USB-stick, which is nice as most newer PCs don't come with floppy drives any more (sadly). Another possibility would be to install grub itself onto the stick for safekeeping. If anything happens to your MBR, shove in the stick, make sure the configuration is still valid for your system, and boot.

-A

b0uncer 07-10-2007 11:26 AM

Quote:

If anything happens to your MBR, shove in the stick, make sure the configuration is still valid for your system, and boot.
That does sound handy, yes, but I dislike the idea of spending an usb stick for that purpose only..stores nowadays sell 256MB+ sticks, and GRUB hardly uses that much. In addition I dislike usb keys because they're just in the way :) less than cds, but more than nothing..

I forgot to mention I did try to run 'grubconfig', which works a bit like 'liloconfig' but that didn' work either (exit with the same error about /boot). In the end I did use 'liloconfig' to install LILO and it ran just fine; this leads me to think that even though I had chroot environment, GRUB couldn't access /boot for some reason. That strikes me odd, because it should have (I tried manually that the access was ok).

But basically it should be sufficient to just mount /boot (and root?) and run grub-install chrooted?

gnashley 07-10-2007 12:19 PM

grubconfig will fail if /boot is mounted. grubinstall can be used. You'll need to copy the config files and stages into /boot/grub.

b0uncer 07-10-2007 12:36 PM

Quote:

grubconfig will fail if /boot is mounted. grubinstall can be used. You'll need to copy the config files and stages into /boot/grub.
All right. One more thing: at some point I managed to get another error instead of the /boot one, telling me I didn't have stage_1.5 (or something like that) and that I'd need to make sure it's in the right directory. GRUB was in this case already installed (so everything was supposed to be in place, just MBR was not right), but I couldn't find the asked file anywhere, not with find nor with (s)locate. Any clues?


All times are GMT -5. The time now is 02:58 PM.