mirror of
https://github.com/Le0xFF/VoidLinuxInstaller.git
synced 2024-11-25 18:54:13 +03:00
Maybe a better way to unmount block devices
This commit is contained in:
parent
eef6276eb3
commit
eb1f96e45e
17
vli.sh
17
vli.sh
@ -47,14 +47,16 @@ function kill_script {
|
||||
|
||||
echo -e -n "\n\n${RED_LIGHT}Kill signal captured.\nUnmonting what should have been mounted, cleaning and closing everything...${NORMAL}\n\n"
|
||||
|
||||
umount --recursive /mnt
|
||||
if findmnt /mnt &> /dev/null ; then
|
||||
umount --recursive /mnt
|
||||
fi
|
||||
|
||||
if [[ "$lvm_yn" == "y" ]] || [[ "$lvm_yn" == "Y" ]] ; then
|
||||
if findmnt /dev/mapper/"$vg_name"-"$lv_root_name" &> /dev/null; then
|
||||
lvchange -an /dev/mapper/"$vg_name"-"$lv_root_name"
|
||||
vgchange -an /dev/mapper/"$vg_name"
|
||||
fi
|
||||
|
||||
if [[ "$encryption_yn" == "y" ]] || [[ "$encryption_yn" == "Y" ]] ; then
|
||||
if findmnt /dev/mapper/"$encrypted_name" &> /dev/null ; then
|
||||
cryptsetup close /dev/mapper/"$encrypted_name"
|
||||
fi
|
||||
|
||||
@ -2798,13 +2800,16 @@ function install_base_system_and_chroot {
|
||||
rm -f /mnt/root/btrfs_map_physical
|
||||
|
||||
echo -e -n "\nUnmounting partitions...\n\n"
|
||||
umount --recursive /mnt
|
||||
if [[ "$lvm_yn" == "y" ]] || [[ "$lvm_yn" == "Y" ]] ; then
|
||||
if findmnt /mnt &> /dev/null ; then
|
||||
umount --recursive /mnt
|
||||
fi
|
||||
|
||||
if findmnt /dev/mapper/"$vg_name"-"$lv_root_name" &> /dev/null; then
|
||||
lvchange -an /dev/mapper/"$vg_name"-"$lv_root_name"
|
||||
vgchange -an /dev/mapper/"$vg_name"
|
||||
fi
|
||||
|
||||
if [[ "$encryption_yn" == "y" ]] || [[ "$encryption_yn" == "Y" ]] ; then
|
||||
if findmnt /dev/mapper/"$encrypted_name" &> /dev/null ; then
|
||||
cryptsetup close /dev/mapper/"$encrypted_name"
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user