change mecanism of umount

This commit is contained in:
primardj 2024-01-23 13:59:47 +00:00
parent 42671a7e52
commit e9bc79f735

18
dmount
View file

@ -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
}