Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
'emerge -eu world' broke grub[part. solved with LILO]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Lochar
n00b
n00b


Joined: 01 Oct 2003
Posts: 18

PostPosted: Thu Jan 20, 2005 3:16 am    Post subject: 'emerge -eu world' broke grub[part. solved with LILO] Reply with quote

For some reason I managed to break grub with emerge -eu world. After it was done, I rebooted, and all I see is a 'GRUB' without prompt (hang) in the left upper corner.

First of, I have dual boot at this time during my mitigation, and has it installed similar to this thread: https://forums.gentoo.org/viewtopic.php?t=10588. I have had the system up running for two weeks or so, I just figured I would recompile stuff with another optimization as I didnt really do any optimization when installing.

Code:

Ive done everything I can think about, in random order:
1) CFLAG="" emerge grub
2) check link on boot (removing and made a new)
3) check link on menu.lst -> grub.conf
4) removed everything that involved framebuffer in grub.conf
5) grub-install --root-directory=/boot /dev/hda6
6) emerge unmerge grub -> CFLAG="" emerge grub
7) grub> root (hd0,5)
    grub>setup (hd0,5)
    grub>exit
** e2fsck /dev/hda6
** cp /usr/src/linux/System.map /boot/System.map<number> and kernel


Some system info:

Code:
/boot/grub.conf

default 0
timeout 10
title=Gentoo-2.6.10-r4
root (hd0,5)
kernel /kernel-2.6.10-gentoo-r4 root=/dev/hda8



Code:

# /etc/fstab: static file system information.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>             <mountpoint>    <type>     <opts>            <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda6      /boot      ext2      noauto,noatime      1 2
/dev/hda8      /      ext3      noatime         0 1
/dev/hda7      none      swap      sw         0 0

/dev/cdroms/cdrom   /mnt/cdrom   auto      noauto,user      0 0
/dev/hda5      /mnt/win   vfat      noatime         0 0
# NOTE: The next line is critical for boot!
none         /proc      proc      defaults      0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
# Adding the following line to /etc/fstab should take care of this:

none         /dev/shm   tmpfs      nodev,nosuid,noexec      0 0



At this time I am out of options, everything began very good and I had a nice experiance for the two weeks, to bad I forgot to mask grub in portage, so it wouldnt update on a system update, that I rather have to manually update it. Lesson learn, grub is the first thing to get masked when I get it to work again.

A question: on /dev/hda6 (ie /boot) there is a symlink to boot. If I 'cd boot' should I jump back to /boot or should the path be /boot/boot?

Any thoughts?
_________________
Lochar


Last edited by Lochar on Thu Jan 20, 2005 5:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2969

PostPosted: Thu Jan 20, 2005 4:54 am    Post subject: Re: 'emerge -eu world' broke grub Reply with quote

Lochar wrote:
Lesson learn, grub is the first thing to get masked when I get it to work again.

Believe it or not, you DO NOT need a working grub to get into your system. Surprised?

Just boot from your liveCD, then mount partitions and the proc filesystem, and chroot in and update the environment variables, exactly as if you were doing an installation.
Code:
mount /dev/hda1 /mnt/gentoo/boot/
mount /dev/hda3 /mnt/gentoo/
mount -t proc none /mnt/gentoo/proc/
chroot /mnt/gentoo/
env-update
source /etc/profile

From here, you can mask and then re-emerge grub with the following commands.
Code:
echo ">=sys-boot/grub-<BROKEN VERSION NUMBER>" >> /etc/portage/package.mask
emerge grub


Lochar wrote:
A question: on /dev/hda6 (ie /boot) there is a symlink to boot. If I 'cd boot' should I jump back to /boot or should the path be /boot/boot?

If you do the "pwd" (print working directory) command after you "cd boot" inside /boot, it will show
Code:
/boot/boot
but in reality, you are still in /boot.
Back to top
View user's profile Send private message
Lochar
n00b
n00b


Joined: 01 Oct 2003
Posts: 18

PostPosted: Thu Jan 20, 2005 4:10 pm    Post subject: Reply with quote

Yes, I dont know how many times Ive chrooted =). Im going to give LILO a chance instead.
_________________
Lochar
Back to top
View user's profile Send private message
Lochar
n00b
n00b


Joined: 01 Oct 2003
Posts: 18

PostPosted: Thu Jan 20, 2005 5:30 pm    Post subject: Reply with quote

[partial solved]

LILO works like a charm...

I wonder what happened...

I would have prefered GRUB as I would only need to change the grub.conf
when I recompile/change kernel.

Another thing, I actually think one part of my problem was that GRUB (first)
installed itself in /boot (on the root partition) while boot partition wasnt
mounted. Its kinda weird that this happens with an emerge -e world, am I
supposed to mount boot before (I have it on noauto)? If that is the case, its
quite dangerous, as mounting boot partition is not the first thing you think of when updating world.

Anyway, will be a while before I try GRUB again ;) Now Im going to enjoy my Gentoo =P
_________________
Lochar
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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