USB drive with lvm on an encrypted partition does not unmount cleanly when removed, making it impossible to use again without a reboot or use of command line tools
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lvm2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have a USB drive with two partitions, one unencrypted and one encrypted. The encrypted partition serves as the physical volume for a LVM volume group.
cfdisk shows me:
Size: 74.5 GiB, 80026361856 bytes, 156301488 sectors
Device Boot Start End Sectors Size Id Type
>> /dev/sdb1 * 2048 500094 498047 243.2M 83 Linux
/dev/sdb2 501758 156301311 155799554 74.3G 5 Extended
└─/dev/sdb5 501760 156301311 155799552 74.3G 83 Linux
When I plug in the drive, one partition is mounted automatically. A popup window also appears, prompting for a password to unlock the volume. After I enter the password, four more volumes appear on my Desktop, and in /media/username:
$ ls -l /media/username
total 25
drwxr-xr-x 22 root root 4096 Jan 6 2014 0c321a15-
drwxrwxrwt 9 root root 12288 Dec 21 00:26 14ea30b5-
drwxr-xr-x 15 root root 4096 Dec 21 00:27 41f9c7bb-
drwxr-xr-x 7 root root 4096 Nov 12 2013 42d838d8-
drwxr-xr-x 4 root root 1024 Mar 18 2014 ba0575b2-
The output of findmnt is as follows, with my username again replaced with 'username':
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/
│ ext4 rw,relatime,
├─/sys sysfs sysfs rw,nosuid,
[snip]
├─/boot /dev/sda1 ext2 rw,relatime,
├─/home /dev/mapper/
│ ext4 rw,relatime,
├─/media/
│ /dev/sdc1 ext2 rw,nosuid,
├─/media/
│ /dev/mapper/
│ ext4 rw,nosuid,
├─/media/
│ /dev/mapper/
│ ext4 rw,nosuid,
├─/media/
│ /dev/mapper/
│ ext4 rw,nosuid,
└─/media/
To unmount the drive, I can right click on each volume on the desktop, choose unmount, and I receive a pop up notification that the drive has been safely removed.
After unplugging the USB drive, the icon for the unencrypted volume disappears from the desktop, but the icons for the lvm volumes remain. I have attached the long errors that appear in the syslog.
When plugging the drive back in, the unencrypted partition is again mounted, and I am prompted for a password. Nothing further happens. If I double click on the encryted drive icon on the desktop, I am again prompted for a password, and then receive this error:
Failed to mount "80 GB Encrypted"
Error unclocking /dev/sdb5: Command-line `cryptsetup luksOpen "/dev/sdb5" "luks-1d2a9dd8-
The usb drive is unusable without a reboot, or issuing this command, antler is the volume group name:
$ sudo vgchange -a n antler
0 logical volume(s) in volume group "antler" now active
Upon issuing this command, the icons for the four lvm volumes disappears from my desktop. If I now plug in the drive, it acts normally.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: lvm2 2.02.133-1ubuntu10
ProcVersionSign
Uname: Linux 4.4.0-57-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.4
Architecture: amd64
CurrentDesktop: XFCE
Date: Wed Jan 4 19:40:18 2017
InstallationDate: Installed on 2016-11-28 (37 days ago)
InstallationMedia: Xubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
SourcePackage: lvm2
UpgradeStatus: No upgrade log present (probably fresh install)