[CLUE-Tech] RAID 1 on Linux

Chris Dos chris at chrisdos.com
Wed Oct 20 20:26:08 MDT 2004


Carl Schelin wrote:
> The problem with raidtools and raidtab was that it
> didn't support persistant superblocks so I couldn't
> boot directly from /md0, I had to have a non-raided
> /boot. That was why I checked out and was using mdadm.
> 

raidtap supports persistant superblocks.  Here is a snippet from my raidtab:

# raid-1 /dev/md0 configuration
raiddev                 /dev/md0
         raid-level              1
         nr-raid-disks           2
         nr-spare-disks          0
         persistent-superblock   1
         chunk-size              8
         device                  /dev/hda1
         raid-disk               0
         #failed-disk            0
         device                  /dev/hdc1
         raid-disk               1

Notice the "persistent-superblock   1" line.  Also, for some reason, the 
mkraid needed "chunk-size" in the file even though it doesn't need it 
and it reports that it doesn't need it.  But it wouldn't run without it 
(and that was when I set it up a couple of years ago, today may be 
different).  After you create your partition for the raid1, use fdisk 
and change the type from Linux to "Linux raid autodetect" which is the 
"fd" code.  Then run the makeraid and it will write a persistent 
superblock, change lilo to boot the new /dev/md0 (or whatever device) 
and your off and running.  Oh, if you installed lilo or grub in the mbr, 
you will need to create a clean mbr without lilo or grub in it.  Lilo 
must be installed in a partitions boot record and not the mbr.

After that, the "find > . -xdev | cpio -pm /mnt/newroot" works great to 
move everything over to the new partition.  And of course, do that in 
single user mode.

	Chris



More information about the clue-tech mailing list