LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-04-2017, 03:39 PM   #1
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Rep: Reputation: Disabled
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?
 
Old 06-04-2017, 05:12 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,597

Rep: Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691
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?
 
Old 06-04-2017, 05:29 PM   #3
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
It says it does this fsck run every 30 days


> What kind of file system do you have?


ext3
 
Old 06-04-2017, 06:50 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by BeniBela2 View Post
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

Last edited by jailbait; 06-04-2017 at 07:06 PM.
 
1 members found this post helpful.
Old 06-05-2017, 12:44 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
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).
 
Old 06-05-2017, 06:23 AM   #6
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,597

Rep: Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691
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.
 
1 members found this post helpful.
Old 06-05-2017, 10:33 AM   #7
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jailbait View Post
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 View Post
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 View Post
perhaps associated with the way you shut down the computer
I can make another thread about shutdowning

Quote:
Originally Posted by wpeckham View Post
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 View Post
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
 
Old 06-05-2017, 02:26 PM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by BeniBela2 View Post
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
 
Old 06-05-2017, 02:34 PM   #9
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by jailbait View Post
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.
 
Old 06-05-2017, 04:38 PM   #10
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
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
 
Old 06-05-2017, 04:43 PM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by jailbait View Post
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.
 
1 members found this post helpful.
Old 06-05-2017, 05:18 PM   #12
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,597

Rep: Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691
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.
 
Old 06-05-2017, 05:37 PM   #13
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
Old 06-06-2017, 05:43 AM   #14
BeniBela2
Member
 
Registered: Dec 2012
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
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.
 
Old 06-06-2017, 07:00 AM   #15
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,597

Rep: Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691Reputation: 2691
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?)
 
1 members found this post helpful.
  


Reply

Tags
fsck



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fsck = e2fsck? newbiesforever Linux - General 3 05-05-2011 12:28 PM
fsck (e2fsck) questions JohnE1 Linux - Server 4 08-15-2009 01:27 AM
fsck and e2fsck ygloo Linux - General 8 08-31-2006 02:19 PM
e2fsck and fsck.ext3 kpachopoulos Debian 4 02-09-2006 11:29 AM
fsck, e2fsck, mke2fs ?'s - RH9 blackx Linux - Newbie 6 05-23-2003 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration