-
Notifications
You must be signed in to change notification settings - Fork 34
Mounting a BitLocker encrypted USB drive on Ubuntu Linux
Ramón Casero edited this page Jul 6, 2020
·
2 revisions
We assume that you have a USB drive with an NTFS partition (the typical files system in Windows nowadays) and some data.
Using Windows, you have activated BitLocker encryption on it with the password option, so that when you plug it into Windows, it asks for the password, and after providing it, you see it mounted as an external drive.
There are pros and cons of using BitLocker on an external USB drive.
Pros:
- BitLocker is integrated with Windows, so if you need to plug your external drive into a new Windows computer, e.g. at a conference, you don't need to install new software (unless the computer is very old).
- You can activate/deactivate BitLocker encryption on the drive without having to delete and copy your data again.
- It works both in Linux and Windows.
- It doesn't seem to slow down reading/writing data from/to the external drive.
Cons:
- It's proprietary software, so it could have backdoors or other issues.
- You need to install software and configure it in every Linux machine you want to use.
- I haven't found a way yet to integrate the mount/umount with the GNOME3 desktop, so you need to mount/umount with the command line.
- Install
dislocker
. This is the FUSE driver to read/write BitLocker encrypted partitions.sudo apt install dislocker
- Create directories to mount your external drive (we'll use
bitlocker
to mount the encrypted device, andbitlockermount
to access the drive as a virtual NTFS partition), and give them user accesscd /media/$USER sudo mkdir -p bitlocker bitlockermount sudo chown $USER:$USER bitlocker bitlockermount
- Plug in the external drive, and use
blkid
to find itsPARTUUID
number. This is better than using its assigned device (e.g./dev/sda1
), becausePARTUUID
will always be the same, but the assigned devide will change depending on what's plugged into the computer already. You will get something like this:blkid ... /dev/sda1: TYPE="BitLocker" PARTUUID="00c92103-01"
- Find out your
uid
andgid
values. For example, assuming that you are user $USERNAMEid uid=1000($USERNAME) gid=1000($USERNAME) ...
- Edit
/etc/fstab
and add the lines (replacing your ownPARTUUID
value, $USERNAME,uid
andgid
)PARTUUID="00c92103-01" /media/$USERNAME/bitlocker fuse.dislocker user-password,nofail 0 0 /media/$USERNAME/bitlocker/dislocker-file /media/$USERNAME/bitlockermount auto loop,nofail,uid=1000,gid=1000 0 0
- Edit
~/.bashrc
to add the following alias lines (here$USER
is literal)alias mount-mydrive='sudo mount /media/$USER/bitlocker && sudo mount /media/$USER/bitlockermount' alias umount-mydrive='sudo umount /media/$USER/bitlockermount && sleep 1s && sudo umount /media/$USER/bitlocker'
- Load the new aliases on your terminal
source ~/.bashrc
- Now you can mount the encrypted external drive with (first password is your
sudo
password, and it won't be requested if you have usedsudo
recently; second password is your BitLocker encryption password)mount-mydrive [sudo] password for $USERNAME: Enter the user password: FUSE exfat 1.3.0
- After mounting, you can access your drive under
/media/$USER/bitlockermount
. - You can umount your drive with
umount-mydrive