Merge pull request #68 from dracut-mailing-devs/1431698021-16626-3-git-send-email...
[dracut.git] / test / TEST-15-BTRFSRAID / create-root.sh
blobf4062f5b4b2e4f71c5a83aaa9bafed6f2025221b
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 udevadm control --reload
7 # save a partition at the beginning for future flagging purposes
8 sfdisk -X gpt /dev/sda <<EOF
9 ,10M
10 ,200M
11 ,200M
12 ,200M
13 ,200M
14 EOF
15 udevadm settle
16 mkfs.btrfs -draid10 -mraid10 -L root /dev/sda2 /dev/sda3 /dev/sda4 /dev/sda5
17 udevadm settle
18 btrfs device scan
19 udevadm settle
20 set -e
21 mkdir -p /sysroot
22 mount -t btrfs /dev/sda5 /sysroot
23 cp -a -t /sysroot /source/*
24 umount /sysroot
25 echo "dracut-root-block-created" >/dev/sda1
26 poweroff -f