View Full Version : [fc2] where did grub go?
GiLuX
23rd June 2004, 04:20 AM
i'm used to grub being in /boot/grub but it isnt.
i found the conf in /etc but it's empty...
but the loader gives me 2 kernel options...
where does it get this information from?
also, the kernels the grub boot menu shows me don't exist in /boot
i should have installed at least 4 kernels,
-the original
-2 newer 8 stack variants
-latest fc2 kernel
but the boot loader menu only shows me the original and an old 8 stack
i can't even seem to find the kernel that's currently active on my system
what's going on here :confused:
maybe it has something to do with a crash i experienced earlier onthis day which made me reset my pc...
(evolution is also behaving strangely, it keeps on collecting mail it already collected over and over again)
crackers
23rd June 2004, 04:55 PM
Sounds like your system is giving you the high-sign to backup what you can and either re-install from scratch and/or get a new hard-drive (or a new motherboard). I've had a driver-controller chip that took a plunge on me - it was weird literally watching the filesystem eradicate itself as I was frantically backing up critical stuff!
bradthemad
23rd June 2004, 05:14 PM
Is there anything at all in /boot? If /boot is on a separate partition, is it mounted?
GiLuX
23rd June 2004, 11:43 PM
i don't think the hardware is dieing or anything... it's fairly new and everything else seems to be running fine... i think :eek:
grub.conf seems to be a sym link:
#ls -al /etc/grub.conf
lrwxrwxrwx 1 root root 22 May 27 14:20 /etc/grub.conf -> ../boot/grub/grub.conf
somehow the whole grub dir dissapeared from /boot but at start up i still get a boot menu showing kernels not existent in the current /boot dir...
i did a search and all i could find was /lib/modules/2.6.5-1.358.8kstacks
my guess is that when grub can't find the conf file it looks in /lib/modules and builds a boot menu from that or something (doesn't it need initrd/vmlinuz and such?).
anyhow,
could i just copy my entire /boot/grub dir from an old fc1 hdd to my new fc2 hdd and just edit the conf file or is that asking for more trouble?
ghenry
24th June 2004, 12:35 AM
This happened to me on a crash too. I just stuck the Fedora CD's again and did an upgrade, even though I had already upgaded. It lets you do it again anyway.
GiLuX
24th June 2004, 02:48 AM
i still think it's strange that a single hang up causes creepy things like this.
i used to have a win2000 install with a mega overclocked video card and the pc froze up completely several times during game play because of the oc'ed video card and i had to reset by unplugging the power cable but it seemed like windows didn't care, it booted up fine afterwards.
is linux more vulnerable to data loss due to lock ups than other os'es?
bradthemad
24th June 2004, 04:02 AM
I'll ask again: If your /boot is on its own partition, is it mounted? It is entirely possible to have a running system without mounting /boot.
GiLuX
24th June 2004, 05:24 AM
I'll ask again: If your /boot is on its own partition, is it mounted? It is entirely possible to have a running system without mounting /boot.
thnx for your persistence,
you might be right there... :o
it is on a different partition (hda1) and it seems like it doesnt get mounted at start up anymore (and /swap isnt either i think)...
# mount
/dev/hda2 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
how can this be?
# mount -av
mount: none already mounted on /dev/pts
mount: none already mounted on /proc
mount: none already mounted on /sys
mount: the label /boot occurs on both /dev/hda1 and /dev/hdc2
mount: LABEL=/boot duplicate - not mounted
but i still see files in /boot
# ls -al /boot
total 5000
drwxr-xr-x 2 root root 4096 Jun 22 15:46 .
drwxr-xr-x 22 root root 4096 Jun 22 16:47 ..
-rw-r--r-- 1 root root 46470 Jun 10 13:53 config-2.6.6-1.427
-rw-r--r-- 1 root root 46372 Jun 12 20:34 config-2.6.6-1.427.8kstacks
-rw-r--r-- 1 root root 46437 Jun 14 13:23 config-2.6.6-1.435
-rw-r--r-- 1 root root 192682 Jun 22 15:46 initrd-2.6.6-1.427.8kstacks.img
-rw-r--r-- 1 root root 193224 Jun 11 18:39 initrd-2.6.6-1.427.img
-rw-r--r-- 1 root root 191811 Jun 15 16:49 initrd-2.6.6-1.435.img
-rw-r--r-- 1 root root 237792 Jun 10 13:53 System.map-2.6.6-1.427
-rw-r--r-- 1 root root 238228 Jun 12 20:34 System.map-2.6.6-1.427.8kstacks
-rw-r--r-- 1 root root 237792 Jun 14 13:23 System.map-2.6.6-1.435
-rw-r--r-- 1 root root 1203750 Jun 10 13:53 vmlinuz-2.6.6-1.427
-rw-r--r-- 1 root root 1205399 Jun 12 20:34 vmlinuz-2.6.6-1.427.8kstacks
-rw-r--r-- 1 root root 1203768 Jun 14 13:23 vmlinuz-2.6.6-1.435
but none of the above kernels is loaded right now??
so what happened here is that fc2 confused the hdc drive (containing an old fc1 install) with the hda drive and since refused mounting it at bootup and then when i installed the new kernels RPM couldn find the /boot partition so it decided to create one by it self and copied everything in there.
why does fedora get confused which label to use?
hda is on the ide1 which should have precedens over ide2... not?
# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
how can i solve this safely?
it still confuses me how it can boot kernels from a non mounted /boot partition containing them.
bradthemad
24th June 2004, 06:21 AM
Grub loads the kernel and initrd, before anything at all is mounted. After that, the /boot partition isn't really needed, except to install new kernels into. The kernel runs because grub loaded it, it doesn't get mounted and the file executed like init and everything after that. Once the kernel is running, / gets checked and mounted, followed by /boot and everything else in your fstab. You can actually "umount /boot" on a running system; there shouldn't be any processes using it.
You have two partitions with the same volume label. Grub knows the correct location of your FC2 /boot because it has the name of the hardware device, like hd(0,0), rather than a label, so it still works okay. When your filesystems are getting mounted, though, the duplicate label is causing confusion. How mount should react to duplicate labels is immaterial; you just shouldn't have duplicate labels, period. You can change the label to something like "fc1boot" on that partition with "/sbin/tune2fs -L fc1boot /dev/hdc2". Alternately, you can edit /etc/fstab to use /dev/hda1 for /boot instead of "LABEL=/boot".
In the meantime, it looks like you've installed some other kernels, which just went into the /boot directory on the / partition instead of on any /boot partition. Move all that stuff into a temporary directory, get /boot completely empty, get the labels fixed, get the right /boot mounted, and copy whatever you need back into /boot from the temp directory. Grub should be fine, it never really got screwed up. Just make sure the "real" /boot partition has all the kernels you want and that they're listed correctly in /boot/grub/grub.conf. I don't think you'll necessarily have any major problems once all that is done, but you might want to have a rescue cd handy, just in case.
As for swap, that doesn't really get mounted like a filesystem does. You can see if you have swap space enabled with "swapon -s".
GiLuX
24th June 2004, 12:25 PM
bradthemad,
thnx for the exellent explaination!!
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.