View Full Version : WHOOPS: accidently hosed /boot
gregc7320
2007-02-22, 08:05 PM CST
Scene:
dual boot laptop:
FC6
W2k
Had a a senior moment in W2k disk manager & accidently hosed /boot (/dev/hda2)
Progress:
went to CD rescue mode ( & chrooted to /mnt/sysimage):
rebuilt /dev/hda2 as efs3 label=/boot to satisfy /etc/fstab OK
mounted /dev/hda2 OK
reinstalled base kernel, grub & fedora-logos to restore /boot files OK
ran mkinird for base kernel OK
touch /.autorelabel to restore selinux security context - reboot OK
I have 2 problems left:
1. kernel panics cause it can't find init until I remove the grub/kernel argument root=LABEL=/
2. yum kernel upgrades fail because evidently grubby spits if there is no root=blah in grub.conf
Suggestions welcome
--
Greg
Dies
2007-02-22, 09:48 PM CST
So, you're saying that in your grub.conf on the kernel line there is no ro root=x anywhere ?!? But it boots. :eek:
It sounds like that's what you're saying but that can't be right, can it? :confused:
If that is what you're saying then you need to add ro root=/dev/hda? to it.
stevea
2007-02-22, 09:52 PM CST
OK - I *assume* the /dev/hda1 is a Windows partition and /dev/hda2 is your /boot partition.
So where is your root "/" partition ?
1. kernel panics cause it can't find init until I remove the grub/kernel argument root=LABEL=/
So what does it do when you remove the root=LABEL.. ? My guess is that your root file system is LVM or something more exotic and when you did the mkinitrd you didn't include the modules for the root file system. If you can ID the root FS type someone can tell you what to put in modprobe.conf before you mkinitrd the next time.
You can reboot in rescue mode and see how the file systems are mounted wiith the "mount" command.
2. yum kernel upgrades fail because evidently grubby spits if there is no root=blah in grub.conf
How do you "yum" if you can't boot and rootfs mounted nor find inittab ? Are you booting the rescue disk and pivotting ? Please include a few details.
gregc7320
2007-02-24, 04:39 AM CST
I whipped up the article in a rush, & didn't really expect this interest. Thanks people for your responses. Before I respond individually, (may take me a day or to because of my idiotic weekebd schedule...) here is additional info requested - salient boot configs et al.
Sone additional points, I am composing this on the ill laptop, It boots OK by booting the grub config:
title Fedora Core (2.6.18-1.2798.fc6) no root-to-init
... bit of an oxymoron, isn't it
The W2k partition is hda1 ( It was an iso image, resized with knoppix/qtpartd). Boots OK
--
Greg
[root@dhcp-255-76 ~]# fdisk -l /dev/hda
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 2550 20480000+ 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/hda2 2550 2562 99233 83 Linux
/dev/hda3 2563 9729 57568927+ 8e Linux LVM
[root@dhcp-255-76 ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
[root@dhcp-255-76 ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/ida/c0d1p1
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Fedora Core (2.6.18-1.2798.fc6) orig
root (hd0,1)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb
initrd /initrd-2.6.18-1.2798.fc6.img
title Fedora Core (2.6.18-1.2798.fc6) no root-to-init
root (hd0,1)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro rhgb
initrd /initrd-2.6.18-1.2798.fc6.img
title Windows 2000
rootnoverify (hd0,0)
makeactive
chainloader +1
gregc7320
2007-02-26, 04:37 AM CST
the root partition & swap partition are inside a lvm. See my second post for fstab.
--
G
gregc7320
2007-02-26, 04:41 AM CST
the root fs & swap partition ore inside a lvm /dev/VolGroup00/LogVol00. See my 2nd post for fstab. I'm with you in hedging that therin lies the problem, but my lvm experience is lacking to solve this at the moment. I have done some google trawling on booting with lvms but no lights have come on yet.
--
Greg
gregc7320
2007-02-27, 04:45 AM CST
Well,I fixed it, but am still a bit confused as to why...
e2label /dev/VolGroup00/LogVol00 /
was what was required to satisfy the ...LABEL=/ kernel argument
I am now confused as to what caused this partition to drop its label.
Ideas anyone???
--
Greg
sideways
2007-02-27, 05:57 AM CST
Are you sure it was previously labelled? Your kernel can boot by specifying the mount point directly (using root=/dev/VolGroop00/LogVol00), maybe that's how it worked previously)
gregc7320
2007-02-27, 07:30 PM CST
In hindsight it probably wasn't labelled & the original grub.conf kernel argument was as you suggest. I had forgotten this important point in the heat of battle:
[root@localhost ~]# rpm -qf /boot/grub/grub.conf
file /boot/grub/grub.conf is not owned by any package
In fact, I forgot that I crafted grub.conf by hand after looking at my FC5 home server that wrapped the root fs in a lvm.
Supporting evidence:
"yum update kernel" is now happy. Lo & behold! the updated stanza in grub.conf doesn't use a label!
[root@localhost ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/ida/c0d1p1
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Fedora Core (2.6.19-1.2911.fc6)
root (hd0,1)
kernel /vmlinuz-2.6.19-1.2911.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb
initrd /initrd-2.6.19-1.2911.fc6.img
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,1)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb
initrd /initrd-2.6.18-1.2798.fc6.img
title Windows 2000
rootnoverify (hd0,0)
makeactive
chainloader +1
--
Greg
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.