Mounting a BitLocker drive on Linux

Last updated on February 6, 2021

I now use Ubuntu for my daily basis usage. However, I still need Windows for developing the various desktop application running on Windows so I made a dual-boot OS on my current machine. The trouble I faced when I used the Ubuntu for the first time was I can’t access my drives encrypted by BitLocker. After searching the internet, I’ve successfully accessed my encrypted drives by doing the following steps:

1. Installing Dislocker

Dislocker has been designed to read BitLocker encrypted partitions under a Linux system. The installation procedure is straightforward and can be reached in the file. Based on the information I’ve got from the file, the following is the step-by-step actions to install Dislocker on the Ubuntu 16.04:

1.1. Installing its dependencies

As stated in the installation file, it depends on the several packages to install the Dislocker. For that purpose, I install the dependencies using the following command:

sudo apt-get install gcc cmake make libfuse-dev libmbedtls-dev ruby-dev

1.2. Cloning the source code

Go to the Github page of Dislocker and press the Clone or download button to get the source code link, it should be by the way. Then, run the following command to clone the source code to our local machine:

git clone /tmp/dislocker

Note: Since we just need the source code to install the Dislocker package, I clone the source to /tmp/dislocker directory. You can choose another location if you want to use the source code for others purpose.

1.3. Compiling the source code and installing the package

Now, we have the source code on the tmp directory. To compile the source code and install the package, run the following four commands:

cd /tmp/dislocker
cmake .
sudo make install

If everything runs well, we are going to have the dislocker packages on our machine. To ensure the installation works, run the following command and we will see the help page of Dislocker:

dislocker --help

2. Preparing the mounted directories

Before we decrypt the bitlocker-encrypted partition, let’s prepare the directory to store the decrypted volume and the mounted partition. We are going to create two new directories on /media/bitlocker (to store the decrypted volume) and on /media/mount (to store the mounted partition) using the following command:

sudo mkdir /media/bitlocker /media/mount

3. Decrypting the partition

To decrypt the bitlocker-encrypted partition, we need to find out the location of encrypted partition by using fdisk command as follow:

sudo fdisk -l

Now, run the following command and replace /dev/sdaX with the device name we’ve got from the fdisk command. Also, replace PASSWORD with the bitlocker password.

sudo dislocker -r -V /dev/sdaX -uPASSWORD -- /media/bitlocker

4. Mounting the decrypted partition

We should have the decrypted partition on the /media/bitlocker directory. Now, we can mount the decrypted volume using these three commands:

sudo -i
cd /media/bitlocker
mount -r -o loop dislocker-file /media/mount

And, we have full access to the encrypted partition and can go to /media/mount directory to manipulate all files and directories there. For now on, each time we are going to decrypt the Bitlocker partition, we just need to run the step 3 and 4.


Leave a Reply

Your email address will not be published. Required fields are marked *