How do I fsck a LVM partition?
How do I fsck a LVM partition?
Filesystems on LVM logical volumes are fsck'ed just like filesystems on standard partitions.
However, make sure you fsck the path of the volume and not the actual physical partition.
So fsck.filesystem /dev/LV/lvol0 instead of fsck.filesystem /dev/hda1
Desktop (64-bit) - F12, Debian Sid, OpenSUSE 11.2, ArchLinux
[QUOTE=Jongi]However, make sure you fsck the path of the volume and not the actual physical partition.
So fsck.filesystem /dev/LV/lvol0 instead of fsck.filesystem /dev/hda1[/QUOTE
I tried that, but did not get the desired results:
[root@localhost ~]# fsck.filesystem /dev/LV/lvol0
-bash: fsck.filesystem: command not found
I am running FC5
The correct command would most likely be "fsck.ext3" depending on the filesystem you installed. Another way would be to give the command "touch /forcefsck" and reboot the computer.
Registered Linux User 294493
I did "touch /forcefsck" ad rebooted. Where do I look for the results?Originally Posted by dishawjp
What arguments do I use with fsck.ext3
can you post the output of lvdisplay here (run as root)
Desktop (64-bit) - F12, Debian Sid, OpenSUSE 11.2, ArchLinux
[root@localhost ~]# lvdisplayOriginally Posted by Jongi
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID MPTaTe-ceNT-x4Dg-8gxU-tER7-jiI0-u8pTdu
LV Write Access read/write
LV Status available
# open 1
LV Size 7.38 GB
Current LE 236
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID Cf6PIT-Mko0-1uPr-isQx-eqW4-Kec1-XDdEbo
LV Write Access read/write
LV Status available
# open 1
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1
Assuming those are ext3 partitions, you would do:
# fsck.ext3 /dev/VolGroup00/LogVol00
# fsck.ext3 /dev/VolGroup00/LogVol01
If there are errors the above should tell you what options you need to add. The below will likely work but could cause you loss of data:
# fsck.ext3 --rebuild-tree /dev/VolGroup00/LogVol00
# fsck.ext3 --rebuild-tree /dev/VolGroup00/LogVol01
If there are errors it could possibly be what fsck tells you to do.
Desktop (64-bit) - F12, Debian Sid, OpenSUSE 11.2, ArchLinux
[root@localhost ~]# fsck.ext3 /dev/VolGroup00/LogVol00Originally Posted by Jongi
e2fsck 1.38 (30-Jun-2005)
/dev/VolGroup00/LogVol00 is mounted.
WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.
Do you really want to continue (y/n)?
[[root@localhost ~]# fsck.ext3 /dev/VolGroup00/LogVol01
e2fsck 1.38 (30-Jun-2005)
/dev/VolGroup00/LogVol01 is mounted.
WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.
Here are the 2 partitions I run FSCK on these should be the same for you also. They are the:
" / " partition and the:
" /boot partition
Boot to runlevel 1 and type:
umount /
umount /boot
These will unmount the filesystems for the partitions. Then run:
fsck -f -p
This will perform a file system check on the partitions and automatically fix any errors encountered. But you need to use the "umount" option to unmount the filesystem before checking it..
How do I boot to run level 1? how do I know when I am at run level 1?Originally Posted by Iron_Mike
Let it boot normally, then open a terminal window and change to the root user, using:
su -
that is (su dash). In the terminal window type:
init 1
Now you are in single user mode and can run the commands. There is another way also, during bootup, when it shows which kernel is booting, tap the space, now your at thegrub menu, scroll down to the middle line and press the letter "e" this will put you in edit mode, then append the number 1 to the end of the line, then press the letter "b" to boot, then you will be in single user mode.
I have an issue trying to umount my partitions in single user mode for doing a fsck. My lvdispaly is like this.
I get a filesystem busy error when I try to umount / in single user mode. If I try the lazy option, I get a fsck swap error after a bit.--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID PhpEtZ-Zz6g-w7Z3-wJ6j-7Icn-Wg7v-goKsIC
LV Write Access read/write
LV Status available
# open 1
LV Size 109.16 GB
Current LE 3493
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID x0pdTP-OJOT-fbCv-x2fK-e609-No3w-N3mr5H
LV Write Access read/write
LV Status available
# open 1
LV Size 1.94 GB
Current LE 62
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1
![]()
You can't umount the / filesystem. If you need to fsck it, mount it read-only or use a liveCD or rescue disc.