I'm having some trouble restoring a back-up I made of a encrypted filesystem. The back-up is a .img file containing a single disc partition. This partition is a luks container in which a logical volume group 'vg-crypt' resides. Within this volume group I have two logical volumes, lv-crypt-root and lv-crypt-swap.
In my new Ubuntu install I proceed as following
cryptsetup luksOpen /media/lars/SHD/disk.img backup
pasword.... and to check if the logical volumegroup is recognised I type:
pvs
which tells me:
PV VG Fmt Attr PSize PFree
/dev/mapper/backup vgcrypt lvm2 a-- 151,11g 196,00m
/dev/mapper/tphd vgtphd lvm2 a-- 151,11g 116,00m
so far so good, my current root volume (tphd or vgtphd) is recognised as well as my backup vg (backup or vgcrypt) Now lets check out the lv's in the backup volume:
lvdisplay /dev/vgcrypt
...
--- Logical volume ---
LV Path /dev/vgcrypt/lv-crypt-root
LV Name lv-crypt-root
VG Name vgcrypt
LV UUID Nc4vsK-IcqB-l2S1-iyIJ-rSOj-vzqt-osGcn5
LV Write Access read/write
LV Creation host, time ubuntu, 2013-06-19 10:40:44 +0200
LV Status suspended
# open 0
LV Size 147,12 GiB
Current LE 37663
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:5
--- Logical volume ---
LV Path /dev/vgcrypt/lv-crypt-swap
LV Name lv-crypt-swap
VG Name vgcrypt
LV UUID ExEizv-aHCn-ZG1Q-nqj5-jSQE-NKYG-2RKyVb
LV Write Access read/write
LV Creation host, time ubuntu, 2013-06-19 10:41:14 +0200
LV Status suspended
# open 0
LV Size 3,80 GiB
Current LE 973
..... bla bla
conclusion, lv is recognized.
This is where the problems start, I try to mount the lv:
mount /dev/vgcrypt/lv-crypt-root /mnt/lvm/
gives me
mount: special device /dev/vgcrypt/lv-crypt-root does not exist
when making sure it is active by:
vgchange -ay /dev/vgcrypt
I got this:
device-mapper: resume ioctl on failed: Invalid argument
Unable to resume vgcrypt-lv--crypt--root (252:5)
device-mapper: resume ioctl on failed: Invalid argument
Unable to resume vgcrypt-lv--crypt--swap (252:6)
2 logical volume(s) in volume group "vgcrypt" now active
I got pretty much no idea what that means so I start googling and find that maybe I should export the inactivated vg with vgexport so:
vgchange -an /dev/vgcrypt
Attempted to decrement suspended device counter below zero.
Attempted to decrement suspended device counter below zero.
0 logical volume(s) in volume group "vgcrypt" now active
and
vgexport vgcrypt
Volume group "vgcrypt" has active logical volumes
seems pretty paradoxical to me.
Can anyone point me in the right direction? Any help would be greatly appreciated :)
P.S. just checked the syslog, seems relevant but doesn't make much sense to me:
(filtered al the wifi info out:)
cat /var/log/syslog | grep kernel | grep -v wlan | grep -v cfg80211 | tail -n 40 | cut -f 5-90 -d " "
kernel: [58297.025013] device-mapper: table: 252:8: linear: dm-linear: Device lookup failed
kernel: [58297.025023] device-mapper: ioctl: error adding target to table
kernel: [58297.026024] device-mapper: table: 252:8: linear: dm-linear: Device lookup failed
kernel: [58297.026030] device-mapper: ioctl: error adding target to table
kernel: [58297.026901] device-mapper: table: 252:8: linear: dm-linear: Device lookup failed
kernel: [58297.026907] device-mapper: ioctl: error adding target to table
kernel: [58297.077530] device-mapper: multipath: version 1.5.1 loaded
kernel: [59654.867358] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [59654.867994] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912
kernel: [59655.179856] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [59655.180623] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912
kernel: [59776.851223] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [59776.851860] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912
kernel: [59777.149049] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [59777.149561] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912
kernel: [60837.153424] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [60837.154789] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912
kernel: [61508.827915] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [61508.831243] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912
kernel: [61514.020906] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [61514.021532] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912
kernel: [61514.311394] device-mapper: table: 252:5: dm-7 too small for target: start=2048, len=308535296, dev_size=284453912
kernel: [61514.311906] device-mapper: table: 252:6: dm-7 too small for target: start=308537344, len=7970816, dev_size=284453912