Skip to content

Instantly share code, notes, and snippets.

@Ortham
Last active July 4, 2017 20:09
Show Gist options
  • Save Ortham/0ed48166c00284f9668587e680fad301 to your computer and use it in GitHub Desktop.
Save Ortham/0ed48166c00284f9668587e680fad301 to your computer and use it in GitHub Desktop.
A script to simplify mounting a Bitlocker-encrypted Windows partition using Dislocker
#!/bin/bash
# Run with 'sudo'
set -e
BITLOCKER_PARTITION=/dev/sda3
BITLOCKER_MOUNT=/mnt/bitlocker
DECRYPTED_MOUNT=/mnt/windows
echo "Please enter your Bitlocker password: "
read -s BITLOCKER_PASSWORD
dislocker -V $BITLOCKER_PARTITION -u$BITLOCKER_PASSWORD -- $BITLOCKER_MOUNT
mount -o loop,uid=1000,gid=1000,dmask=027,fmask=137 $BITLOCKER_MOUNT/dislocker-file $DECRYPTED_MOUNT
#!/bin/bash
# Run with 'sudo'
set -e
BITLOCKER_MOUNT=/mnt/bitlocker
DECRYPTED_MOUNT=/mnt/windows
umount $BITLOCKER_MOUNT
umount $DECRYPTED_MOUNT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment