DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
fsck always force starts when I had planed to use the computer for something, so I want to abort it with Ctrl+C, and then later run it during a break or something.
Is it perfectly OK with you if you crash the file system and must reload the machine?
If not, the first question should be "why does it need to check the file system?"!
There is a setting on the partition that controls how often fsck is run. You can set this control by using the program tune2fs. The -c parameter sets the number of mounts to occur between file checks. You can turn off file checking entirely by setting -c to 0 or -1. So if you wanted the sda2 partition to be set to never be checked with fsck when no error has been detected on sda2 as root you would use:
tune2fs -c 0 /dev/sda2
If you wanted to set a file system to be checked by fsck only every 100 mounts when no error has been detected you would use:
If you move to EXT4 file systems you will find that a normal fsck rarely runs, and when it does it runs much faster.
Playing back journals into extents is really remarkably quick for the average case.
Exception: in the (hopefully rare) case that you have media failure issues (bad spots appearing on disk) it can take a long time, but is slightly more likely to recover. If you see such events it generally means it is time to invest in a new hard drive, and SOON.
There is a setting on the partition that controls how often fsck is run. You can set this control by using the program tune2fs. The -c parameter sets the number of mounts to occur between file checks. You can turn off file checking entirely by setting -c to 0 or -1. So if you wanted the sda2 partition to be set to never be checked with fsck when no error has been detected on sda2 as root you would use:
Is it a good idea to disable it altogether? Perhaps it has a reason to run
Quote:
Originally Posted by hydrurga
Let it run. If it's running, it's running for a reason - an error has been detected, unless it is a scheduled run as per post #4.
It always runs scheduled. just always at bad times
Quote:
Originally Posted by hydrurga
perhaps associated with the way you shut down the computer
I can make another thread about shutdowning
Quote:
Originally Posted by wpeckham
If you move to EXT4 file systems you will find that a normal fsck rarely runs, and when it does it runs much faster.
Playing back journals into extents is really remarkably quick for the average case.
But for an update I would need to make a backup
Quote:
Originally Posted by wpeckham
Exception: in the (hopefully rare) case that you have media failure issues (bad spots appearing on disk) it can take a long time, but is slightly more likely to recover. If you see such events it generally means it is time to invest in a new hard drive, and SOON.
Is it a good idea to disable it altogether? Perhaps it has a reason to run
I disabled it years ago. It seemed a waste of time. I still thing it is a waste of time to run fsck when there are no indications of errors in the file system.
I disabled it years ago. It seemed a waste of time. I still thing it is a waste of time to run fsck when there are no indications of errors in the file system.
------------------------
Steve Stites
According to man tune2fs:
Quote:
It is strongly recommended that either -c (mount-count-dependent) or -i (time-dependent) checking be enabled to force periodic full e2fsck(8) checking of the filesystem. Failure to do so may lead to filesystem corruption (due to bad disks, cables, memory, or kernel bugs) going unnoticed, ultimately resulting in data loss or corruption.
If during boot a mount command encounters a file system that was not unmounted cleanly at shutdown then the boot sequence runs fsck against that partition. I have had that happen occasionally, more frequently since systemd began controlling shutdowns, and fsck then runs at boot time and always clears the problem. I also have occasionally had an external drive not unmount cleanly causing the next mount to fail. In that case I run fsck manually against the external drive.
Running fsck occasionally against a cleanly mounted drive is supposed to fix errors that mount did not detect. I have never had that happen in seventeen years of Linux usage so I consider running fsck against a partition which has no reason to be suspected of errors to be a waste of time.
If during boot a mount command encounters a file system that was not unmounted cleanly at shutdown then the boot sequence runs fsck against that partition. I have had that happen occasionally, more frequently since systemd began controlling shutdowns, and fsck then runs at boot time and always clears the problem. I also have occasionally had an external drive not unmount cleanly causing the next mount to fail. In that case I run fsck manually against the external drive.
Running fsck occasionally against a cleanly mounted drive is supposed to fix errors that mount did not detect. I have never had that happen in seventeen years of Linux usage so I consider running fsck against a partition which has no reason to be suspected of errors to be a waste of time.
--------------------------
Steve Stites
Good. You're lucky. I'm glad. However the developers of ext4 wouldn't strongly recommend something unless they thought it worthwhile. I just wanted to point that out so that others could make informed decisions.
If it running on schedule bothers you, you can always set it to run on next boot and then reboot the machine. This resets the counter back so that your next SCHEDULED check would be 30 days out again.
Like the EXT4 developers (and every other file system developer I know) I would recommend scheduling a regular run. It does not have to be every 30 days. On SERVER class hardware every 60 or 120 days might be fine: depending upon the applications and use on that server.
Laptops are notoriously more prone to errors. Recent SSD storage may change that, but we have not had enough time with enough subject machines for a proper sampling.
FWIW, Red Hat no longer defaults to automatic scheduled fsck for filesystems, neither by time nor by mount count. Those automatic checks have a nasty habit of happening at awkward times ("I need to take the database server offline briefly for a quick reboot. OK?" ... "Oops!"). You can, of course, set up those automatic checks, but they are disabled by default when the filesystem is created.
Those automatic checks have a nasty habit of happening at awkward times ("I need to take the database server offline briefly for a quick reboot. OK?" ... "Oops!").
That is what I have been saying
So I wanted to watch a video during breakfast and my laptop is like "no, you have to watch fsck till your breakfast is finished". Or in a train that is late, trying to look up the hotel's check-in policies and then you only see the fsck, and end up having to pay a 80€ late fee.
A complete fsck of my laptop drive takes less than five minutes. What are you running on that takes fsck longer than breakfast? (Or do you eat VERY fast?)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.