15 novembre 2014

Running FSCK on an LVM (Logical Volume Manager) using Linux Rescue Disk

Yesterday I had a server crash and when I logged into the console it was showing a kernal panic!!
I rebooted and the same thing happened over on every reboot. This machine had some problems in the past with the disk going into read only mode so I assumed the issue was related to something wrong with the disk. So I grabbed a CentOS disk and booted up with it and booted into resuce mode and skipped the step that would mount the disks.

Once in I attempted to run fsck /dev/sda1 but I got an error back indicating it did not recognize the volume as EXT4. Searching around I found the following solution if you are using a LVM.
 Perform all of the following commands in the following order. I provided a link for each command if you are interested in knowing more about what each of the commands do.
Scan all disks for partitions: 
Scan all disks for volume groups and build /etc/lvmtab and /etc/lvmtab.d/* which are the database for all other lvm commands:
Change attributes of a logical volume
Scan all disks for logical volumes
Then I was able to run fsck as follows :

fsck -f /dev/VolGroup00/LogVol00

Aucun commentaire :

Enregistrer un commentaire