LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   Tried to Ext3 a 3TB drive, now grub can't find the kernel Centos 5.6 Raid 1 (http://www.linuxquestions.org/questions/red-hat-31/tried-to-ext3-a-3tb-drive-now-grub-cant-find-the-kernel-centos-5-6-raid-1-a-886971/)

wagonlips 06-17-2011 08:05 PM

Tried to Ext3 a 3TB drive, now grub can't find the kernel Centos 5.6 Raid 1
 
After setting the partition on the new external 3TB drive (using gdisk), I rebooted and that's when the trouble began. The external drive, which was to back up some other failing drives, none of which is the boot disk, seemed to be preventing boot. Probably, I should have made more careful note of what the computer said at that time, but it was late and I was tired and... http://xkcd.com/349/ Probably, I should have just unplugged the new drive and started over, but instead I tried to fix things by commenting out the new drive in fstab.

In rescue mode, I can chroot /mnt/sysimage, so I assume it's mostly in good shape. I just need to figure out how to fix grub. But since it's a Raid 1, things are a teeny bit more complicated. It's a software raid that is managed by the Intel BIOS on an Inspiron 530s, Intel Celeron 450 (2.20GHz,800FSB).

So far, I've tried to install-grub on /dev/mapper/isw_caaccjcibc_mercurial1 and received the error message: "The file /boot/grub/stage1 not read correctly." Not sure what to make of that.

Suggestions? Advice? Amusing anecdotes or favorite web comics?

fdisk -l looks like this:
Code:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          13      104391  83  Linux
/dev/sda2              14      60800  488271577+  8e  Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1          13      104391  83  Linux
/dev/sdb2              14      60800  488271577+  8e  Linux LVM

fstab:
Code:

/dev/VolGroup00/LogVol00 /                      ext3    defaults        1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
tmpfs                  /dev/shm                tmpfs  defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                  /sys                    sysfs  defaults        0 0
proc                    /proc                  proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/dev/sdj2      /mnt/temp  ntfs-3g  ro,umask=0222,defaults 0 0
#/dev/sde1      /media/backup2011 ext3 defaults 0 2

/boot/grub/device.map:
Code:

# this device map was generated by anaconda
(hd0) /dev/mapper/isw_caaccjcibc_mercurial1

/boot/grub/grub.conf:
Code:

# 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/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/mapper/isw_caaccjcibc_mercurial1
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-238.12.1.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-238.12.1.el5
        module /vmlinuz-2.6.18-238.12.1.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-238.12.1.el5xen.img
title CentOS (2.6.18-238.12.1.el5debug)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-238.12.1.el5debug ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-238.12.1.el5debug.img
title CentOS (2.6.18-238.9.1.el5debug)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-238.9.1.el5debug ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-238.9.1.el5debug.img
title CentOS (2.6.18-238.9.1.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-238.9.1.el5
        module /vmlinuz-2.6.18-238.9.1.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-238.9.1.el5xen.img
title CentOS (2.6.18-238.5.1.el5debug)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-238.5.1.el5debug ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-238.5.1.el5debug.img
title CentOS (2.6.18-238.5.1.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-238.5.1.el5
        module /vmlinuz-2.6.18-238.5.1.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-238.5.1.el5xen.img
title CentOS (2.6.18-194.32.1.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-194.32.1.el5
        module /vmlinuz-2.6.18-194.32.1.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-194.32.1.el5xen.img
title CentOS (2.6.18-194.32.1.el5debug)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-194.32.1.el5debug ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-194.32.1.el5debug.img
title CentOS (2.6.18-194.26.1.el5debug)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-194.26.1.el5debug ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-194.26.1.el5debug.img
title CentOS (2.6.18-194.26.1.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-194.26.1.el5
        module /vmlinuz-2.6.18-194.26.1.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-194.26.1.el5xen.img


wagonlips 06-19-2011 11:28 AM

Manually Rebuild Grub
 
I thought this looked like a close match to my problem:
http://idolinux.blogspot.com/2009/07...er-on-md0.html
Only it didn't work for me.
Code:

grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 15 sectors are embedded. succeeded
Running "install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/grub.conf"... failed
Error 2: Bad file or directory type


wagonlips 06-19-2011 12:06 PM

Manually Rebuild Grub
 
Next, this link shows some interesting stuff: http://www.linuxquestions.org/

So I type 'root (hd0,' and then hit the tab key and see this:
Code:

Possible partitions are:
  Partition num: 0, Filesystem type is ext2fs, partition type 0x83
  Partition num: 1, Filesystem type is unknown, partition type 0x8e

Thanks to this page: Partition types: List of partition identifiers for PCs I can see that 0x83 is a 'Linux native partition' and 0x8e is a 'Linux Logical Volume Manager partition.' But that doesn't really help me much, since running setup on the 0x8e partition fails with the message: "Error 17: Cannot mount selected partition."

But something has happened: now when I try to boot, CentOS starts, sort of. Instead of the Grub shell, I land on a page with the blue CentOS logo in the background and 'GNU GRUB version 0.97 (616K lower / 2085440K upper memory)' at the top. And a big list of kernels:
2.6.18-194.26.1.el5xen
2.6.18-194.32.1.el5xen
2.6.18-238.5.1.el5xen
2.6.18-238.9.1.el5xen
2.6.28-238.12.1.el5xen
and all of their debug versions, too.
Unfortunately, choosing most of these simply leads me to the 'Bad file or directory type' error message and at least one of them causes a kernel panic.

Tune in next week for the next exciting installment!

wagonlips 06-24-2011 11:31 PM

Supergrub
 
Downloaded supergrub (http://www.supergrubdisk.org/). And this looks like a fine utility, but it hasn't improved my situation any. I think, for the most part, I had already repaired grub. And now, whenever I try to boot any of the kernels, grub says: Error 2: Bad file or directory type. And this page here: http://www.uruk.org/orig-grub/errors.html tells me that "This error is returned if a file requested is not a regular file, but something like a symbolic link, directory, or FIFO." But I don't think I can take that at face value. Based on what I've read, I'm developing a suspicion that the raid is the problem, that grub just doesn't see the raid as a proper/bootable disk. Not sure how it worked in the first place, but I'll make sure my boot drive is just a regular old hard drive in the future. I think next I will try to see if I can convert my raid 1 drives into normal drives.

wagonlips 06-25-2011 01:07 AM

Reset Raid 1 to non-raid
 
And that seems to have worked. Using Intel Matrix Storage Manager, I simply converted one drive and then the other back to non-raid, rebooted, and pointed grub at the drive that was not hd0 (I think it was hd5 or something weird like that, probably I installed them goofily). But the next thing I know, my server is running again. Oh, and I should mention that I had everything backed up already. The Storage Manager issues a "you will lose all your data" warning when you convert to non-raid, but apparently that's not a sure thing with Raid 1, at least it wasn't in my case. Raid 0, you'd probably be screwed.

Anywayz... cheers! umm... all of you. Now I can get back to working on that 3TB drive.


All times are GMT -5. The time now is 01:39 PM.