Skip to content

Instantly share code, notes, and snippets.

@punit-naik
Created October 7, 2021 18:59
Show Gist options
  • Select an option

  • Save punit-naik/7aeea2be6caa186b13cf77512382e377 to your computer and use it in GitHub Desktop.

Select an option

Save punit-naik/7aeea2be6caa186b13cf77512382e377 to your computer and use it in GitHub Desktop.
Mount/unmount a bitlocker encrypted partition in read-write mode
#!/bin/bash
sudo mkdir -p /media/bitlocker
sudo mkdir -p /media/bitlockermount
UNMOUNT=false
case "$1" in
-u | --unmount )
UNMOUNT=true
shift
;;
esac
if [ $UNMOUNT = true ]
then
sudo umount /media/bitlockermount
sudo umount /media/bitlocker
else
sudo dislocker -V <parition> --recovery-password=<recovery-key> -- /media/bitlocker
sudo mount -rw -o loop /media/bitlocker/dislocker-file /media/bitlockermount
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment