[solved] No more filesystem checks

Archived topics about LMDE 1 and LMDE 2
jack.herbert

[solved] No more filesystem checks

Post by jack.herbert »

I installed LMDE a few months ago (moving on from the main edition).

During the installation process, I set all my partitions (home, storage, Windows ...) to mount automatically.
Since that, I've never had a routine file system check for any of those partitions (and I did boot way more than 30 times)

Just as much as I hate having to wait 15 minutes when my 600gb storage partition gets scanned, I still feel that I should do something about it.
I could try to do it manually (meaning having to learn how to unmount discs from the command line, gee!), but ultimately, I'd rather have it do it's own thing like it used to with the main edition.

Any ideas?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
slider
Level 5
Level 5
Posts: 579
Joined: Wed May 07, 2008 2:08 pm
Location: Sliding around somewhere!

Re: No more filesystem checks

Post by slider »

If you are refering to the "forced checks" at boot time, this was handled by tune2fs on ext2/ext3 file systems. I believe it is still used on ext4 if my memory serves me correctly, although I haven't tried it on that yet. Take a look at man tune2fs. i have always used it to change things to the behavior that I wanted.

Command to show the current and maximum mount counts. Where yyyy is the partition you want to check:

Code: Select all

sudo tune2fs -l /dev/yyyy | grep -i "mount count"
Eg: sudo tune2fs -l /dev/sda1 | grep -i "mount count"

Command to change the actual mount count, where xxx is the new maximum count and yyyy is the partition that you want to change:

Code: Select all

sudo tune2fs -c xxx /dev/yyyy
Eg: sudo tune2fs -c 100 /dev/sda1 would change the maximum mount count to 100 on device partition sda1.

The man page will give you all of the available options.

Hope this helps....
"In the beginning of a change the patriot is a scarce man, brave and hated and scorned. When his cause succeeds the timid join him for then it costs nothing to be a patriot."
Mark Twain
jack.herbert

Re: No more filesystem checks

Post by jack.herbert »

Cheers slider,
312 mounts since last check :)
I did tune2fs -l without the grep and realised that the check interval was set to 6 months.
I can't but wonder:
Did I mess something up or is that the default setting for LMDE? Is it "dangerous" for users who don't know about it?
At least I'll be fine now. Thanks again
amina

Re: [solved] No more filesystem checks

Post by amina »

Hi, just checked mine.
Check interval is 6 months but I do not think that matters because I regularly have forced checks (my problem is rather how I can skip them in case I am in a hurry. Unlike Ubuntu it does not offer me to press C though maybe I could try to do so :D).
My mount count is 14 at the moment and the maximum mount count is 20 which I think the default is for LMDE.
slider
Level 5
Level 5
Posts: 579
Joined: Wed May 07, 2008 2:08 pm
Location: Sliding around somewhere!

Re: [solved] No more filesystem checks

Post by slider »

Hi everyone

Let me clear up a few things here that might seem confusing.

First:] When we ask you to read the man page(s) we are referring to the Linux Programmers Manual pages. They are most easily accessed by using your terminal (although there have been a few programs over the years such as xman, etc, that have provided a GUI). Typing man program_name will usually bring up the program manual in question. We ask you to do this for very good reasons.
1- So that you can learn your way around Linux.

2- So that you can actually learn what command syntax are and what they can do, instead of just blindly typing in commands that you are given. This can be dangerous if the person helping you gets things wrong, and is why we all must be really careful when helping other users. Besides if you do a little reading you may find a better way that fits your situation with a slightly different command, just as jack.herbert did by dropping the "grep".

3- We want to make an effort to try and familiarize and help you feel more comfortable when using the terminal. Remember that the terminal is your friend and greatest, most powerful tool. On a Linux computer it is "The Force". Learning to use it properly can only make you more powerful as a user.


Second:] For as resetting parameters for file system checks, this needs to be done with some care and understanding, hence the man page is an important read.



Let me try to answer some of the questions posted here.
check interval was set to 6 months
I believe that this is a default setting. Remember that the system is checked in two different ways:
1- By mount count. (what we did before)
2- By a time period.

The 6 months can be changed by using the -i flag. Eg: sudo tune2fs -i 1m /dev/sda1 which would change the time check interval to one month.

Things can also be changed in fstab, but I will not get into that mod here as it is dangerous, if the user forgets to make manual checks or set a cron job to do it. That should be in a different thread by itself.
Is it "dangerous" for users who don't know about it?
Let me quote the man page:
Adjust the number of mounts after which the filesystem will be checked by e2fsck(8). If max-mount-counts
is 0 or -1, the number of times the filesystem is mounted will be disregarded by e2fsck(8) and the kernel.

Staggering the mount-counts at which filesystems are forcibly checked will avoid all filesystems being
checked at one time when using journaled filesystems.

