1751836 Members
5224 Online
108782 Solutions
New Discussion юеВ

Re: root lvm corrupted

 
avizen9
Esteemed Contributor

root lvm corrupted

Hello friends,

i am having system which configured with Lvm, somehow it has not shutdown properly and root file system has corrupted which is in lvm.

the root file system is /dev/mapper/VolGroup00-LogVol00 /root

when start it throw error /dev/mapper/VolGroup00-LogVol00 corrupted do fource fsck for this,
how we can do fsck for this and make it work.

Os= Enterprise Linux WS release 4

9 REPLIES 9
Nuwan Alwis
Valued Contributor

Re: root lvm corrupted

Hi Avizen,
1. Do not ever run forced FSCK on a mounted file system.

2. Yes if it is a minor error fsck-ext3 will help you out most of the time.

use install medial and boot this system to emergency mode.(type linux emergency on the splash screen prompt) this will bring the system up and by default it will not mount any file systems on fstab.
This is the safest way that you can fsck.

Good Luck...!




avizen9
Esteemed Contributor

Re: root lvm corrupted

so only fsck-ext3 will ok or we need to provide full path?

fsck-ext3 /dev/hda etc...
Nuwan Alwis
Valued Contributor

Re: root lvm corrupted

Hi,
Yes, it should.
my recomendation is first just run the fsck-ext3 and see if it works.
fsck -p was a good option for me when i had these kind of problems.

any way its good to have a copy of /etc/lvm/*

Good Luck..!
Ivan Ferreira
Honored Contributor

Re: root lvm corrupted

You don't need the installation media, you can just boot in emergency mode. As long the file system is mounted in read only mode, you have no risks.

Boot appending the "emergency" option in GRUB.

If you boot with the installation media, don't run fsck to the partition, you must activate the LVM volume group and run fsck to the logical volume.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Sajjad Sahir
Honored Contributor

Re: root lvm corrupted

Dear Avizen

I believe that you can do this in Linux rescue from your OS install disk if LVM is supported.

Once Knoppix is booted, open a command prompt and type the following.

# lvm vgchange --ignorelockingfailure -P -a y

This will make this LVM volumes available. See the lvm(8) - Linux man page for a description of these switches.

Then type

# lvm lvs
to display the logical volumes.

The devices should be listed in /dev ie: /dev/VolGroup00/LogVol100.

At this point you should be able to run fsck on the logical volume by typing the following with your logical volume name of course.

# fsck /dev/VolGroup00/LogVol100
Remember to always shutdown Linux properly so that the file systems don├в t get corrupted.

Use something like

shutdown -h now

skt_skt
Honored Contributor

Re: root lvm corrupted

Go to rescue mode using the RHEL installation CD with the boot option:

linux rescue

if vg00 not getting mounted automaically.

2.Try to activate the volume groups by running the commands below:

lvmdiskscan
vgchange -ay

3.If vg00 is acitaved Further fsck test can be done using:

tune2fs -l /dev/vg00/lv01 | grep Block

Take note of the Block size.

e2fsck -b -n /dev/vg00/lv01
avizen9
Esteemed Contributor

Re: root lvm corrupted

thanks
skt_skt
Honored Contributor

Re: root lvm corrupted

what worked for u?
avizen9
Esteemed Contributor

Re: root lvm corrupted


# lvm vgchange --ignorelockingfailure -P -a y

# fsck /dev/VolGroup00/LogVol100