Page 2 of 2

Re: Filesystem checks on every boot

Posted: Tue Dec 20, 2016 3:08 pm
by rdonnelly
I think it might be up to the Ubuntu programmers to fix this, but who knows, maybe Mint can fix it and pass the code to Ubuntu just the same? :?:

Re: Filesystem checks on every boot

Posted: Thu Jul 06, 2017 10:56 am
by FredW
I had the same problem.
To get more information I looked in:
https://help.ubuntu.com/community/Fstab

My solution is, in Terminal do:
sudo nano -Bw /etc/fstab
move the cursor to the end of the line of the offending partition.
change 1 (number) to 0 (number).
Do so for all offending partitions (I had to change 9).
When ready do:
<ctrl> + X to Quit
Y to save backup.
leave Terminal.

I have no more filesystem checks.
I see the message only for a fraction of a second.
It took a while to find a solution, but I have found one.
:)

Re: Filesystem checks on every boot

Posted: Mon Oct 30, 2017 10:59 am
by cecilieaux
greerd wrote:
"Press Ctrl + C to cancel the filesystem check", on every boot. It's not normal, isnt it?
I haven't noticed that in a long long time, and it would only appear every 20 boot or so unless "sudo touch /forcefsck" was used to force fsck on the next boot.

What does sudo systemd-analyze blame say regarding systemd-fsck?
I have the same problem. I ran your command and this is what I got:

Code: Select all

$ sudo systemd-analyze blame
         10.945s apt-daily.service
         10.494s NetworkManager-wait-online.service
          5.188s dev-sda3.device
          3.228s ModemManager.service
          3.062s apt-daily-upgrade.service
          2.309s ufw.service
          2.235s lvm2-monitor.service
          2.155s NetworkManager.service
          2.153s networking.service
          1.741s virtualbox-guest-utils.service
          1.661s systemd-logind.service
          1.635s speech-dispatcher.service
          1.450s systemd-udevd.service
          1.220s colord.service
          1.131s console-kit-log-system-start.service
          1.112s thermald.service
          1.099s grub-common.service
          1.028s accounts-daemon.service
           976ms avahi-daemon.service
           920ms systemd-tmpfiles-setup-dev.service
           900ms keyboard-setup.service
           769ms systemd-fsck@dev-disk-by\x2duuid-3386ccb1\x2d0993\x2d4bcc\x2d81
           745ms systemd-tmpfiles-setup.service
           734ms systemd-fsck@dev-disk-by\x2duuid-4F87\x2dB9FA.service
           663ms ondemand.service
           647ms irqbalance.service
           646ms rsyslog.service
           643ms lm-sensors.service
           639ms loadcpufreq.service
           599ms binfmt-support.service
           599ms systemd-modules-load.service
           546ms wpa_supplicant.service
           486ms console-setup.service
           463ms systemd-journald.service
           367ms polkitd.service
           341ms dev-mqueue.mount
           339ms sys-kernel-debug.mount
           339ms dev-hugepages.mount
           318ms dns-clean.service
Seems to me that apt-daily.service and NetworkManager-wait-online.service ... whatever they are ... are the major delays. Are they what cause the check?

Re: Filesystem checks on every boot

Posted: Mon Oct 30, 2017 11:01 am
by cecilieaux
FredW wrote:I had the same problem.
My solution is, in Terminal do:
sudo nano -Bw /etc/fstab
move the cursor to the end of the line of the offending partition.
change 1 (number) to 0 (number).

I have no more filesystem checks.
:)
I have read that it should check every 30 times. Wouldn't 30 be more advisable? I am asking, I have no idea.

Re: Filesystem checks on every boot

Posted: Mon Oct 30, 2017 11:11 am
by cecilieaux
greerd wrote:sudo tune2fs -l /dev/sda1 | grep -i "check"
I ran it and I got

Code: Select all

tune2fs: Bad magic number in super-block while trying to open /dev/sda1
Couldn't find valid filesystem superblock.
Very weird ... !!! Sounds like I need to go to Hogwarts.

Re: Filesystem checks on every boot

Posted: Mon Oct 30, 2017 4:54 pm
by greerd
cecilieaux wrote:
greerd wrote:
"Press Ctrl + C to cancel the filesystem check", on every boot. It's not normal, isnt it?
I haven't noticed that in a long long time, and it would only appear every 20 boot or so unless "sudo touch /forcefsck" was used to force fsck on the next boot.

