From e9bc79f735da4c527b177cbab642b0a8e74f2a9b Mon Sep 17 00:00:00 2001 From: primardj Date: Tue, 23 Jan 2024 13:59:47 +0000 Subject: [PATCH] change mecanism of umount --- dmount | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dmount b/dmount index 42c0ab4..f9a34ed 100755 --- a/dmount +++ b/dmount @@ -15,6 +15,11 @@ PARAMETRES -r, --recover Permit to recover from a state where the ssd where hot unplug to an unplug state. " +Mountpoint_cours=/home/primardj/cours +Mountpoint_doc=/home/primardj/Documents +Mountpoint_virt_machine=/home/primardj/virtual_machine +Mountpoint_data=/home/primardj/data + force_remove_vgdevice() { echo "force remove vg cryptdata" doas dmsetup info --columns @@ -30,9 +35,20 @@ mount_lvm_on_luks() { doas mount -a } +umount_devices() { + echo "umount devices" + doas umount -R $Mountpoint_cours + doas umount -R $Mountpoint_doc + doas umount -R $Mountpoint_virt_machine + doas umount -R $Mountpoint_data +} + + umount_lvm_on_luks() { echo "locking device cryptdata" - doas umount -R /home/primardj || echo "Error, can't umount devices" >&2 && exit 0 + umount_devices || echo "Error; can't umount devices" >&2 && exit 0 + + #doas umount -R /home/primardj || echo "Error, can't umount devices" >&2 && exit 0 doas lvchange -a n cryptdata || force_remove_vgdevice doas cryptsetup close cryptdata }