Sample Header Ad - 728x90

How to mount / recover my encrypted logical volumes?

1 vote
0 answers
1122 views
**I have put some EDIT at the END of the first reply.** unfortunately I run into some problem with my old LVM installation where debian10 was running on it. I have installed Debian 11 alongside Debian 10. While doing so it looks like my Debian 10 LVM became corrupted (I was not able to boot from it anymore) and I don't know how to mount it now. Debian 10 was installed using the installer. It was installed encrypted and inside an LVM that was streched across two drives. While booting initramfs I had to enter my password to decrypt the lvm. **My goal is to save some data from the NVME drive (where debian 10 and the lvm was stored) to the newly attached SATA drive where my new Debian 11 installation is running on.** **My main Question is: How to mount a Logical Volume (etc & home) from the NVME?** I have read several suggestions but this gets me more and more confusing and I do not want to make any more mistakes on the data drives before things get worse. A really simple solutions seems to be https://superuser.com/questions/116617/how-to-mount-an-lvm-volume but I dont know if I can make use of it here now and if it could damage the underlying volumes / volumegroups somehow. Another hint was from here https://unix.stackexchange.com/questions/154630/can-you-recover-lvm-metadata-without-access-to-etc-lvm to use sudo strings /dev/nvme0n1p6 | less but the output was not helpful. It only showed that the lvm was luks encrypted:
LABELONE
LVM2 001s1TKbLcSK8egOQIexp0yoIYg8jHSpbwC
 LVM2 x[5A%r0N*>
sha256
Jz?73404056-2fb5-4d7f-b1eb-8cff2273a211
{"keyslots":{"0":{"type":"luks2","key_size":64,"af":{"type":"luks1","stripes":4000,"hash":"sha512"},"area":{"type":"raw","offset":"32768","size":"258048","encryption":"aes-xts-plain64","key_size":64},"kdf":{"type":"argon2i","time":9,"memory":1048576,"cpus":4,"salt":
OUTPUT Truncated
If you need any further information please let me know in the comments. Thank you for helping me.
pvscan 
  WARNING: Couldn't find device with uuid ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I.
  WARNING: Couldn't find device with uuid RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2.
  WARNING: VG lvm-crypt is missing PV ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I (last written to /dev/mapper/nvme0n1p8_crypt).
  WARNING: VG lvm-crypt is missing PV RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2 (last written to /dev/mapper/nvme0n1p6_crypt).
  PV [unknown]                VG lvm-crypt       lvm2 [86,50 GiB / 0    free]
  PV [unknown]                VG lvm-crypt       lvm2 [400,60 GiB / 0    free]
  PV /dev/mapper/sda1-crypt   VG lvm-crypt       lvm2 [931,49 GiB / <397,07 GiB free]
  PV /dev/nvme0n1p6                              lvm2 [400,62 GiB]
  PV /dev/nvme0n1p9                              lvm2 [<86,52 GiB]
  Total: 5 [1,86 TiB] / in use: 3 [<1,39 TiB] / in no VG: 2 [<487,14 GiB]
pvdisplay 
  WARNING: Couldn't find device with uuid ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I.
  WARNING: Couldn't find device with uuid RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2.
  WARNING: VG lvm-crypt is missing PV ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I (last written to /dev/mapper/nvme0n1p8_crypt).
  WARNING: VG lvm-crypt is missing PV RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2 (last written to /dev/mapper/nvme0n1p6_crypt).
  --- Physical volume ---
  PV Name               [unknown]
  VG Name               lvm-crypt
  PV Size               86,50 GiB / not usable 2,00 MiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              22144
  Free PE               0
  Allocated PE          22144
  PV UUID               ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I
   
  --- Physical volume ---
  PV Name               [unknown]
  VG Name               lvm-crypt
  PV Size               <400,61 GiB / not usable 4,00 MiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              102554
  Free PE               0
  Allocated PE          102554
  PV UUID               RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2
   
  --- Physical volume ---
  PV Name               /dev/mapper/sda1-crypt
  VG Name               lvm-crypt
  PV Size               <931,50 GiB / not usable 4,00 MiB
  Allocatable           yes 
  PE Size               4,00 MiB
  Total PE              238462
  Free PE               101649
  Allocated PE          136813
  PV UUID               s4UhPf-B5u1-d73L-DKcy-FR93-KvMa-kNrQJ6
   
  "/dev/nvme0n1p6" is a new physical volume of "400,62 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/nvme0n1p6
  VG Name               
  PV Size               400,62 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               s1TKbL-cSK8-egOQ-Iexp-0yoI-Yg8j-HSpbwC
   
  "/dev/nvme0n1p9" is a new physical volume of "<86,52 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/nvme0n1p9
  VG Name               
  PV Size               <86,52 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               8Lk9H1-Tveo-JCko-nfgd-EDrL-KJVq-cA01lR
lvmdiskscan 
  /dev/nvme0n1                                          [     931,51 GiB] 
  /dev/mapper/sdd5-crypt                                [    <840,49 GiB] 
  /dev/nvme0n1p1                                        [     450,00 MiB] 
  /dev/sda1                                             [     931,51 GiB] 
  /dev/mapper/sdd6-crypt                                [     498,03 GiB] 
  /dev/nvme0n1p2                                        [     100,00 MiB] 
  /dev/mapper/sdc1-crypt                                [    <447,11 GiB] 
  /dev/nvme0n1p3                                        [      16,00 MiB] 
  /dev/mapper/sda1-crypt                                [    <931,50 GiB] LVM physical volume
  /dev/nvme0n1p4                                        [     <54,17 GiB] 
  /dev/mapper/luks-cb25c253-2141-40b5-83ae-a2c1c0980496 [    <465,75 GiB] 
  /dev/nvme0n1p5                                        [    <206,72 GiB] 
  /dev/nvme0n1p6                                        [     400,62 GiB] LVM physical volume
  /dev/nvme0n1p7                                        [     500,00 MiB] 
  /dev/nvme0n1p8                                        [       1,86 GiB] 
  /dev/nvme0n1p9                                        [     <86,52 GiB] LVM physical volume
  /dev/nvme0n1p10                                       [      86,91 GiB] 
  /dev/nvme0n1p11                                       [     532,00 MiB] 
  /dev/nvme1n1                                          [    <953,87 GiB] 
  /dev/nvme1n1p1                                        [     856,21 GiB] 
  /dev/sdb                                              [      12,73 TiB] 
  /dev/sdc1                                             [     447,12 GiB] 
  /dev/sdd1                                             [     487,00 MiB] 
  /dev/sdd2                                             [     488,00 MiB] 
  /dev/sdd3                                             [     122,00 MiB] 
  /dev/sdd4                                             [     931,32 GiB] 
  /dev/sdd5                                             [     840,50 GiB] 
  /dev/sdd6                                             [    <498,05 GiB] 
  /dev/sde1                                             [     465,76 GiB] 
  4 disks
  22 partitions
  1 LVM physical volume whole disk
  2 LVM physical volumes
lvdisplay 
  WARNING: Couldn't find device with uuid ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I.
  WARNING: Couldn't find device with uuid RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2.
  WARNING: VG lvm-crypt is missing PV ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I (last written to /dev/mapper/nvme0n1p8_crypt).
  WARNING: VG lvm-crypt is missing PV RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2 (last written to /dev/mapper/nvme0n1p6_crypt).
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/wurzel
  LV Name                wurzel
  VG Name                lvm-crypt
  LV UUID                sYo29d-sbzF-w6Bm-0E3W-LxNK-fr9i-jDnqOu
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:33:51 +0200
  LV Status              NOT available
  LV Size                30,73 GiB
  Current LE             7867
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/home
  LV Name                home
  VG Name                lvm-crypt
  LV UUID                WdZkeA-uAQX-ryhu-11Xb-1Qp9-v3ld-FVIoej
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:33:58 +0200
  LV Status              NOT available
  LV Size                195,31 GiB
  Current LE             50000
  Segments               4
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/var
  LV Name                var
  VG Name                lvm-crypt
  LV UUID                TQav8N-UWZB-6ST1-JMBa-dnCp-A79j-9SdPDD
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:34:07 +0200
  LV Status              NOT available
  LV Size                18,62 GiB
  Current LE             4768
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/temp
  LV Name                temp
  VG Name                lvm-crypt
  LV UUID                YBsh1S-1QJI-yIc1-071S-Mqgr-QCoV-7ktV0g
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:34:16 +0200
  LV Status              NOT available
  LV Size                <1,86 GiB
  Current LE             476
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/vms
  LV Name                vms
  VG Name                lvm-crypt
  LV UUID                MYuXdV-QuC8-YToG-v2gU-PmlJ-fAEz-AME3Ba
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-11-11 10:31:26 +0100
  LV Status              NOT available
  LV Size                540,62 GiB
  Current LE             138400
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/buero
  LV Name                buero
  VG Name                lvm-crypt
  LV UUID                8sxSOg-gCfc-Dqb5-jTPg-nJGo-qklD-MaM4vV
  LV Write Access        read/write
  LV Creation host, time r7deb, 2022-06-19 08:35:01 +0200
  LV Status              NOT available
  LV Size                <117,19 GiB
  Current LE             30000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/buero2
  LV Name                buero2
  VG Name                lvm-crypt
  LV UUID                r3ZqOD-6dqr-esJZ-jqg9-qzoS-7k1o-sRMf8P
  LV Write Access        read/write
  LV Creation host, time r7deb, 2022-06-19 08:37:31 +0200
  LV Status              NOT available
  LV Size                <117,19 GiB
  Current LE             30000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
vgscan -v
  WARNING: Couldn't find device with uuid ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I.
  WARNING: Couldn't find device with uuid RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2.
  WARNING: VG lvm-crypt is missing PV ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I (last written to /dev/mapper/nvme0n1p8_crypt).
  WARNING: VG lvm-crypt is missing PV RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2 (last written to /dev/mapper/nvme0n1p6_crypt).
  Found volume group "lvm-crypt" using metadata type lvm2
vgdisplay -v
  WARNING: Couldn't find device with uuid ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I.
  WARNING: Couldn't find device with uuid RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2.
  WARNING: VG lvm-crypt is missing PV ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I (last written to /dev/mapper/nvme0n1p8_crypt).
  WARNING: VG lvm-crypt is missing PV RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2 (last written to /dev/mapper/nvme0n1p6_crypt).
  --- Volume group ---
  VG Name               lvm-crypt
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  37
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                7
  Open LV               0
  Max PV                0
  Cur PV                3
  Act PV                1
  VG Size               <1,39 TiB
  PE Size               4,00 MiB
  Total PE              363160
  Alloc PE / Size       261511 / <1021,53 GiB
  Free  PE / Size       101649 / <397,07 GiB
  VG UUID               hBHElE-V8b3-bBWF-Om2J-LH8u-0D7R-Nh8vdw
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/wurzel
  LV Name                wurzel
  VG Name                lvm-crypt
  LV UUID                sYo29d-sbzF-w6Bm-0E3W-LxNK-fr9i-jDnqOu
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:33:51 +0200
  LV Status              NOT available
  LV Size                30,73 GiB
  Current LE             7867
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/home
  LV Name                home
  VG Name                lvm-crypt
  LV UUID                WdZkeA-uAQX-ryhu-11Xb-1Qp9-v3ld-FVIoej
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:33:58 +0200
  LV Status              NOT available
  LV Size                195,31 GiB
  Current LE             50000
  Segments               4
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/var
  LV Name                var
  VG Name                lvm-crypt
  LV UUID                TQav8N-UWZB-6ST1-JMBa-dnCp-A79j-9SdPDD
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:34:07 +0200
  LV Status              NOT available
  LV Size                18,62 GiB
  Current LE             4768
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/temp
  LV Name                temp
  VG Name                lvm-crypt
  LV UUID                YBsh1S-1QJI-yIc1-071S-Mqgr-QCoV-7ktV0g
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-09-10 11:34:16 +0200
  LV Status              NOT available
  LV Size                <1,86 GiB
  Current LE             476
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/vms
  LV Name                vms
  VG Name                lvm-crypt
  LV UUID                MYuXdV-QuC8-YToG-v2gU-PmlJ-fAEz-AME3Ba
  LV Write Access        read/write
  LV Creation host, time r7deb, 2020-11-11 10:31:26 +0100
  LV Status              NOT available
  LV Size                540,62 GiB
  Current LE             138400
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/buero
  LV Name                buero
  VG Name                lvm-crypt
  LV UUID                8sxSOg-gCfc-Dqb5-jTPg-nJGo-qklD-MaM4vV
  LV Write Access        read/write
  LV Creation host, time r7deb, 2022-06-19 08:35:01 +0200
  LV Status              NOT available
  LV Size                <117,19 GiB
  Current LE             30000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/lvm-crypt/buero2
  LV Name                buero2
  VG Name                lvm-crypt
  LV UUID                r3ZqOD-6dqr-esJZ-jqg9-qzoS-7k1o-sRMf8P
  LV Write Access        read/write
  LV Creation host, time r7deb, 2022-06-19 08:37:31 +0200
  LV Status              NOT available
  LV Size                <117,19 GiB
  Current LE             30000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Physical volumes ---
  PV Name               [unknown]     
  PV UUID               ovqLHE-HeCP-MabL-UYaZ-zKGk-dSeM-G0HP0I
  PV Status             allocatable
  Total PE / Free PE    22144 / 0
   
  PV Name               [unknown]     
  PV UUID               RxI6g8-Fp87-j7O4-N055-arL3-0l1E-CIIvo2
  PV Status             allocatable
  Total PE / Free PE    102554 / 0
   
  PV Name               /dev/mapper/sda1-crypt     
  PV UUID               s4UhPf-B5u1-d73L-DKcy-FR93-KvMa-kNrQJ6
  PV Status             allocatable
  Total PE / Free PE    238462 / 101649
lsblk -o NAME,SIZE,TYPE,UUID
NAME                                            SIZE TYPE  UUID
sda                                           931,5G disk  
└─sda1                                        931,5G part  50353f7f-7bc8-4100-85e2-56db32895c11
  └─sda1-crypt                                931,5G crypt s4UhPf-B5u1-d73L-DKcy-FR93-KvMa-kNrQJ6
sdb                                            12,7T disk  a7bbc558-c28c-4df6-992d-8ce16a961147
sdc                                           447,1G disk  
└─sdc1                                        447,1G part  c1971d93-afc1-4f0c-875a-4280c5a275fd
  └─sdc1-crypt                                447,1G crypt 06cd919c-024c-4987-9e78-41551292ed60
sdd                                             3,6T disk  
├─sdd1                                          487M part  
├─sdd2                                          488M part  727C-2D0A
├─sdd3                                          122M part  
├─sdd4                                        931,3G part  786749de-fa3c-4c2c-ac40-23b6ddd6e76e
├─sdd5                                        840,5G part  0fe82dcd-1d1d-4c4b-9f90-91c4cfd6ec07
│ └─sdd5-crypt                                840,5G crypt ad53f0e9-5e4f-48c9-ba2f-2ca3af949ea2
└─sdd6                                          498G part  38bafe27-5b78-48ea-980c-de636514df14
  └─sdd6-crypt                                  498G crypt eb0a33c9-bd6c-4c38-ae31-4667ba3cff24
sde                                           465,8G disk  
└─sde1                                        465,8G part  cb25c253-2141-40b5-83ae-a2c1c0980496
  └─luks-cb25c253-2141-40b5-83ae-a2c1c0980496 465,7G crypt b7aef9a8-41d8-4d11-975f-9f77645434a2
sr0                                            1024M rom   
nvme0n1                                       931,5G disk  
├─nvme0n1p1                                     450M part  D09495E59495CDFA
├─nvme0n1p2                                     100M part  7096-4C77
├─nvme0n1p3                                      16M part  
├─nvme0n1p4                                    54,2G part  C2A82FF0A82FE221
├─nvme0n1p5                                   206,7G part  04BFD1325C7FA67C
├─nvme0n1p6                                   400,6G part  s1TKbL-cSK8-egOQ-Iexp-0yoI-Yg8j-HSpbwC
├─nvme0n1p7                                     500M part  A5A2-6853
├─nvme0n1p8                                     1,9G part  41aadaed-4741-42a1-b17b-128c9fcf6188
├─nvme0n1p9                                    86,5G part  8Lk9H1-Tveo-JCko-nfgd-EDrL-KJVq-cA01lR
├─nvme0n1p10                                   86,9G part  c6c45bc2-a657-4dbb-83b2-b8ef4b3930b9
└─nvme0n1p11                                    532M part  A63AA7D23AA79E35
nvme1n1                                       953,9G disk  
└─nvme1n1p1                                   856,2G part  68BEA6DCBEA6A1D4
**EDIT 1:** So far so bad. I tried a few things and to me it looks like the UUID's have changed or the Header is corrupt. I found the old debian 10 /boot/ partition and was able to boot into initramfs. Here I was able to log in via busy box that I did setup years ago ( to be able to remote log in and remote unlock the drives to boot the system up. ) So I did log in and found the crypttab file. Regarding to its content it is expecting different UUID's.
cat /cryptroot/crypttab3 
nvme0n1p8_crypt UUID=1697ec4a-b30b-4642-b4f3-6ba94afc40ec none luks,discard
nvme0n1p6_crypt UUID=73404056-2fb5-4d7f-b1eb-8cff2273a211 /FIXME-initramfs-rootmnt/root/luks.keys.d/nvme0n1p6.luks.key luks,discard,initramfs
crypt_pv_SamsungQVO UUID=50353f7f-7bc8-4100-85e2-56db32895c11 /FIXME-initramfs-rootmnt/root/luks.keys.d/SamsungQVO_S4CZNG0M301660E.luks.key luks,discard,initramfs
kingston_crypt UUID=c1971d93-afc1-4f0c-875a-4280c5a275fd /FIXME-initramfs-rootmnt/root/luks.keys.d/KINGSTON_SHFS37A480G_50026B7269007A6C.luks.key luks,discard,initramfs
I tried to manually adjust them to the appropriate partitions using vi but it cannot find a valid LUKS partition. Same result when trying to decrypt the drives when booting into debian 11. It says it is not a valid LUKS partition. So I might give up at this point thinking the partition header got corrupt (which is really suspicous - I mean two corrupt luks header at once) or the LVM needs to setup the Volume Group prior to be able to unlock the partitions/volumes with LUKS. I guess the latter is the case here, but I am running out of ideas. If you do not have any better advise I will try to change the UUID's to those written down in the crypttab file inside initramfs that I found in the old /boot/ partition. Hopefully the LVM will get things right this way.
Asked by AlexOnLinux (725 rep)
Nov 17, 2022, 09:35 AM
Last activity: Nov 18, 2022, 05:17 PM