5

UPDATE 1:

userone@desktop:~$ sudo umount "/media/userone/New Volume"
umount: /media/userone/New Volume: mountpoint not found

userone@desktop:~$ sudo cryptsetup luksClose /dev/mapper/luks-04cb4ea7-7bba-4202-9056-a65006fe52d7
Device /dev/mapper/luks-04cb4ea7-7bba-4202-9056-a65006fe52d7 is not active.

userone@desktop:~$ sudo lsblk 
NAME                    MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sdb                       8:16   1 29.5G  0 disk  
└─sdb1                    8:17   1 29.5G  0 part  
  └─luks_USB            252:3    0 29.5G  0 crypt 
sr0                      11:0    1 1024M  0 rom   

userone@desktop:~$ sudo cryptsetup luksOpen /dev/sdb1 luks_USB
Device luks_USB already exists.

userone@desktop:~$ sudo mkdir /media/userone/luks_USB
mkdir: cannot create directory ‘/media/userone/luks_USB’: File exists

userone@desktop:~$ sudo mount /dev/mapper/luks_USB /media/userone/luks_USB
mount: wrong fs type, bad option, bad superblock on /dev/mapper/luks_USB,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

userone@desktop:~$ dmesg | tail
[20639.663250] JBD2: no valid journal superblock found
[20639.663257] EXT4-fs (dm-3): error loading journal
[20828.133606] JBD2: no valid journal superblock found
[20828.133613] EXT4-fs (dm-3): error loading journal
[20832.682397] JBD2: no valid journal superblock found
[20832.682405] EXT4-fs (dm-3): error loading journal
[20851.042343] JBD2: no valid journal superblock found
[20851.042349] EXT4-fs (dm-3): error loading journal
[21053.115711] JBD2: no valid journal superblock found
[21053.115718] EXT4-fs (dm-3): error loading journal

userone@desktop:~$ 

ORIGINAL QUESTION:

When I plug in my encrypted USB drive, I get this message in a GNOME dialog:

Error mounting /dev/dm-3 at /media/userone/New Volume: 
Command line 
    mount -t "ext4" \
          -o "uhelper=udisks2,nodev,nosuid" \
          "/dev/dm-3" "/media/userone/New Volume"'
exited with non-zero exit status 32:
    mount: wrong fs type, bad option, bad superblock on
           /dev/mapper/luks-04cb4ea7-7bba-4202-9056-a65006fe52d7,
           missing codepage or helper program, or other error.

In some cases, useful info is found in syslog - try dmesg | tail or so.

Anyone know how this can be corrected? It was working fine yesterday.

2
  • so is there anything relevant in dmesg | tail -n 100 or so? If you have systemd, you can substitute journalctl -n 100 to include userspace logs – sourcejedi May 8 '16 at 12:49
  • @sourcejedi, please see update 1 above. – oshirowanen May 8 '16 at 16:30
6
+450

It looks as though the journal has become corrupt, doing some searches over the past few days, this seems to not be uncommon on devices that use LUKS.

You could try running an fsck on the device, acknowledging that any data on the device may not be accessible after - you may like to use dd to make a copy of the drive before this.

A common resolution appears to be to create the EXT4 file system from scratch with journaling disabled using mke2fs -t ext4 -O ^has_journal /dev/device. Obviously you would lose the advantages of having a journaled file system by doing this, and lose any data on the device!


Problem

This problem is that the EXT4 file system’s journal has become corrupt. The problem is perhaps made a little obscure due to the fact that the device is encrypted and the file system resides “inside” the encryption.

Resolution

There is a thread of comments below, however I thought a summary here would be more beneficial to anyone who might come across this in the future.

  1. Unencrypt the device, this allows us to get at the device that the EXT4 file system resides on: sudo cryptsetup luksOpen /dev/sdb1 luks_USB

  2. Create an image of the device that has been created in the previous step. We need to do this because file system checking utils generally won’t work on mounted devices, and although the device with EXT4 on isn’t mounted, it’s “parent” is. sudo dd if=/dev/dm-3 of=/tmp/USBimage.dd (add bs and count arguments as you see fit).

  3. Now we have an image, we can run the file system checks: sudo e2fsck /tmp/USBimage.dd any problems found can be evaluated and fixed as required.

  4. You can check to see if your file system has been fixed by attempting to mount the image: sudo mount -o loop /tmp/USBimage.dd /mnt

At this point the OP was able to gain access to their files.

While I would suggest wiping the USB stick and starting over (back to a known state, etc), I think it would be possible to unmount the image from /mnt and then copy if back onto the device that become corrupt: sudo dd if=/tmp/USBimage.dd of=/dev/dm-3

14
  • Would it be worth DD'ing the device to make a bit identical copy before fsck'ing it? – oshirowanen May 11 '16 at 11:27
  • @oshirowanen most certainly. It would allow you to try multiple options – forquare May 11 '16 at 11:29
  • 1
    From the looks of things, you DD'd and fsck'd the partition that is encrypted (/dev/sdb1). What I think you need to do is run the sudo cryptsetup luksOpen /dev/sdb1 luks_USB, which then creates /dev/dm-3 and it is this device that you want to backup with DD and try to fsck as this has the EXT4 file system that I believe is corrupt. – forquare May 13 '16 at 15:52
  • 1
    OK, since that doesn't like it, I wonder if you'll have success doing an e2fsck on your DD image of dm-3? My like to make a cp of it before you try. – forquare May 15 '16 at 7:48
  • 1
    Try mounting with something like mount -o loop image.dd /mnt. – forquare May 15 '16 at 9:49
1

I often get errors like this for no apparent reason and often simply unmounting and remounting fixes it. You can do this with the following commands.

unmount - I know it never mounted in the first place, and will likely throw an error, but I would run to ensure a clean state for running luksClose

sudo umount "/media/userone/New Volume"

lukClose

sudo cryptsetup luksClose /dev/mapper/luks-04cb4ea7-7bba-4202-9056-a65006fe52d7

now remount, first obtain the partition number that the luks container is on with:

sudo lsblk 

or

sudo fdisk -l

then use that partition here, from the looks of your error message your partition may be
/dev/dm-3, but I would confirm first with sudo lsblk

sudo cryptsetup luksOpen </dev/luks_partition_here> luks_USB

sudo mkdir /media/userone/luks_USB
sudo mount /dev/mapper/luks_USB /media/userone/luks_USB
1
  • Please see update 1 above. – oshirowanen May 8 '16 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.