I've made a mistake with my luks lvm device. Yesterday I wanted to extend my vg-home logical volume with a second disk, so I did
vgextend /dev/sdb1 vg (vg is the name of my volume group) but when I did
df -h, the size of my vg-home volume was still the same.
So I played around with several solutions, I have remove the disk from the group, unplug the disk ans plug it again but I had the unknown device problem (unknow device in my vg group). So I did
vgreduce --removemissing, hoping it will work, but it removed the entire vg-home volume !
So now, I have no access to my physical volume. I have to boot to debian live USB, and after doing
cryptsetupp luksOpen /dev/sda1 vg,
pvscan with or without
--cache option just returns
Reading volume groups from cache,
vgchange -ay returns nothing as
sda 8:0 0 298,1G 0 disk └─sda1 8:1 0 298,1G 0 part └─vg 254:0 0 298,1G 0 crypt
Disk /dev/mapper/vg: 298,1 GiB, 320069787648 bytes, 625136304 sectors 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: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type /dev/mapper/vg-part1 * 2048 16779263 16777216 8G 82 Linux swap / So /dev/mapper/vg-part2 16779264 69208063 52428800 25G 83 Linux /dev/mapper/vg-part3 69208064 625133567 555925504 265,1G 83 Linux
TestDisk says it doesn't support the filesystem when I try to list the file of my home and root volume (it recognize it). So I thought my last solution was on this post : can you recover lvm metadata without access to /etc/lvm/?
strings /dev/sda1 > data but I don't understand what I have to do after that. What I have to edit/remove from this data file ? All parts that concern old config contents or just keep the last version of config content ? With or without all other data too ? And also is this file I have to indicate for
--restorefile options of the
pvcreate command ? And what about