making an os bootable

Hello,

I got a hard drive with an image of an older redhat OS that i need to do some work with. The hard drive isnt bootable but i need to get into it somehow. I am not even close to an expert on these kinds of things, but i will provide the information that ive got.

fdisk -ul

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   149838254    74919096   83  Linux
/dev/sda2       149838255   156296384     3229065    5  Extended
/dev/sda5       149838318   156296384     3229033+  82  Linux swap / Solaris

Disk /dev/sdb: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders, total 160086528 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xc726c726

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          32      100351       50160   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2          100359    16445834     8172738    5  Extended
Partition 2 does not end on cylinder boundary.
/dev/sdb5          100422     7483429     3691504   83  Linux
/dev/sdb6         7483518    14866525     3691504   83  Linux
/dev/sdb7        14866614    15392917      263152   83  Linux
/dev/sdb8        15393042    15919345      263152   83  Linux
/dev/sdb9        15919470    16445773      263152   82  Linux swap / Solaris

sda is the hard drive i have opensuse 11.2 on, this is still working great (as per usual)

sdb is the hard drive that i am struggling with. Here is what ive got in grubs menu.lst

# Modified by YaST2. Last modification on Mon Feb 15 21:00:35 MST 2010
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 1
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,0)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: xen###
title Xen -- openSUSE 11.2 - 2.6.31.12-0.2
    root (hd0,0)
    kernel /boot/xen.gz 
    module /boot/vmlinuz-2.6.31.12-0.2-xen root=/dev/disk/by-id/ata-ST380215A_9QZB6ZVQ-part1 resume=/dev/disk/by-id/ata-ST380215A_9QZB6ZVQ-part5 splash=silent quiet showopts vga=0x31a
    module /boot/initrd-2.6.31.12-0.2-xen

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 11.2 - 2.6.31.12-0.2
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-ST380215A_9QZB6ZVQ-part1 resume=/dev/disk/by-id/ata-ST380215A_9QZB6ZVQ-part5 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.31.12-0.2-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.2 - 2.6.31.12-0.2
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-ST380215A_9QZB6ZVQ-part1 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
    initrd /boot/initrd-2.6.31.12-0.2-desktop

###Don't change this comment - YaST2 identifier: Original name: linux###
title redhat
    root (hd1,0)
    kernel /boot/vmlinuz-2.4.2-2 root=/dev/sdb1 vga=0x31a

when i try to boot from this new entry, i get error 15 file not found. My understanding of this is because /boot/vmlinuz-2.4.2-2 isnt enough for it to boot, but this is what is shown in /boot/.

Im not sure if it even matters, but this OS (i am pretty sure) was setup with lilo.

The simplest way the occurs to me to do this is to virtualize the OS on it. So i installed hypervisor from yast, but (i think) it requires an image of the OS to virtualize it, not some partitions on a hard drive. Is there an easy way around this? Any advice is really appreciated.

Are you aware that you can use GRUB in interactive mode, which also has tab completion, to probe for bootable kernels? That would save you some effort in looking in the partition to see what’s there, and then cycles of edit and boot attempts.

Assuming you have the GRUB prompt, just type in what the lines of the stanza for booting RH:

grub> root (hd1,0)
grub> kernel /boot/<TAB>

That will show you a list of files in the directory. You can then choose one and then add parameters after it. You may also need an initrd line:

grub> initrd /boot/<TAB>

Finally, kick it off with:

grub> boot

If you make a mistake with the kernel line or initrd line, just try again that same line.

BTW, looking at your partition table, I suspect that sdb1 is /boot, and one of the other logical partitions is /. So the kernel path would actually be /vmlinuz… and you would use root=/dev/sdb5 or perhaps one of the others to get /.

Perhaps rather than pointing to a specific kernel, which may not be correct you could edit to

###Don't change this comment - YaST2 identifier: Original name: linux###
title redhat
    root (hd1,0)
    configfile /boot/grub/menu.lst

But as Ken said you can get interactive and edit on the fly

Thank you both for the tip, and in fact i got it to boot … well almost.

Ive spent a bunch of time googling this error, but i cant seem to find a resolution. It tries to boot and spits this out:


Kernel panic: VFS: unable to mount root fs on 08:08

Ive got no clue… any advice?

You probably need the initrd loaded also to have the module for the filesystem that the root partition uses.