I'm having trouble mounting my LUKS-encrypted backup partition which resides in /dev/sdb1
When I boot my PC, the mapper prompts for the key and mounts a /dev/mapper/backupdrive which I can mount/umount and write to, no problem there.
When I unmount and close this mapping (cryptsetup luksClose), I can no longer open a new mapping (in other words, I am unable to access the data on that partition). Both luksOpen and luksDump give the following response:
$ sudo cryptsetup -v luksDump /dev/sdb1 Device /dev/sdb1 is not a valid LUKS device. $ sudo cryptsetup -v luksOpen /dev/sdb1 backupdrive Device /dev/sdb1 is not a valid LUKS device.
When I try to mount the /dev/sdb1 directly without dm mapping, no valid file system is recognized, so I assume the partition is indeed encrypted as should. (When I reboot the PC, I can again mount the auto-generated /dev/mapper/backupdrive, so I suppose no disk corruption is in the game)
The output of fdisk -l is the following:
$ sudo fdisk -l Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xa8a8a8a8 Device Boot Start End Blocks Id System /dev/sda1 1 5384 43246948+ 7 HPFS/NTFS /dev/sda2 5385 14594 73972737 5 Extended /dev/sda5 * 5385 14477 73031680 83 Linux /dev/sda6 14477 14594 940032 82 Linux swap / Solaris Disk /dev/sdb: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x07620762 Device Boot Start End Blocks Id System /dev/sdb1 * 1 9729 78148161 7 HPFS/NTFS
Any hints on what the problem might be?
As requested, the output of blkid:
$sudo blkid /dev/sda1: UUID="5230B51530B50151" TYPE="ntfs" /dev/sda5: UUID="636e1d51-d19e-42ee-8061-97a47b1137c4" TYPE="ext3" /dev/sda6: UUID="ad99fca0-db32-4339-b4c0-99f9deda3145" TYPE="swap"
(sda1 is my windows installation, sda5 my linux installation and sda6 is the swap).
I'm pretty sure /dev/sdb1 is where the luks-encrypted drive should be, as this is the drive that is mapped according to crypttab:
# <target name> <source device> <key file> <options> backupcrypt /dev/sdb1 none none
EDIT 2: as requested, I added the full output of "fdisk -l"
When I boot the PC and mount the /dev/mapper/backupcrypt that was created during the boot process, I get the following output for
$ sudo blkid /dev/sda1: UUID="5230B51530B50151" TYPE="ntfs" /dev/sda5: UUID="636e1d51-d19e-42ee-8061-97a47b1137c4" TYPE="ext3" /dev/sda6: UUID="ad99fca0-db32-4339-b4c0-99f9deda3145" TYPE="swap" /dev/mapper/backupcrypt: UUID="eb684a3d-2cfc-4a89-bf8e-0bf7e3e01868" TYPE="ext3"
dmesg indicates the encrypted partition was properly mounted:
$ dmesg | tail [ 90.565150] kjournald starting. Commit interval 5 seconds [ 90.568469] EXT3 FS on dm-0, internal journal [ 90.568479] EXT3-fs: mounted filesystem with ordered data mode.
luksClose the mapping, I get no additional
dmesg output. When I then try to
luksOpen it again, I get the "not a valid LUKS device" error again, but no additional