LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Skipping e2fsck / fsck (https://www.linuxquestions.org/questions/debian-26/skipping-e2fsck-fsck-4175607289/)

BeniBela2 06-04-2017 03:39 PM

Skipping e2fsck / fsck
 
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.

But Ctrl+C does not cancel anymore.

I have a file /etc/e2fsck.conf

Code:

[options]
allow_cancellation = true

but it does not have any effect anymore.

Why?

wpeckham 06-04-2017 05:12 PM

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?"!

What kind of file system do you have?

BeniBela2 06-04-2017 05:29 PM

It says it does this fsck run every 30 days


> What kind of file system do you have?


ext3

jailbait 06-04-2017 06:50 PM

Quote:

Originally Posted by BeniBela2 (Post 5718996)
It says it does this fsck run every 30 days


> What kind of file system do you have?


ext3

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:

tune2fs -c 100 /dev/sda2

see:
man tune2fs

----------------------
Steve Stites

hydrurga 06-05-2017 12:44 AM

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.

If you're seeing this a lot, then you need to solve the underlying problem (perhaps associated with the way you shut down the computer).

wpeckham 06-05-2017 06:23 AM

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.

BeniBela2 06-05-2017 10:33 AM

Quote:

Originally Posted by jailbait (Post 5719020)
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 (Post 5719073)
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 (Post 5719073)
perhaps associated with the way you shut down the computer

I can make another thread about shutdowning

Quote:

Originally Posted by wpeckham (Post 5719137)
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 (Post 5719137)
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.

It never finds bad spots.

Although it never finishes :(

jailbait 06-05-2017 02:26 PM

Quote:

Originally Posted by BeniBela2 (Post 5719229)
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.

------------------------
Steve Stites

hydrurga 06-05-2017 02:34 PM

Quote:

Originally Posted by jailbait (Post 5719329)
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.

jailbait 06-05-2017 04:38 PM

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

hydrurga 06-05-2017 04:43 PM

Quote:

Originally Posted by jailbait (Post 5719388)
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.

wpeckham 06-05-2017 05:18 PM

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.

rknichols 06-05-2017 05:37 PM

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.

BeniBela2 06-06-2017 05:43 AM

Quote:

Originally Posted by rknichols (Post 5719425)
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.

wpeckham 06-06-2017 07:00 AM

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?)


All times are GMT -5. The time now is 11:05 PM.