Article 5FW33 Broken LUKS LVM Debian install

Broken LUKS LVM Debian install

by
JClant
from LinuxQuestions.org on (#5FW33)
Hi Everybody! Hope you are having a good weekend :)

I had a rough one so far.. As an intro, I had Debian install running on LUKS encrypted LVM.

This morning, I wanted to install OS on external disk to be used on another host, but mistakenly I chose the wrong disk... Few seconds in I noticed that I have chosen the wrong one, so right away I stopped the process, but partition table already got written.

To recover I booted system rescue CD, and with the help of testdisk I recovered the partitions. However, I still couldn't boot my old setup, so I started looking for a way to recover the files at least. I ran rescue disk again, and I did the following:

Code:# fdisk -l

Disk /dev/nvme0n1: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 980 PRO 250GB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 6653A4F0-8EEA-11EB-8B8C-1C697A6E9DFB

Device Start End Sectors Size Type
/dev/nvme0n1p1 1050624 2050047 999424 488M Linux filesystem
/dev/nvme0n1p2 2050048 446297482 444247435 211.8G Linux filesystemCode:# cryptsetup open /dev/nvme0n1p2 recoveryx --type luks

WARNING: Locking directory /run/cryptsetup is missing!
Enter passphrase for /dev/nvme0n1p2:Code:# ls /dev/mapper/

control recoveryxCode:# vgscan

WARNING: Device /dev/mapper/recoveryx has size of 444214667 sectors which is smaller than corresponding PV size of 486313984 sectors. Was device resized?
WARNING: One or more devices used as PVs in VG worker1-vg have changed sizes.
Found volume group "worker1-vg" using metadata type lvm2Code:# lvdisplay

WARNING: Device /dev/mapper/recoveryx has size of 444214667 sectors which is smaller than corresponding PV size of 486313984 sectors. Was device resized?
WARNING: One or more devices used as PVs in VG worker1-vg have changed sizes.
--- Logical volume ---
LV Path /dev/worker1-vg/root
LV Name root
VG Name worker1-vg
LV UUID ZnO9e1-PRbO-TuDA-mfiV-uQXw-dzNT-OWunvP
LV Write Access read/write
LV Creation host, time worker1, 2021-01-02 13:28:48 +0000
LV Status NOT available
LV Size 230.93 GiB
Current LE 59119
Segments 1
Allocation inherit
Read ahead sectors auto

--- Logical volume ---
LV Path /dev/worker1-vg/swap_1
LV Name swap_1
VG Name worker1-vg
LV UUID T4UxqE-swKh-ivwW-JGwF-7vNU-eax7-hiy7dc
LV Write Access read/write
LV Creation host, time worker1, 2021-01-02 13:28:49 +0000
LV Status NOT available
LV Size 980.00 MiB
Current LE 245
Segments 1
Allocation inherit
Read ahead sectors autoCode:# vgchange -v -ay worker1-vg

WARNING: Device /dev/mapper/recoveryx has size of 444214667 sectors which is smaller than corresponding PV size of 486313984 sectors. Was device resized?
WARNING: One or more devices used as PVs in VG worker1-vg have changed sizes.
Activating logical volume worker1-vg/root.
activation/volume_list configuration setting not defined: Checking only host tags for worker1-vg/root.
Creating worker1--vg-root
Loading table for worker1--vg-root (254:1).
device-mapper: reload ioctl on (254:1) failed: Invalid argument
Removing worker1--vg-root (254:1)
Activating logical volume worker1-vg/swap_1.
activation/volume_list configuration setting not defined: Checking only host tags for worker1-vg/swap_1.
Creating worker1--vg-swap_1
Loading table for worker1--vg-swap_1 (254:1).
device-mapper: reload ioctl on (254:1) failed: Invalid argument
Removing worker1--vg-swap_1 (254:1)
Activated 0 logical volumes in volume group worker1-vg.
0 logical volume(s) in volume group "worker1-vg" now activeLuckily the VG is detected, and I still have the LUKS header, but as can be seen in the above code blocks, activation fails due to "device-mapper: reload ioctl on (254:1) failed: Invalid argument"

Any ideas how to solve this issue?latest?d=yIl2AUoC8zA latest?i=WORdManfOiI:0J7jqjbEkyk:F7zBnMy latest?i=WORdManfOiI:0J7jqjbEkyk:V_sGLiP latest?d=qj6IDK7rITs latest?i=WORdManfOiI:0J7jqjbEkyk:gIN9vFwWORdManfOiI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments