Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] System Recovery: Grub Won't Boot! [Solved]
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Tux's lil' helper
Tux's lil' helper

Joined: 22 Feb 2006
Posts: 129

PostPosted: Thu Apr 27, 2006 3:59 pm    Post subject: [HOWTO] System Recovery: Grub Won't Boot! [Solved] Reply with quote

The other day I went to boot up my ~AMD64 system and to my horror my system did not boot into the grub boot screen. This brief howto is a description of how I recovered my system without a pre-made boot disk or a reinstallation of the entire system. I hope this helps anyone in a similar situation.

Step One:
Get or burn a copy of a gentoo install CD. Anything that allows you to boot a kernel will theoretically allow you to compete the recovery; however, the gentoo install CD provides a nice collection of utilities as well as being a familiar environment for gentoo users --you did install the system after all.

Step Two:

Make sure your BIOS boot order is setup to correctly boot from the CD.

Step Three:
Once your have booted into the liveCD environment you need to determine what problems grub is having with the system. It is at this point that you really have to do some investigating. In my situation grub would not show up in the boot process, so the evidence strongly suggested that grub had been zapped from my MBR. My hunch was that if I reinstalled grub into the MBR --much like the process in the installation process of the gentoo system-- I would be able to boot via grub and my system would minimally inconvenienced. In fact, the lack of grub on the MBR was my problem and nothing on my system was damaged.

Step Four:
After entering the liveCD environment I mounted my hda partitions in the /mnt/gentoo directory. Again, this is much like the installation process:
Mount my root partition...
mount /dev/hda3 /mnt/gentoo

Mount my /boot partition...
mount /dev/hda1 /mnt/gentoo/boot

Turn on Swap space...
swapon /dev/hda2

Step Five:
With the partitions mounted I needed to isolate the system, so a quick chroot did the trick:
chroot /mnt/gentoo /bin/bash
source /etc/profile

And for good measure I emerged a new copy of grub, though this is not necessary.

Step Six:
Invoke and install grub into the MBR:
$:grub --no-floppy
   root (hd0,0)
   setup (hd0)

Step Seven:
Before you reboot make sure to check your /etc/fstab. You need to make sure that fstab reflects the partition structure your system is expecting. Initially I neglected to add this step in my recovery and my system would boot, but most of the services and apps did not work properly. As you can see below, my system really needed more than just the /boot and / partitions. This will vary on your system, but just remember to get up and running fully, you must double-check fstab for proper booting.

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda3 / ext3 defaults,errors=remount-ro 0 1
/dev/hda1 /boot ext3 defaults 0 2
/dev/hda2 none swap sw 0 0
/dev/hda5 /home ext3 defaults 0 2
/dev/hda6 /usr ext3 defaults 0 2
/dev/hda7 /var ext3 defaults 0 2
/dev/hda8 /opt ext3 defaults 0 2
/dev/hda9 /opt/media ext3 defaults 0 2
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/hdd /media/cdrom1 iso9660 ro,user,noauto 0 0

Step Eight:
Reboot and make sure to take out the liveCD. Also, change the BIOS boot order back to normal, and hopefully enjoy your recovered system with minimal hassle. I think I am going to make a boot CD so I do not have this hassle again. Hope this helps someone.

Last edited by interested1 on Thu Apr 27, 2006 10:41 pm; edited 1 time in total
Back to top
View user's profile Send private message

Joined: 28 Feb 2006
Posts: 741
Location: Charlotte, North Carolina

PostPosted: Thu Apr 27, 2006 9:12 pm    Post subject: Reply with quote

just wana add to make sure (hd0,0) and such correspond to the right hard drive. If you set up grub, or gentoo on (for example) yoru seccond hard-drive, you would use (hd1,0) and (hd1) and such (as well as changing /hda to /hdb)
"WARNING: you may LOL"

This is my font size, color, and signature. It will change to whatever I pick. How cool is that?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum