LINUX RESCUE – passar fsck em LVM

setembro 19, 2011 Deixe um comentário

1) Single User Mode and umount the file system

Issue command to change run level and umount the /home file system that is mounted on /dev/sda2

# init 1
# umount /home

Run fsck:

# fsck /dev/sda2

2) Rescue Mode using installation CD ( to run fsck on root /)

Insert the Installation CD into the drive and reboot your system:

# shutdown -r now

After booting from the Installation CD and presented with the installation command prompt type:

linux rescue nomount

Once you are at the system command prompt you need to run mknod. Because we started Rescue Mode with the “nomount” option, no file systems were initialized and no device files were created. If we try to run fsck on a file system it will fail. We need to use mknod to create the block or character special file.

To use mknod we need to know the Minor and Major numbers of the device.

# ls -l /dev/sda
8 0
# ls -l /dev/sda2
8 2

# mknod /dev/sda b 8 0
# mknod /dev/sda2 b 8 2

Run fsck and force the check and attempt to automatically repair:

-y — cause the fs-specific fsck to always attempt to fix any detected filesystem corruption automatically.

-f — force a check even if reported in a clean state

-v — Produce verbose output, including all file system-specific commands that are executed.

# fsck -yvf /dev/sda2

LVM Partitions

In order to be able to run fsck on lvm partitions we need to find the pv’s, vg’s, lv’s and activate them.

# lvm pvscan
# lvm vgscan
# lvm lvchange -ay /dev/VolGroup00/LogVol_home
# lvm lvscan

# fsck -yfv /dev/VolGroup00/LogVol_home