Created
October 7, 2021 18:59
-
-
Save punit-naik/7aeea2be6caa186b13cf77512382e377 to your computer and use it in GitHub Desktop.
Mount/unmount a bitlocker encrypted partition in read-write mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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