[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Boot from software RAID. Sarge. Kernel 2.6.5. SATA.



Hello,

I am trying to setup server with RAID 1. I got RAID working but I am having problems booting from it.

Unfortunately box I am working on is quite dumb, only two drives can be connected to it and it can boot only from first drive.

I installed minimal system on first drive, I can create RAID1 on non-root partitions, and it gets detected after reboot, can be mounted, etc.

Now I want to set raid on root partition.

I created partition on second drive of exact same size as root partition on first drive. Created a degraded RAID1 array out of it (with first drive missing). Copied contents of root partition on new array (/dev/md0). Changed fstab on new partition to mount /dev/md0 as root.

First question: I copied root partition by logging into Knoppix and issuing 'dd if=/dev/hdc1 of=/dev/hdd1' command -- effectively bypassing RAID since Knoppix does not appear to have raid support. Is it ok? Or should I rather create an image from Knoppix and then dd it to /dev/md0 from Debian?

Now I am trying to figure out how to boot from raid. Since I can't really boot from second drive, I decided to try booting from first drive using raid array as root partition.

I added entry to my lilo config, named "LinuxRaid". It exactly the same as my regular "Linux" entry, with addition of "root=/dev/md0" parameter.

System starts booting fine, but at the end I get kernel panic.

Relevant log lines (note: i am retyping log by hand):

md: raid1 personality registered as nr 3
md: multipath personality registered as nr 7
md: md driver 0.90.0 MAX_MD_DEVFS=256, MD_SB_DISKS=27
device-mapper: 4.1.0-ioctl (2003-12-10) initialised: dm@uk.sistina.com
[snip]
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
EXT3-fs: unable to read superblock
EXT2-fs: unable to read superblock
isofs_fill_super: bread failed, dev=md0, iso_blknum=16, block=32
UDF-fs: No partition found (1)
Kernel panic: VFS: Unable to mount root fs on md0

When I boot from my regular root partition dmesg reports following:

md: raid1 personality registered as nr 3
md: multipath personality registered as nr 7
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
device-mapper: 4.1.0-ioctl (2003-12-10) initialised: dm@uk.sistina.com
[snip]
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
[snip]
EXT3 FS on sda1, internal journal
md: md0 stopped.
md: bind<sdb1>
raid1: raid set md0 active with 1 out of 2 mirrors


So looks to me like RAID array gets activated after root partition is mounted. Any ideas how to handle this problem?


--Kirill



Reply to: