Results 1 to 9 of 9

Thread: How to run fsck?

  1. #1
    oxf is offline Extra Foam Sugar Free Ubuntu
    Join Date
    May 2009
    Location
    Oxfordshire, UK
    Beans
    Hidden!
    Distro
    Lubuntu 13.04 Raring Ringtail

    How to run fsck?

    OK its not a good idea to run fsck on a mounted file system.
    But.. if I want to check the file system between the default checks on boot up how should I safely do it? How do I safely run fsck?
    Thanks

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to run fsck?

    Must be unmounted:
    Try "e2fsck -f /dev/sdb2". Ordinarily, fsck skips most of the check if the filesystem is marked as clean. The "-f" option to e2fsck (note: e2fsck, not fsck) forces a full check even if the filesystem is marked as clean.

    From liveCD so everything is unmounted
    sudo e2fsck -C0 -p -f -v /dev/sdb1
    if errors:
    sudo e2fsck -f -y -v /dev/sdb1
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    oxf is offline Extra Foam Sugar Free Ubuntu
    Join Date
    May 2009
    Location
    Oxfordshire, UK
    Beans
    Hidden!
    Distro
    Lubuntu 13.04 Raring Ringtail

    Re: How to run fsck?

    Quote Originally Posted by oldfred View Post
    Must be unmounted:
    Try "e2fsck -f /dev/sdb2". Ordinarily, fsck skips most of the check if the filesystem is marked as clean. The "-f" option to e2fsck (note: e2fsck, not fsck) forces a full check even if the filesystem is marked as clean.

    From liveCD so everything is unmounted
    sudo e2fsck -C0 -p -f -v /dev/sdb1
    if errors:
    sudo e2fsck -f -y -v /dev/sdb1
    OK thanks, so I boot from the live CD. So there's no safe way to do it otherwise then, like recovery mode?

  4. #4
    Join Date
    Jan 2010
    Location
    Portland, Oregon
    Beans
    525
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: How to run fsck?

    Quote Originally Posted by oxf View Post
    OK its not a good idea to run fsck on a mounted file system.
    But.. if I want to check the file system between the default checks on boot up how should I safely do it? How do I safely run fsck?
    Thanks
    If you can mount the disk in question as read-only then you run fsck on it. But a system disk cannot be run read-only; lots of stuff gets written to it and you can't control most of those things: locks and logs and /tmp come to mind.

    The safe way to do fsck is to run from a different device than what you want to check. Live CD, removable hard disk, USB flash drive are some possibilities.

    quadproc

  5. #5
    Join Date
    Dec 2009
    Beans
    5,685

    Re: How to run fsck?

    You can force a check of your root filesystem by issuing the following command in a terminal and rebooting:

    Code:
    sudo touch /forcefsck
    EDIT: Sorry I should have noted that this will also reset the 30-mount count.
    Last edited by Morbius1; June 13th, 2010 at 12:28 AM.

  6. #6
    oxf is offline Extra Foam Sugar Free Ubuntu
    Join Date
    May 2009
    Location
    Oxfordshire, UK
    Beans
    Hidden!
    Distro
    Lubuntu 13.04 Raring Ringtail

    Re: How to run fsck?

    OK thanks all!
    So I could also add -c to the forced check?
    i.e /forcefsck -c

  7. #7
    Join Date
    Dec 2009
    Beans
    5,685

    Re: How to run fsck?

    Quote Originally Posted by oxf View Post
    So I could also add -c to the forced check?
    i.e /forcefsck -c
    I have never used that option with /forcefsck nor have I ever seen that in any documentation. So If I had to wager my money I would say, no. The only thing that touch /forcefsck is doing is creating a file.
    Last edited by Morbius1; June 13th, 2010 at 12:48 AM.

  8. #8
    oxf is offline Extra Foam Sugar Free Ubuntu
    Join Date
    May 2009
    Location
    Oxfordshire, UK
    Beans
    Hidden!
    Distro
    Lubuntu 13.04 Raring Ringtail

    Re: How to run fsck?

    Quote Originally Posted by Morbius1 View Post
    I have never used that option with /forcefsck nor have I ever seen that in any documentation. So If I had to wager my money I would say, no.
    OK. I used it when I couldn't mount the file system but maybe not from force then
    thanks..

  9. #9
    Join Date
    Jul 2007
    Location
    Nashville TN
    Beans
    133
    Distro
    Ubuntu 15.10 Wily Werewolf

    Re: How to run fsck?

    This might be a cop-out, but...
    fsck --help
    man fsck
    q to quit. I always forget...

Bookmarks

Posting Permissions

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