Merge pull request #68 from dracut-mailing-devs/1431698021-16626-3-git-send-email...
[dracut.git] / test / TEST-17-LVM-THIN / create-root.sh
blob117d134157a33dd5b7d59c994ac9826c1815ec00
1 #!/bin/sh
2 # don't let udev and this script step on eachother's toes
3 for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
4 > "/etc/udev/rules.d/$x"
5 done
6 rm -f -- /etc/lvm/lvm.conf
7 udevadm control --reload
8 # save a partition at the beginning for future flagging purposes
9 sfdisk /dev/sda <<EOF
10 ,4M
11 ,25M
12 ,25M
13 ,25M
14 EOF
15 udevadm settle
16 for i in sda2 sda3 sda4; do
17 lvm pvcreate -ff -y /dev/$i ;
18 done && \
19 lvm vgcreate dracut /dev/sda[234] && \
20 lvm lvcreate -l 16 -T dracut/mythinpool && \
21 lvm lvcreate -V1G -T dracut/mythinpool -n root && \
22 lvm vgchange -ay && \
23 mke2fs /dev/dracut/root && \
24 mkdir -p /sysroot && \
25 mount /dev/dracut/root /sysroot && \
26 cp -a -t /sysroot /source/* && \
27 umount /sysroot && \
28 sleep 1 && \
29 lvm lvchange -a n /dev/dracut/root && \
30 sleep 1 && \
31 echo "dracut-root-block-created" >/dev/sda1
32 poweroff -f