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 }