newspaint

Documenting Problems That Were Difficult To Find The Answer To

Monthly Archives: April 2019

Listing Drives Opened with CryptSetup

So I’ve opened a drive using cryptsetup, e.g.:

$ sudo cryptsetup luksOpen /dev/sdf mycrypt
Enter passphrase for /dev/sdf: hunter2
$

Now I want to know what encrypted drives I have mounted so I can unmount them. Do to this run the following command:

$ sudo dmsetup ls
mycrypt (252:0)

I can then use this information to close my mount:

$ sudo cryptsetup luksClose mycrypt

Unknown USB Bridge for WD Elements Disk in Smartmon

I was getting the following message when attempting to use the smartctl command (as part of smartmontools) to get information about the Western Digital Elements external USB disk drive I had plugged into my Ubuntu Linux system:

$ sudo /opt/smartmontools/sbin/smartctl -i /dev/sdf
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.4.0-142-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sdf: Unknown USB bridge [0x1058:0x25a3 (0x1021)]
Please specify device type with the -d option.

One way around this “Unknown USB bridge” message was to re-run the command with the “-d sat” option:

$ sudo /opt/smartmontools/sbin/smartctl -i /dev/sdf -d sat
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.4.0-142-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Firmware Version: 83.H0A83
User Capacity:    8,001,563,222,016 bytes [8.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      3.5 inches
...

Another was to run the command update-smart-drivedb:

$ sudo /opt/smartmontools/sbin/update-smart-drivedb
/opt/smartmontools/share/smartmontools/drivedb.h updated from branches/RELEASE_6_5_DRIVEDB

Now I did not need the “-d sat” option.