First attempt to autoconfigure LVM for snap

This commit is contained in:
Magnus Andersson 2024-01-12 15:23:53 +01:00
parent 4d4f87b192
commit 8bd4c6803f
Signed by: mandersson
GPG key ID: 19CB2C58E1F19B16

View file

@ -17,3 +17,10 @@ write_files:
runcmd: runcmd:
- [ systemctl, enable, chronyd ] - [ systemctl, enable, chronyd ]
- systemctl restart chronyd - systemctl restart chronyd
- mkdir -p /usr/lib/snap
- vgcreate snapvg /dev/sdb
- lvcreate -n lvol_snap -l 100%FREE snapvg
- mkfs -t xfs /dev/snapvg/lvol_snap -n ftype=1
- cp -a /etc/fstab /run/fstab.bak
- echo "UUID=$(blkid | grep lvol_snap | cut -d \" -f 2 ) /var/snap xfs defaults 0 0" >> /etc/fstab
- findmnt --verify || cp -a /run/fstab.bak /etc/fstab