This script automatically decrypts and mounts BitLocker-encrypted hard drive partitions on Linux. It is especially useful for dual-boot systems where Windows partitions are BitLocker-encrypted and need to be accessed from Linux.
-
Download and Extract: Download the script's ZIP file, extract it, and place the folder in a location of your choice.
-
Update Paths and User Information: In
bitlocker-startup.sh
, replaceSCRIPT_FOLDER_LOCATION
with the full path to the folder where you placed the script. Inbitlocker-unlock-mount.py
, replaceYOUR_USERNAME
with your actual Linux username.
- dislocker: Used to unlock BitLocker-encrypted partitions.
sudo apt install dislocker
- Python packages: Install the necessary Python packages using pip:
pip install cryptography
pip install getpass_asterisk
3. Fill drives.json
with your data:
For each drive, add a name, PARTUUID and the BitLocker password.
How to Find the PARTUUID:
- Identify your drives (/dev/sdX)
sudo fdisk -l
- Get the PARTUUID for each drive using:
sudo blkid | grep BitLocker
Once the drives.json
is ready, run encrypt.py
to encrypt it.
You will be prompted to enter a password, which will be required to decrypt the file later.
To ensure the script runs automatically at startup, add the following command to your startup applications:
/SCRIPT_FOLDER_LOCATION/bitlocker-startup.sh
After encrypting drives.json, delete the unencrypted version to protect your drive passwords.
If you may need to edit or update the drive information later (e.g., adding more drives or changing BitLocker passwords), store the unencrypted file on an encrypted partition. Only the encrypted drives.json.enc
should remain accessible for regular use.
After logging in, a terminal will automatically open, prompting you to:
- Enter your user login password for
sudo
permissions. - Enter the password that was used to encrypt
drives.json
.
Once both passwords are entered correctly, the script will decrypt the drives.json.enc
file and proceed to unlock and mount your BitLocker-encrypted drives.