diff --git a/site/profile/files/base/prepare4image.sh b/site/profile/files/base/prepare4image.sh index 45c18339b..433723256 100644 --- a/site/profile/files/base/prepare4image.sh +++ b/site/profile/files/base/prepare4image.sh @@ -21,8 +21,10 @@ rm /opt/consul/node-id /opt/consul/checkpoint-signature /opt/consul/serf/local.s swapoff -a grep -q "swap" /etc/fstab && rm -f $(grep "swap" /etc/fstab | cut -f 1) # Unmount filesystems -grep -v -P '(ext4|xfs|vfat|swap|^#|^$)' /etc/fstab | cut -f 2 | xargs umount -grep -P '(ext4|xfs|vfat|^#|^$)' /etc/fstab > /etc/fstab.new +umount -a --types cephfs,nfs4 +# for xfs, we unmount only what's in /mnt, not things like / or /boot +grep xfs /etc/fstab | cut -f 2 | grep /mnt | xargs umount +grep -P '(ext4|xfs|vfat|^#|^$)' /etc/fstab | grep -v /mnt > /etc/fstab.new mv -f /etc/fstab.new /etc/fstab systemctl daemon-reload @@ -56,4 +58,4 @@ TYPE=Ethernet ONBOOT=yes BOOTPROTO=dhcp EOF -halt -p \ No newline at end of file +halt -p