How to fsck LVM Partition
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 15 of 15
  1. #1
    Join Date
    Jun 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to fsck LVM Partition

    How do I fsck a LVM partition?

  2. #2
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    5,073
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Filesystems on LVM logical volumes are fsck'ed just like filesystems on standard partitions.

  3. #3
    Join Date
    Oct 2005
    Posts
    1,952
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    Join Date
    Jun 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [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

  5. #5
    Join Date
    Mar 2004
    Location
    Central NY
    Age
    68
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  6. #6
    Join Date
    Jun 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dishawjp
    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.
    I did "touch /forcefsck" ad rebooted. Where do I look for the results?

    What arguments do I use with fsck.ext3

  7. #7
    Join Date
    Oct 2005
    Posts
    1,952
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you post the output of lvdisplay here (run as root)
    Desktop (64-bit) - F12, Debian Sid, OpenSUSE 11.2, ArchLinux

  8. #8
    Join Date
    Jun 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jongi
    can you post the output of lvdisplay here (run as root)
    [root@localhost ~]# lvdisplay
    --- 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

  9. #9
    Join Date
    Oct 2005
    Posts
    1,952
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  10. #10
    Join Date
    Jun 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jongi
    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.
    [root@localhost ~]# fsck.ext3 /dev/VolGroup00/LogVol00
    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.

  11. #11
    Join Date
    Jul 2005
    Location
    Ft Huachuca, AZ
    Posts
    3,781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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..

  12. #12
    Join Date
    Jun 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Iron_Mike
    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?

  13. #13
    Join Date
    Jul 2005
    Location
    Ft Huachuca, AZ
    Posts
    3,781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  14. #14
    mukund Guest
    I have an issue trying to umount my partitions in single user mode for doing a fsck. My lvdispaly is like this.

    --- 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
    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.

  15. #15
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    5,073
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't umount the / filesystem. If you need to fsck it, mount it read-only or use a liveCD or rescue disc.

Similar Threads

  1. fsck non-existent partition at boot
    By slybloty in forum Hardware & Laptops
    Replies: 0
    Last Post: 28th August 2008, 09:34 PM
  2. How to fsck a read-only partition?
    By rshum in forum Using Fedora
    Replies: 1
    Last Post: 24th May 2007, 07:09 PM
  3. fsck and LVM
    By Jongi in forum Using Fedora
    Replies: 1
    Last Post: 29th November 2006, 11:16 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •