Linux: Run fsck On LUKS (dm-crypt) Based LVM Physical Volume

Linux: Run fsck On LUKS (dm-crypt) Based LVM Physical Volume

To run fsck on a LUKS (dm-crypt) based LVM physical volume on a Linux system, you will need to first unlock the LUKS volume and then activate the LVM volume group.

Here's an example of how to run fsck on a LUKS based LVM physical volume:

  1. Unlock the LUKS volume:
cryptsetup luksOpen /dev/sda1 lvm
Sour‮www:ec‬.lautturi.com

This will unlock the LUKS volume on /dev/sda1 and map it to the device /dev/mapper/lvm.

  1. Activate the LVM volume group:
vgchange -ay

This will activate all the LVM volume groups on the system.

  1. Run fsck on the LVM logical volume:
fsck /dev/mapper/vg0-lv0

This will run fsck on the logical volume lv0 in the volume group vg0.

  1. When you are finished, close the LUKS volume and deactivate the LVM volume group:
cryptsetup luksClose lvm
vgchange -an
Created Time:2017-10-30 10:17:46  Author:lautturi