Opening LUKS encrypted drive in nautilus results in "operation cancelled"

9,677

Scrolling through one of the related questions I found an answer that worked.

sudo cryptsetup luksOpen /dev/sdb3 my_encrypted_volume
sudo vgimportclone /dev/mapper/my_encrypted_volume

This latter output a bunch of scary WARNING until

Volume group "ubuntu-vg" successfully renamed to "ubuntu-vg1"
Notifying lvmetad about changes since it was disabled temporarily.
(This resolves any WARNING message about restarting lvmetad that appears above.)
  Reading all physical volumes.  This may take a while...
  Found volume group "ubuntu-vg" using metadata type lvm2
  Found volume group "ubuntu-vg1" using metadata type lvm2

I then ran sudo vgchange -ay (possibly unnecessarily) and then ran

sudo mount /dev/ubuntu-vg1/root /media/my_device/

And voila! The drive appeared in Nautilus

Share:
9,677

Related videos on Youtube

raphael
Author by

raphael

Updated on September 18, 2022

Comments

  • raphael
    raphael almost 2 years

    I'm on a Ubuntu 16.04 computer with a LUKS encrypted drive trying to mount an old Ubuntu 16.04 LUKS encrypted drive. When I open the drive in Nautilus, after entering the correct password I get the following pop-up error

    Unable to access “127 GB Encrypted” Operation cancelled

    Relevant? output of sudo fdisk -l after doing sudo cryptsetup luksOpen /dev/sdb3 my_encrypted_volume:

    Disk /dev/sdb: 119.2 GiB, 128035676160 bytes, 250069680 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 33553920 bytes
    Disklabel type: gpt
    Disk identifier: 1D78C9DC-B51C-4729-8D7D-BB2B7C207511
    
    Device       Start       End   Sectors   Size Type
    /dev/sdb1     2048   1050623   1048576   512M EFI System
    /dev/sdb2  1050624   1550335    499712   244M Linux filesystem
    /dev/sdb3  1550336 250068991 248518656 118.5G Linux filesystem
    
    
    Disk /dev/mapper/my_encrypted_volume: 118.5 GiB, 127239454720 bytes, 248514560 sectors
    

    I've tried a number of answers from Mount encrypted volumes from command line? without success.

    If I do the accepted answer

    (this one)

    udisksctl unlock -b /dev/sdb5
    udisksctl mount -b /dev/mapper/ubuntu-root
    

    I get something like Object /org/freedesktop/UDisks2/block_devices/dm_2d3 is not a mountable filesystem.

    If I do the highest voted answer

    (this one)

    sudo cryptsetup luksOpen /dev/sdb3 my_encrypted_volume
    sudo mkdir /media/my_device
    sudo mount /dev/mapper/my_encrypted_volume /media/my_device
    

    I get mount: unknown filesystem type 'LVM2_member'

    • dajavex71
      dajavex71 over 7 years
      Have you tried to specify the option --filesystem-type ?
    • raphael
      raphael over 7 years
      @dajavex71 I did not. Care to elaborate?
    • dajavex71
      dajavex71 over 7 years
      You stated the following is received: I get something like Object /org/freedesktop/UDisks2/block_devices/dm_2d3 is not a mountable filesystem., My thought is that it needs to be told what type of filesystem, in order for the mount to be successful. Example: ext4, ext3, etc
    • raphael
      raphael over 7 years
      Same error if I try udisksctl mount --filesystem-type luks -b /dev/dm-4
    • dajavex71
      dajavex71 over 7 years
      I think we need additional information.from the terminal prompt, what is the output of the following: `sudo fdisk --list'?
    • danielleontiev
      danielleontiev over 7 years
      Try to unlock it with cryptsetup luksOpen
    • raphael
      raphael over 7 years
      Updated in response to both your questions
  • Gohu
    Gohu about 6 years
    Worked for me. Also, the vgchange -ay was necessary.
  • Michael Scheper
    Michael Scheper over 5 years
    Worked for me on Mint 19, but now I'm trying to undo it, so I can remove the drive and insert another. sudo umount /media/my_device works, but then sudo vgchange -a n mint-vg complains that 'Logical volume mint-vg/root contains a filesystem in use. Can't deactivate volume group "mint-vg" with 2 open logical volume(s)'. So how do I deactivate it? Using lvchange somehow, maybe? And then, I assume, it's sudo vgremove -f /dev/mapper/my_encrypted_volume and sudo cryptsetup luksClose my_encrypted_volume?
  • d.lime
    d.lime about 5 years
    Running this: sudo vgimportclone /dev/mapper/my_encrypted_volume Resulted in this: Device /dev/mapper/my_encrypted_volume has active LVs, deactivate first. To solve it, I've run sudo gparted, right click on the encrypted partition and "Deactivate". Hope it will help somebody in my same situation (I guess there's a command line for it too)