Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: what's the terminal command to check a filesystem

  1. #1
    Join Date
    Jan 2008
    Location
    Ottawa, Canada
    Beans
    253

    what's the terminal command to check a filesystem

    I want to check hda1 for errors. What command do I use.

  2. #2
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: what's the terminal command to check a filesystem

    Quote Originally Posted by Raccoon1400 View Post
    I want to check hda1 for errors. What command do I use.
    fsck is the utility that will do this. However it must not be run on a mounted partition. The easiest option is to:
    Code:
    sudo touch /forcefsck
    This will create a 'forcefsck' file to be placed in the root directory and cause an fsck check on that partition during the next boot.
    Last edited by drs305; May 26th, 2008 at 08:17 PM. Reason: expanded

  3. #3
    Join Date
    Jan 2008
    Location
    Ottawa, Canada
    Beans
    253

    Re: what's the terminal command to check a filesystem

    What would I use to check the filesystem right now, from a different OS that doesn't mount that partition.

  4. #4
    Join Date
    Feb 2008
    Location
    Chicago Illinois
    Beans
    39
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: what's the terminal command to check a filesystem

    Sudo apt-get install BRAINS!

  5. #5
    Join Date
    Apr 2007
    Beans
    2,578
    Distro
    Ubuntu

    Re: what's the terminal command to check a filesystem

    The command in fact is fsck, but for any permanent drive, the tip of drs305 to "force" a check on the next boot is your safest bet.

  6. #6
    Join Date
    Jan 2007
    Beans
    6,542
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: what's the terminal command to check a filesystem

    Quote Originally Posted by Raccoon1400 View Post
    What would I use to check the filesystem right now, from a different OS that doesn't mount that partition.
    The LiveCD is handy for this. Boot up into it and run fsck.

    drs305's suggestion is probably quicker, though.

  7. #7
    Join Date
    Jan 2008
    Location
    Ottawa, Canada
    Beans
    253

    Re: what's the terminal command to check a filesystem

    The check using the first method failed. It told me to run fsck manually in recovery mode with the fs mounted read-only. How do I get recovery mode to mount hda1 as read-only?
    This is why it failed. http://ubuntuforums.org/showthread.php?t=807473

  8. #8
    Join Date
    Jul 2007
    Location
    UK
    Beans
    16,937
    Distro
    Ubuntu Development Release

    Re: what's the terminal command to check a filesystem

    Press esc when stage 1 grub loads. select the recovery mode.

    Then

    fsck -v /dev/xdax

    some people have sda1 others have hda1 etc

  9. #9
    Join Date
    Jan 2008
    Location
    Ottawa, Canada
    Beans
    253

    Re: what's the terminal command to check a filesystem

    I did the check and I think I may have fixed it. At least part of it.

  10. #10
    Join Date
    Jan 2008
    Location
    Ottawa, Canada
    Beans
    253

    Re: what's the terminal command to check a filesystem

    I need to do the same check on hardy, on the same machine, but recovery mode did not mount it as read-only.

Page 1 of 2 12 LastLast

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
  •