LVM signature unintentionally deleted from the root partition

Hi,

How to recover the LVM signature on a root partition when vgchange --activationmode partial fails due to the root being located on a single disk or partition.

How to recover the LVM signature on the root partition using Rescue Mode.

Accidental removal of LVM signature from root partition.

Thanks in advance.

Jenn

LVM signature/metadata is stored in the headers of disks or partitions. During system boot, these headers are read to activate the LVM accordingly.

In certain situations, these headers can become damaged, corrupted, or accidentally wiped due to incorrect use of disk editing tools such as parted, fdisk, or similar utilities.

Always use the growpart utility when extending the last partition of a disk.

The scenario being addressed here is as follows:

  • The LVM signature was unintentionally wiped using the fdisk utility.
  • The LVM module is preventing the signature from being restored because the root partition is actively in use by the system.

Follow the steps outlined below:

  • Copy the existing healthy LVM backup/archive file to the /tmp directory of a separate working system.
  • Boot the affected system into Rescue Mode using the ISO image.

Once in Rescue Mode, enable the SSH daemon (SSHD) to allow secure remote access to the system.

  • Select option 3 [SKIP] to chroot into the system. Enable the network interface as described in the document above, then run the following commands:
  • Copy the LVM backup/archive file into the /tmp directory of the problematic server.
# cd /tmp
# scp <name of the file> root@ip.of.problem.system:/tmp

Restore the LVM metadata/signatures:

# pvcreate --uuid pvuuid-of-the-device-dev-sda4 --restorefile /tmp/rhel /dev/sda4
# vgcfgrestore -f /tmp/rhel rhel

Verify that the restore operation completed successfully by running the following commands:

# wipefs /dev/sda4
# pvs

Verify whether the LVM signature exists on the disk or partition:

# wipefs /dev/sda
# pvs

Let me know if you have questions.

Richard :grinning_cat: