Skip to content

Instantly share code, notes, and snippets.

@mdenzel
Last active May 11, 2024 20:39
Show Gist options
  • Save mdenzel/17347cd0ddfbf4b1d7c3bca58f915358 to your computer and use it in GitHub Desktop.
Save mdenzel/17347cd0ddfbf4b1d7c3bca58f915358 to your computer and use it in GitHub Desktop.
Linux: mount bitlocker drive
#!/bin/bash
### CONFIG ###
DISLOCKER=/media/tmp
MOUNTPOINT=/media/usb
##############
#error check
if [ $# -ne 1 ]; then
echo "usage: $0 <disk> [-u]"
exit -1
fi
if [ "$1" == "-u" ]; then
#unmount
umount -q $MOUNTPOINT
umount -q $DISLOCKER
else
#mount
dislocker-fuse -V $1 -u $DISLOCKER
if [ $? -eq 0 ]; then
mount $DISLOCKER/dislocker-file $MOUNTPOINT -o loop
if [ $? -eq 0 ]; then
echo "mounted: $MOUNTPOINT"
fi
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment