Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: How to run fsck manualy?

  1. #1
    Join Date
    Sep 2008
    Location
    Slovenia
    Posts
    335

    Default How to run fsck manualy?

    Hi everyone. I've experienced some strange crashes of kde 4.2 in suse 11.1 recently and would like to make sure my disks are ok, so from kde I switched to konsole with Alt+Ctr+F1, switched to root user, switched to runlevel 3 and tried to run fsck command, but it warned me that some partitions are still mounted, and that I can damage them if continuing with disk check, so I aborted the check. Now I don't know how to run the disk check safely, since I can not unmount the partition on which kernel runs. Any help is much appreciated. Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How to run fsck manualy?

    The most straightforward is to run the Repair System from the install media which will do a thorough check, including a fsck.

    If you can handle the CLI, you can boot to the Rescue Console from the install media, and issue the fsck commands yourself.

    If you are experienced you could boot single user and remount / ro, then do the fsck.

  3. #3
    Join Date
    Sep 2008
    Location
    Slovenia
    Posts
    335

    Default Re: How to run fsck manualy?

    Thanks ken_yap for pointing me the right way. I did select repair system from the installation dvd and nothing strange was reported, so I guess my disks are still healthy. However I did not like the repair system option very much, since I don't know what is that autorepairing do and how. Probably it does everything as it should and I don't need to worry about that, but still I and probably also someone else would like to know how to manually do disk check. My problem is solved, but despite that a good explanation for others having similar problem would be very helpful.

    So first I decided for the second option that ken_yap suggested, that is to boot from installation dvd and select Rescue option, which put me into comand line interface (CLI) and from there I tried to issue fsck command, but the result was that it printed out the version of fsck (V 1.41.11 or something) and did nothing, I saw no processing of my disks. I think this is very strange or it may be, that if the disks are ok, it doesn't say anything else but print the version number. But that didn't convince me, so I decided to try the third method. I rebooted pc and on the grub menu entered "1" (without quotes) and pressed enter, this put me in single user mode on run level 3, after root login I tried to remount all partitions with commands like
    Code:
    mount -o ro,remount /dev/sda1
    which worked on all partitions except on the one running the kernel, saying the partition was busy, and I was back at beginning of the story. Afterwards I decided to use autorepair option.

    I would be thankful if someone would briefly describe the correct way of doing fsck, or tell me which mistakes I made during my attempts. I'm not much experienced penguin yet, but am willing to learn Thanks for help again.

  4. #4

    Default Re: How to run fsck manualy?

    Additionally fsck should never be issued on a mounted partition. fsck should always be issued when the disk is offline (not mounted).

    By the way you don't issue fsck but fsck.<whatever filesystem you need to check>(x)

    So for example fsck.ext3
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How to run fsck manualy?

    @arcull

    You need to specify the partition to check as the argument, e.g. fsck /dev/sda1

    @BBR

    fsck will call fsck.filesystem after it has autodetected the type of filesystem on it. Generally works for Linux filesystem types.

  6. #6
    Join Date
    May 2009
    Location
    Jakarta, Beijing
    Posts
    77

    Default Re: How to run fsck manualy?

    Hi arcull,
    have you checked /var/log/messages
    for any smartd errors?

    You should find some info there if your hard drive is dying,

    "And just as you want men to do to you, you also do to them likewise."
    Luke 6:31 NKJV

  7. #7
    Join Date
    Jun 2008
    Location
    /dev/belgium
    Posts
    1,946

    Default Re: How to run fsck manualy?

    Quote Originally Posted by ken_yap View Post
    @arcull

    You need to specify the partition to check as the argument, e.g. fsck /dev/sda1

    @BBR

    fsck will call fsck.filesystem after it has autodetected the type of filesystem on it. Generally works for Linux filesystem types.
    except for XFS where one must call xfs_repair as fsck.xfs does nothing

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How to run fsck manualy?

    But if you forget that, fsck.xfs will remind you what to do. So one less thing to remember.

  9. #9
    Join Date
    Jun 2008
    Location
    /dev/belgium
    Posts
    1,946

    Default Re: How to run fsck manualy?

    fsck.xfs does nothing and always returns 0 (success) even if the FS needs repair

    fsck.xfs is called by the generic Linux fsck(8) program at startup to check and repair an XFS filesys-
    tem. XFS is a journaling filesystem and performs recovery at mount(8) time if necessary, so fsck.xfs
    simply exits with a zero exit status.

    If you wish to check the consistency of an XFS filesystem, or repair a damaged or corrupt XFS filesys-
    tem, see xfs_check(8) and xfs_repair(8).

  10. #10
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How to run fsck manualy?

    Read the shell script that /sbin/fsck.xfs is.

Page 1 of 3 123 LastLast

Posting Permissions

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