2 # don't let udev and this script step on eachother's toes
3 for x
in 61-dmraid-imsm.rules
64-md-raid.rules
65-md-incremental-imsm.rules
65-md-incremental.rules
64-lvm.rules
70-mdadm.rules
99-mount-rules; do
4 rm -f -- "/etc/udev/rules.d/$x"
6 rm -f -- /etc
/lvm
/lvm.conf
8 udevadm control
--reload
9 # dmraid does not want symlinks in --disk "..."
10 if [ -e /dev
/hda
] ; then
11 echo y|dmraid
-f isw
-C Test0
--type 1 --disk "/dev/hdb /dev/hdc"
13 echo y|dmraid
-f isw
-C Test0
--type 1 --disk "/dev/sdb /dev/sdc"
18 # scan and activate all DM RAIDS
20 dmraid
-ay -i -p --rm_partitions "$s"
21 [ -e "/dev/mapper/$s" ] && kpartx
-a -p p
"/dev/mapper/$s"
28 sfdisk
-g /dev
/mapper
/isw
*Test0
29 # save a partition at the beginning for future flagging purposes
30 sfdisk
--no-reread /dev
/mapper
/isw
*Test0
<<EOF
41 SETS
=$
(dmraid
-c -s -i)
42 # scan and activate all DM RAIDS
44 dmraid
-ay -i -p --rm_partitions "$s"
45 [ -e "/dev/mapper/$s" ] && kpartx
-a -p p
"/dev/mapper/$s"
50 mdadm
--create /dev
/md0
--run --auto=yes --level=5 --raid-devices=3 \
55 # wait for the array to finish initailizing, otherwise this sometimes fails
58 lvm pvcreate
-ff -y /dev
/md0
59 lvm vgcreate dracut
/dev
/md0
&& \
60 lvm lvcreate
-l 100%FREE
-n root dracut
&& \
62 mke2fs
-L root
/dev
/dracut
/root
&& \
63 mkdir
-p /sysroot
&& \
64 mount
/dev
/dracut
/root
/sysroot
&& \
65 cp -a -t /sysroot
/source
/* && \
67 lvm lvchange
-a n
/dev
/dracut
/root
&& \
69 mdadm
--detail --export /dev
/md0 |
grep -F MD_UUID
> /tmp
/mduuid
71 echo "MD_UUID=$MD_UUID"
72 { echo "dracut-root-block-created"; echo MD_UUID
=$MD_UUID;} > /dev
/sda
73 mdadm
--wait-clean /dev
/md0