From 4bbde0d46f0b1534fbab321e944bc455fe511185 Mon Sep 17 00:00:00 2001 From: manoatsas <32555022+manoatsas@users.noreply.github.com> Date: Thu, 24 Feb 2022 11:07:27 -0500 Subject: [PATCH] Use device UUID in mount (#111) --- files/cloud-init/nfs/cloud-config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/cloud-init/nfs/cloud-config b/files/cloud-init/nfs/cloud-config index 154e7191..a57dcc75 100644 --- a/files/cloud-init/nfs/cloud-config +++ b/files/cloud-init/nfs/cloud-config @@ -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