Need udevadm to create device links

This commit is contained in:
Nico Schottelius 2018-02-18 21:03:00 +01:00
parent 32636437b7
commit c8425833af

View file

@ -42,23 +42,20 @@ dev_block="/dev/disk/by-partuuid/$uuid_block"
--partition-guid="0:$uuid_metadata" \
--typecode=0:4fbd7e29-9d25-41b8-afd0-062c0ceff05d \
--mbrtogpt -- $DEV
sleep 2 ; hdparm -z "$DEV"
/sbin/udevadm settle --timeout=600
# Using gdisk --largest-new does not change the name or set guid;
# So use 2 steps instead
/sbin/sgdisk --largest-new=0 --mbrtogpt -- $DEV
/sbin/udevadm settle --timeout=600
sleep 2 ; hdparm -z "$DEV"
lastpart=$(gdisk -l $DEV | tail -n1 | awk '{ print $1 }')
/sbin/sgdisk --change-name="${lastpart}:ceph block" \
--partition-guid="${lastpart}:$uuid_block" \
--typecode="${lastpart}:cafecafe-9b03-4f30-b4c6-b4b80ceff106" \
--mbrtogpt -- $DEV
sleep 2 ; hdparm -z "$DEV"
/sbin/udevadm settle --timeout=600
/sbin/mkfs -t xfs -f -i size=2048 -- "$dev_metadata"