Thursday, March 21, 2013

Running fsck on LVM from single user mode OR from live CD


If an LVM of a server need manual fsck and the particular LVM partition is the root(/) of the server, then we need to boot the server into single user mode or from a live CD.

If we boot the machine to single user mode or to live CD, you can't see the LVM partitions on "fdisk -l" and so you can't run fsck on root(/). The reason is that, LVM partitions will not be activated on single user mode or in live CD by default, you need to activate it manually to do the fsck.

First run the command "lvdisplay" to see your LVM, if it's not showing any result try following commands to find out physical disk,volume group and logical partition where we are going to run fsck.

pvscan :Physical scanning of particular disk

vgscan :Volume group scanning

lvscan :Logical volume scanning

# lvscan
ACTIVE '/dev/VolGroup/LogVol00' [999.00 GiB] inherit

Now it is not activates then you need to activate the specific logical volume like this:

#lvchange -ay "yourLogicalVolume"

Then run "fdisk -l" and verify the LVM device is showing there

The final step:

Run the fsck on logical volume:

#e2fsck -y /YourLogicalVolume

No comments:

Post a Comment