You should strongly consider the consequences of disabling mount-count-dependent checking entirely. Bad
disk drives, cables, memory, and kernel bugs could all corrupt a filesystem without marking the filesystem
dirty or in error. If you are using journaling on your filesystem, your filesystem will never be marked
dirty, so it will not normally be checked. A filesystem error detected by the kernel will still force an
fsck on the next reboot, but it may already be too late to prevent data loss at that point.
Enough said.

I regularly have forced checks (my problem is rather how I can skip them in case I am in a hurry. Unlike Ubuntu it does not offer me to press C though maybe I could try to do so


You could try that or Ctrl + C , but just pressing Esc used to postpone/skip the check (in Ubuntu base systems) and go ahead straight to boot. Maybe try that as well, although it may not work on Debian base. Although I have never had to do this, supposedly adding the right line to /etc/e2fsck.conf will modify a system that does not allow the check to be postponed, to where it will allow it after the mod. I can not remember what line to add, so I would have to research that or check my notes.


Again, to everyone making any modifications to this, PLEASE read and understand the related man page.




@jack.herbert

I'm glad that you got it set like you want it. Good job! :)
"In the beginning of a change the patriot is a scarce man, brave and hated and scorned. When his cause succeeds the timid join him for then it costs nothing to be a patriot."
Mark Twain
amina

Re: [solved] No more filesystem checks

Post by amina »

@slider,

while I appreciate your efforts, I do not really understand why this post have been aimed at us :) I think nobody complained about having to use the terminal, the OP already marked the thread as solved and I just posted to share the LMDE defaults (I surely did not modify anything in these settings neither want to).

OFF
By the way, I have no problem with the terminal and often check man pages but their usefulness can highly depend on the previous experience level of the user. Of course the only way to improve this is to read more of them and I am not against them by any means. What I mean if someone has a question about something you think is clearly described on the man page, does not mean it is clear enough for someone not (yet) familiar enough with the terminal/man pages/syntax conventions. This is just my personal opinion on the subject, not related to this topic :)
amina

Re: [solved] No more filesystem checks

Post by amina »

And thank you for the suggestions on postponing the check, I was not aware of Esc also being an option. Next time I will try.
jack.herbert

Re: [solved] No more filesystem checks

Post by jack.herbert »

Yo guys,
Double checking things, I realised that my max-mount count was already set to 35, which means (after 314 mounts) that tune2fs isn't doing its job.
I doubt that setting checks now to one month will change anything but we'll see.

Funnily enough, I posted here in the first place because of this exact same bit form the man page
You should strongly consider the consequences of disabling mount-count-dependent checking entirely. Bad
disk drives, cables, memory, and kernel bugs could all corrupt a filesystem without marking the filesystem
dirty or in error.
But amina is getting forced checks so I must have messed something up. Damn.
oh well, at least we've learned that as long as I don't go around other users houses and play with their installs, it is not "dangerous".
slider
Level 5
Level 5
Posts: 579
Joined: Wed May 07, 2008 2:08 pm
Location: Sliding around somewhere!

Re: [solved] No more filesystem checks

Post by slider »

Hi jack.herbert

Try this test if you want.

Temporarily reset your max-mount-counts to 1 and restart your system. You may need to restart twice.

Please let us know your results if you do this, and if things are successful don't forget to reset them back more to your liking.

:)
"In the beginning of a change the patriot is a scarce man, brave and hated and scorned. When his cause succeeds the timid join him for then it costs nothing to be a patriot."
Mark Twain
slider
Level 5
Level 5
Posts: 579
Joined: Wed May 07, 2008 2:08 pm
Location: Sliding around somewhere!

Re: [solved] No more filesystem checks

Post by slider »

@amina
I do not really understand why this post have been aimed at us
It wasn't in particular. Please remember that we address a much larger world wide web audience. A whole lot of users will come here and read topics for help, some members, some not, but regardless I believe that we all have a responsibility to try and help them as best as we can. I try to consider this when I post to help users here. My apologies if I came off any other way than being helpful.
I think nobody complained
Very true, but this ties in with the above answer. Had someone complained I simply would have not posted. Linux is about choice not force.
OP already marked the thread as solved and I just posted to share the LMDE defaults (I surely did not modify anything in these settings neither want to)
This is the same reason that I posted as well. It is perfectly OK to post in a solved topic in this case as you did, mainly because you added valuable info and your experience. This in my opinion added value to the thread. This is not thread hi-jacking. That would be like asking a question in another users thread/topic, etc.
By the way, I have no problem with the terminal and often check man pages but their usefulness can highly depend on the previous experience level of the user.
I could not agree with you more. We all struggle with this in one way or another, as we all, no matter what level, are still learning.
Of course the only way to improve this is to read more of them and I am not against them by any means.
Exactly my reason for posting encouragement to this means.
What I mean if someone has a question about something you think is clearly described on the man page, does not mean it is clear enough for someone not (yet) familiar enough with the terminal/man pages/syntax conventions.
Again, the reason for making that post.
This is just my personal opinion on the subject, not related to this topic
Amina, I thank you for posting and expressing your opinion in this thread. I feel that you have added additional value to it and that will help the users.

