RAID 1 without specifying devices

Jason Kohles email at jasonkohles.com
Thu Sep 14 18:01:49 UTC 2006


On 9/14/06, Johnny Ljunggren <johnny at navtek.no> wrote:
>
> Hello all
>
> I'm usually installing my systems with Software RAID 1 and have up to
> now specified the hard drives to be used by their device names (/dev/hda
> etc...), ie
> part raid.01 --bytes-per-inode=4096 --fstype="raid" --ondisk=hda
> --size=10000
>
> Is there a way to create the RAID without specifying --ondisk?
> There will always be two disks on these systems, but not necessarily in
> the same position each time.
>

It's not pretty, but you can do this...

%include /tmp/kspart

%pre --interpreter /usr/bin/python
import os
import sys
import parted
sys.path.append('/usr/lib/anaconda')
import isys

drives = isys.hardDriveDict().keys()
drives.sort()

f = open("/tmp/kspart","w")

f.write( "part raid.01 --ondisk=%s\n" % drives[0] );
f.write( "part raid.02 --ondisk=%s\n" % drives[1] );

f.close()

-- 
Jason Kohles
email at jasonkohles.com - http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire




More information about the Kickstart-list mailing list