0

I have an external HDD with two partitions on it. There's the primary partition and an additional partition I created called "Data" which is bitlocker encrypted (I created the Data partition on a Windows PC).

I've found two different ways of unlocking and mounting the Data partition on Ubuntu. I stumbled upon the first one myself accidentally, and the second one involving dislocker seems to be the standard approach you find by googling how to do this. I have several questions embedded here, so I bolded them.

Approach 1

I stumbled on the first approach by mistake, and I don't really understand it. It is to mount with the following commands:

sudo mkdir /media/WD_BLACK_DATA
sudo mount -t ntfs /dev/dm-3 /media/Data 

The part I don't understand is the /dev/dm-3. Calling lsblk /dev/sdb gives the following output for this drive:

NAME                             MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sdb                                8:16   0   4.5T  0 disk  
├─sdb1                             8:17   0   4.2T  0 part  /media/WD_BLACK_5TB
└─sdb2                             8:18   0 377.2G  0 part  
  └─bitlk-77269abe-2988-4b8a-9ca9-a8508a975db7
                                 252:3    0 377.2G  0 crypt /media/WD_BLACK_DATA

And calling lsblk without any arguments does not output /dev/dm-3 at all.

The Data partition is indicated by /dev/sdb2. Trying to mount the partition with sudo mount -t ntfs /dev/sdb2 /media/WD_BLACK_DATA gives an error. I can't find /dev/dm-3 anywhere, yet it works. I think the way I figured it out was Nautilus gave me an error at one point when I tried mounting it the wrong way, and the error message had a mention of /dev/dm-3, so I tried it out successfully. So one of my questions is: what is /dev/dm-3, and what query would I use to show me that /dev/dm-3 is the name of this partition? Why does mounting with /dev/sdb2 not work but using /dev/dm-3 does work? I can mount the non-encrypted drive just fine using sudo mount -t ntfs /dev/sdb1 /media/WD_BLACK_5TB

Approach 2: dislocker

Googling how to mount a bitlocker encrypted drive gives the this approach (e.g. this guide). Basically, I have to install the dislocker package, and do the following steps:

# Create a mount point for the dislocker file
sudo mkdir /media/bitlocker

Create a mount point for dislocker to mount the virtual filesystem

sudo mkdir /media/Data

is this just to decrypt the drive?

sudo dislocker -r -V /dev/sdb1 -u[PASSWORD] -- /media/bitlocker

mount the partition

sudo mount -r -o loop /media/bitlocker/dislocker-file /media/Data

In this approach, why are we having to create two mount points? What is the dislocker file? In mounting the partition, what is loop? When I run lsblk, there are many entries with loop in the name; example:

NAME                        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0                         7:0    0     4K  1 loop  /snap/bare/5
loop1                         7:1    0 313.1M  1 loop  /snap/code/172
loop2                         7:2    0 316.5M  1 loop  /snap/code/173
loop3                         7:3    0   572K  1 loop  /snap/color-picker/26

All these loop entries are related to snap, but dislocker isn't related to snap, so what's actually happening here?


I can configure /etc/fstab using either of these approaches. For approach 1, it's /dev/dm-3 /media/WD_BLACK_DATA ntfs password=<password> 0 0

Approach 1 is way more convenient and straightforward (aside from figuring out that the name to use was /dev/dm-3), so why is that not the standard approach? And what advantages if any does using dislocker provide?

0 Answers0