add test for simple root on LVM
[dracut/plouj.git] / test / TEST-11-LVM / create-root.sh
blob1c1e92aa5f1913c0b26c326fba1cc29bfb9fc3eb
1 #!/bin/sh
2 # don't let udev and this script step on eachother's toes
3 for x in 63-luks.rules 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
4 > "/etc/udev/rules.d/$x"
5 done
6 udevadm control --reload-rules
7 # save a partition at the beginning for future flagging purposes
8 sfdisk -C 640 -H 2 -S 32 -L /dev/sda <<EOF
9 ,1
10 ,213
11 ,213
12 ,213
13 EOF
14 for i in sda2 sda3 sda4; do
15 lvm pvcreate -ff -y /dev/$i ;
16 done && \
17 lvm vgcreate dracut /dev/sda[234] && \
18 lvm lvcreate -l 100%FREE -n root dracut && \
19 lvm vgchange -ay && \
20 mke2fs /dev/dracut/root && \
21 mkdir -p /sysroot && \
22 mount /dev/dracut/root /sysroot && \
23 cp -a -t /sysroot /source/* && \
24 umount /sysroot && \
25 lvm lvchange -a n /dev/dracut/root && \
26 echo "dracut-root-block-created" >/dev/sda1
27 poweroff -f