2
I had created an encrypted file system using the following commands:
# dd if=/dev/zero of=/opt/vol
# losetup -e aes /dev/loop0 /opt/vol
Password:
# mkfs.ext4 /dev/loop0
The above device was mounted as follows:
# mount -t ext4 -o loop -o rw -o encryption=aes /opt/vol /mnt/enc
Password:
#
I used to store data in the mounted location (/mnt/enc). Recently I re-installed my OS. So, before that, I backed up the /opt/vol file elsewhere. After re-installing ubuntu 15.10, I copied the file back to the same location (/opt/vol). Then I tried remounting the same file in ubuntu 15.10 and noticed the below error:
# losetup_e -e aes /dev/loop0 /opt/vol
Password:
# mount_e -t ext4 -o loop -o rw -o encryption=aes /opt/vol /mnt/enc
lt-mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
# dmesg | tail
[ 81.215500] EXT4-fs (loop1): VFS: Can't find ext4 filesystem
[ 235.538008] EXT4-fs (loop1): VFS: Can't find ext4 filesystem
[ 348.594842] EXT4-fs (loop1): VFS: Can't find ext4 filesystem
#
I had to re-compile util-linux from source (version 2.22), as I found that '-e' option was not supported from util-linux-2.23 onwards as mentioned here. Hence after compiling, I linked the util-linux-2.22 losetup and mount binaries to losetup_e and mount_e respectively.
Thanks @davidgo. Tried doing as you mentioned. The same error is returned "Can't find ext4 filesystem". However it is weird that it is reporting the error for loop1, instead of loop0, even though I mounted loop0. Following is the error: [ 2038.299368] EXT4-fs (loop1): VFS: Can't find ext4 filesystem – Bharath Kanakasabha – 2015-11-09T05:49:38.807
Wait, it might be possible that I have corrupted the raw volume by mounting using earlier command. Will copy the volume again and update the results of mounting /dev/loop0 – Bharath Kanakasabha – 2015-11-09T05:54:52.913
Nope. Same error again – Bharath Kanakasabha – 2015-11-09T06:04:07.403
Similar looking issue: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/919736
– Bharath Kanakasabha – 2015-11-09T06:14:12.100