From 6c8c284740c028c070f70b4c1a983a452c2796e1 Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Fri, 15 Mar 2024 16:09:58 -0400 Subject: [PATCH] umount with --types for cephfs and nfs4 volumes, umount only xfs from /mnt --- site/profile/files/base/prepare4image.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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