What does sudo systemd-analyze blame say regarding systemd-fsck?
I have the same problem. I ran your command and this is what I got:

...snip...

Seems to me that apt-daily.service and NetworkManager-wait-online.service ... whatever they are ... are the major delays. Are they what cause the check?
Perhaps this command would give a more usable result

Code: Select all

systemd-analyze critical-chain
cecilieaux wrote:
greerd wrote:sudo tune2fs -l /dev/sda1 | grep -i "check"
I ran it and I got

Code: Select all

tune2fs: Bad magic number in super-block while trying to open /dev/sda1
Couldn't find valid filesystem superblock.
Very weird ... !!! Sounds like I need to go to Hogwarts.
Can you give the output for

Code: Select all

lsblk -f

Re: Filesystem checks on every boot

Posted: Mon Oct 30, 2017 6:10 pm
by rdonnelly
As far as I can tell, it gives the message and boots right up, it does not seem it is doing the file check, unless my computer is super fast?

Re: Filesystem checks on every boot

Posted: Mon Oct 30, 2017 6:52 pm
by greerd
rdonnelly wrote:As far as I can tell, it gives the message and boots right up, it does not seem it is doing the file check, unless my computer is super fast?
I looked at the OP (I'd forgotten what the thread was about) and tried his command, it works great to determine if you have fschk enabled and boot count before a fschk is initiated but you must be root (sudo -i)(not just sudo), this is my output

Code: Select all

 ~ $ sudo -i
 
 ~ # for V in $(ls /dev/sd[a-c]?*);do if  $(blkid "$V" | grep -q ext); then echo -n  "$V  " ;tune2fs -l $V | egrep 'state|Mount\ \count|Maximum' ;fi;done
/dev/sda1  Filesystem state:         clean
Mount count:              4
Maximum mount count:      5
/dev/sda2  Filesystem state:         clean
Mount count:              28
Maximum mount count:      -1
/dev/sda3  Filesystem state:         clean
Mount count:              291
Maximum mount count:      -1
/dev/sda4  Filesystem state:         clean
Mount count:              724
Maximum mount count:      -1
/dev/sdb1  Filesystem state:         clean
Mount count:              9
Maximum mount count:      10
/dev/sdc1  Filesystem state:         clean
Mount count:              9
Maximum mount count:      10
greerd-dt ~ #
(-1 = never)
I see I didn't set my /home partition (sda4) to fschk every 5 boots (like my / partition sda1) so after

Code: Select all

sudo tune2fs -c5 /dev/sda4 

my output from the first command is

Code: Select all

for V in $(ls /dev/sd[a-c]?*);do if  $(blkid "$V" | grep -q ext); then echo -n  "$V  " ;tune2fs -l $V | egrep 'state|Mount\ \count|Maximum' ;fi;done
/dev/sda1  Filesystem state:         clean
Mount count:              4
Maximum mount count:      5
/dev/sda2  Filesystem state:         clean
Mount count:              28
Maximum mount count:      -1
/dev/sda3  Filesystem state:         clean
Mount count:              291
Maximum mount count:      -1
/dev/sda4  Filesystem state:         clean
Mount count:              724
Maximum mount count:      5
/dev/sdb1  Filesystem state:         clean
Mount count:              9
Maximum mount count:      10
/dev/sdc1  Filesystem state:         clean
Mount count:              9
Maximum mount count:      10
Note: Maximun count for my /dev/sda4 is now 5. The reason I use 5 instead of 20 or 30 is because I run a desktop 24/7 and don't reboot often. On a laptop 20 or 30 might be better boot counts before an fschk.

Re: Filesystem checks on every boot

Posted: Tue Oct 31, 2017 3:43 pm
by rdonnelly
I got the same -1, so that means no file checks ever?

I also use a desktop and used the command to do a check after every 5 mounts, should we do this for all the Linux partitions including home?

Re: Filesystem checks on every boot

Posted: Tue Oct 31, 2017 4:21 pm
by greerd
rdonnelly wrote:I got the same -1, so that means no file checks ever?

I also use a desktop and used the command to do a check after every 5 mounts, should we do this for all the Linux partitions including home?
If you're running Mint 18+ (systemd), I don't think one needs to worry about fsck as systemd-fsck-root.service does this quick check every boot on all /etc/fstab entries with a passno greater that zero. See man 8 systemd-fsck.

I set mine for every 5 boots on all my sda partions (ssd) and every 10 boots on my two other hdd's using the command in my previous post. It only takes a couple of seconds.