0

I did a stupid thing and accidentally removed my LVM partition in parted. Since this was a single disk LVM, parted rescue finds an EXT2 partition in the sectors, but I am unable to boot from that since my initramfs is still looking for an LVM VG. I was able to access the ext2 partition in rescue mode and get the lvm config for the VG but doing an LVG config restore on a partition that start right after the boot one doesn't seem to work. Is there a way I can either disable LVM and boot pure ext2 or find where the LVM metadata is and fix it?

  • What exactly did you do? Edit your question to add a list of your block devices, how you recreated the partition, and how you recovered PV metadata (including the correct UUID). – John Mahowald Feb 11 '20 at 04:39

1 Answers1

0

I was able to solve this issue by manually creating the LVM partition.

Since the EXT2 partition was exactly 4096 sectors after the /boot EXT4, I was setting the start of the LVM partition right after the boot one. Since it was a GPT device, the correct offset was 2048 sectors, which I manually entered into parted's mkpart (use unit s). After this, the LVM service correctly recognized the metadata already so the restore was unnecessary (if still needed, use pvcreate with the --uuid and --restorefile options)