Filesystem checks on every boot

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Filesystem checks on every boot

Post by rdonnelly » Tue Dec 20, 2016 3:08 pm

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? :?:
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

FredW
Level 1
Level 1
Posts: 2
Joined: Thu Jul 06, 2017 10:44 am

Re: Filesystem checks on every boot

Post by FredW » Thu Jul 06, 2017 10:56 am

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.
:)

cecilieaux
Level 5
Level 5
Posts: 549
Joined: Mon Dec 09, 2013 9:43 am
Location: Washington, D.C.

Re: Filesystem checks on every boot

Post by cecilieaux » Mon Oct 30, 2017 10:59 am

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?
Every time I think I'm past newbiedom something like this happens.
Linux Mint 19.1 Tessa 64-bit

cecilieaux
Level 5
Level 5
Posts: 549
Joined: Mon Dec 09, 2013 9:43 am
Location: Washington, D.C.

Re: Filesystem checks on every boot

Post by cecilieaux » Mon Oct 30, 2017 11:01 am

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.
Every time I think I'm past newbiedom something like this happens.
Linux Mint 19.1 Tessa 64-bit

cecilieaux
Level 5
Level 5
Posts: 549
Joined: Mon Dec 09, 2013 9:43 am
Location: Washington, D.C.

Re: Filesystem checks on every boot

Post by cecilieaux » Mon Oct 30, 2017 11:11 am

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.
Every time I think I'm past newbiedom something like this happens.
Linux Mint 19.1 Tessa 64-bit

User avatar
greerd
Level 6
Level 6
Posts: 1055
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Filesystem checks on every boot

Post by greerd » Mon Oct 30, 2017 4:54 pm

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

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Filesystem checks on every boot

Post by rdonnelly » Mon Oct 30, 2017 6:10 pm

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?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

User avatar
greerd
Level 6
Level 6
Posts: 1055
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Filesystem checks on every boot

Post by greerd » Mon Oct 30, 2017 6:52 pm

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.

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Filesystem checks on every boot

Post by rdonnelly » Tue Oct 31, 2017 3:43 pm

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?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

User avatar
greerd
Level 6
Level 6
Posts: 1055
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Filesystem checks on every boot

Post by greerd » Tue Oct 31, 2017 4:21 pm

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.

Post Reply

Return to “Installation & Boot”