I did not post this earlier when I made the last post to jack.herbert, because I felt that I needed to think about what I wanted to say. I know sometimes reading text can be misleading to what a person is really trying to say. At least it is for me, but I thought that I would give it my best shot anyway and hope that I was clear from the heart.

Kind Regards,
S :)
"In the beginning of a change the patriot is a scarce man, brave and hated and scorned. When his cause succeeds the timid join him for then it costs nothing to be a patriot."
Mark Twain
amina

Re: [solved] No more filesystem checks

Post by amina »

slider,

I meant no offense, just was surprised about your reaction. Now I see your point :)
Thank you for taking the time to help and also to clarify the misunderstandings.

cheers,
amina
jack.herbert

Re: [solved] No more filesystem checks

Post by jack.herbert »

Right, i did change the max-count to one and after a few reboots, it's definitely not checking it.
Maybe I have disabled tune2fs by mistake. Can that happen?
Also, when I boot I noticed something about dev, mounting and checks but I never have time to read it. Do you know in which log file does the booting procedure get recorded?
slider
Level 5
Level 5
Posts: 579
Joined: Wed May 07, 2008 2:08 pm
Location: Sliding around somewhere!

Re: [solved] No more filesystem checks

Post by slider »

@ jack.herbert
Right, i did change the max-count to one and after a few reboots, it's definitely not checking it.
It could be that I told you wrong my friend. I remembered, I thought that 0 caused the file system to be disregarded, but it appears that 1 will also do the same? :oops: I really should follow my own advice better instead of relying on my memory at times. :oops:

Lets test it this way.

Reset the max-mount-count to say 30, then Change the c in the command to a C (capital) and set the number value higher than whatever you have set the max-mount-count to. This should make it do a check at next reboot.

Check in /var/log/fsck and look for checkfs and checkroot. The latter should let you see the last time it was checked, which is what the CLI reads from. Make a note of the date/times of these files before you run this new test please and then compare the two results later.

In /var/log you should find most of your system logs such as a boot, syslog, apt, and many others in their appropriate directories.

Running dmesg right after boot may show you some info as well, but try the test.

Hope this helps better this time! :)
"In the beginning of a change the patriot is a scarce man, brave and hated and scorned. When his cause succeeds the timid join him for then it costs nothing to be a patriot."
Mark Twain
jack.herbert

Re: No more filesystem checks

Post by jack.herbert »

Yo!
did the test (set max mount count to 30 then set current mount count to 35) and nothing happened.
I had a look in syslog (boot was empty) and here's the bit about mounting my partitions:
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on sda10, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
fuse init (API version 7.13)
EXT4-fs (sda8): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (sda8): mounted filesystem with ordered data mode
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on sda9, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on sda6, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on sda7, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
So running e2fsck is recommended but doesn't happen automatically. *forehead-scratch*
doktordave

Re: [solved] No more filesystem checks

Post by doktordave »

Something like this came up a good while back, when LMDE first came out. I can't remember the name of the thread, but it has to do with fstab.

A typical fstab entry may look like this:

/dev/hda1 / ext3 defaults 1 1
/dev/hdb1 /home ext3 defaults 1 2

The 6th column (in bold) is a fsck option.
  • 0 = Do not check.
  • 1 = First file system (partition) to check;
    / (root partition) should be set to 1
  • 2 = ALL OTHER file systems to be checked.
Have a look at /etc/fstab. If the number in the last column is 0, it doesn't get checked.
jack.herbert

Re: No more filesystem checks

Post by jack.herbert »

Woa, cheers doktordave,
All my lines in fstab end with 0.
I also noticed that I have two different partitions mounted as /
Somehow I suspect that's a bad thing :(
gorillaki

Re: [solved] No more filesystem checks

Post by gorillaki »

Most likely you can't read your fstab properly. You cannot have two root partitions on your box, unless you run multiple linux distros.
jack.herbert

Re: [solved] No more filesystem checks

Post by jack.herbert »

Turns out the first of the two / was a UUID and it was unresolved at boot so I deleted it.

All my partitions have been checked and that is swell!
Once again, mint forum came to the rescue, thanks guys!
slider
Level 5
Level 5
Posts: 579
Joined: Wed May 07, 2008 2:08 pm
Location: Sliding around somewhere!

Re: [solved] No more filesystem checks

Post by slider »

jack.herbert

I've been waiting for you to complete the test! docktordave stole my thunder LOL! Glad you got it anyway! :D

I was saving this part for last.

The usual fix:

Edit your /etc/fstab with partition that has / where the sixth field has a 1 as shown in red in the example:

Eg: ext3 relatime,errors=remount-ro 0 1

See man fstab for more info! :)
"In the beginning of a change the patriot is a scarce man, brave and hated and scorned. When his cause succeeds the timid join him for then it costs nothing to be a patriot."
Mark Twain
doktordave

Re: [solved] No more filesystem checks

Post by doktordave »

Sorry 'bout that, slider... :)

Glad it helped some folks out.
Locked

Return to “LMDE Archive”