Skip to content

Commit

Permalink
Use device UUID in mount (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
manoatsas authored Feb 24, 2022
1 parent 69fb4b0 commit 4bbde0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion files/cloud-init/nfs/cloud-config
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ runcmd:
- update-initramfs -u
# Update /etc/fstab
#
- echo "/dev/md0 /export ext4 defaults,nofail,x-systemd.requires=cloud-init.service,barrier=0,discard 0 2" >>/etc/fstab
- device=`lsblk -r | grep raid0 | cut -d " " -f1`
- mntDir='/export'
- deviceUUID=`sudo blkid /dev/$device | sed -r 's/.*UUID="([^"]*).*"/\1/g'`
- echo "UUID=$deviceUUID $mntDir auto defaults,acl,nofail 0 2" | sudo tee -a /etc/fstab > /dev/null
- mount -a
#
# Update /etc/exports
Expand Down

0 comments on commit 4bbde0d

Please sign in to comment.