Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to umount partition on Linux- cant find it...
#3
to be run as  'root' user, I wrote two simple mount/umount scripts below and stuck them in  /usr/local/bin .  The umount script also kills the BitLockerAnywhere prog.

This handles multiple BitLocker mount-points..



# ===================



mount_encrypted_drive.sh



#!/bin/sh

sync
/usr/local/bin/bitlocker-anywhere/bin/run.sh
sync







# ================



umount_encrypted_drive.sh


#!/bin/sh


bl_drives=$(ls -al /mnt/BitLockerAnywhere/ | grep " sd" | awk '{print $NF}' | tr '\n' ' ')
#echo "bl_drives = $bl_drives"

for bl_drive in $bl_drives ; do
echo "bl_drive = $bl_drive"
  if mount | grep "$bl_drive" >& /dev/null ; then
    echo "umounting: $bl_drive"
    umount /mnt/BitLockerAnywhere/$bl_drive
    sync
    sleep 1
    umount /mnt/BitLockerAnywhere/.${bl_drive}-raw
  fi
done

sync

if [ 1 ] ; then
  while true ; do
    x=$(ps axh | grep "/BitLockerAnywhere" | grep -v "grep " ) ; x=$(echo $x) ; x=${x%% *} ; [ -n "$x" ] && kill -9 $x
    [ -z "$x" ] && break
  done
fi

sync
Reply


Messages In This Thread
RE: How to umount partition on Linux- cant find it... - by rjflory - 06-26-2022, 12:44 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)