User avatar
DougieLawson
Posts: 33850
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 7:04 am

There's some simple controls in the last two columns of the /etc/fstab entry. But nothing more than that.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 8:49 am

I wonder if fake-hwclock is the issue and everything just works fine with systemd-timesyncd (which should set the time in a similar way to fake-hwclock and then also sync through ntp).

If someone who can reliably reproduce the issue can disable fake-hwclock and check, that may give some hints.

User avatar
ksharindam
Posts: 72
Joined: Sat Jan 09, 2016 4:16 pm

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 9:35 am

Ok I shall disable fake-hwclock and check if that happens again.
My Qt projects at ... https://github.com/ksharindam

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 9:45 am

If you see it happening, could you please run 'systemd-analyze plot > something.svg' and upload it somewhere?

User avatar
ksharindam
Posts: 72
Joined: Sat Jan 09, 2016 4:16 pm

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 9:54 am

ShiftPlusOne wrote:
Thu Aug 30, 2018 9:45 am
If you see it happening, could you please run 'systemd-analyze plot > something.svg' and upload it somewhere?
I disabled fake-hwclock and the problem still exists.
Ok i shall run that command and upload the svg.

here is the journalctl log.

Code: Select all

sudo journalctl | grep -E "fsck|clock" 

Code: Select all

Nov 03 22:46:43 raspberrypi kernel: Kernel command line: bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait video=1368x768
Nov 03 22:46:43 raspberrypi kernel: clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
Nov 03 22:46:43 raspberrypi kernel: sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
Nov 03 22:46:43 raspberrypi kernel: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
Nov 03 22:46:43 raspberrypi kernel: clocksource: Switched to clocksource arch_sys_counter
Nov 03 22:46:43 raspberrypi systemd[1]: System time before build time, advancing clock.
Nov 03 22:46:43 raspberrypi systemd[1]: Listening on fsck to fsckd communication Socket.
Nov 03 22:46:43 raspberrypi systemd-fsck[88]: e2fsck 1.43.4 (31-Jan-2017)
Nov 03 22:46:43 raspberrypi systemd-fsck[88]: root: clean, 100086/283968 files, 745608/1153280 blocks
Nov 03 22:46:45 raspberrypi systemd-fsck[169]: e2fsck 1.43.4 (31-Jan-2017)
Nov 03 22:46:45 raspberrypi systemd-fsck[169]: Superblock last mount time is in the future.
Nov 03 22:46:45 raspberrypi systemd-fsck[169]:         (by less than a day, probably due to the hardware clock being incorrectly set)
Nov 03 22:46:45 raspberrypi systemd-fsck[169]: Superblock last write time (Thu Aug 30 15:12:45 2018,
Nov 03 22:46:45 raspberrypi systemd-fsck[169]:         now = Thu Nov  3 22:46:45 2016) is in the future.
Nov 03 22:46:45 raspberrypi systemd-fsck[169]: Fix? yes
Nov 03 22:46:45 raspberrypi systemd-fsck[169]: Pass 1: Checking inodes, blocks, and sizes
Nov 03 22:46:45 raspberrypi systemd-fsck[170]: fsck.fat 4.1 (2017-01-24)
Nov 03 22:46:45 raspberrypi systemd-fsck[170]: /dev/mmcblk0p1: 171 files, 44965/84272 clusters
Nov 03 22:46:47 raspberrypi systemd-fsck[169]: Pass 2: Checking directory structure
Nov 03 22:46:50 raspberrypi systemd-fsck[169]: Pass 3: Checking directory connectivity
Nov 03 22:46:50 raspberrypi systemd-fsck[169]: Pass 4: Checking reference counts
Nov 03 22:46:50 raspberrypi systemd-fsck[169]: Pass 5: Checking group summary information
Nov 03 22:46:51 raspberrypi systemd-fsck[169]: home: 44171/681408 files (2.0% non-contiguous), 2238758/2724352 blocks
Nov 03 22:46:51 raspberrypi systemd-timesyncd[226]: System clock time unset or jumped backwards, restoring from recorded timestamp: Thu 2018-08-30 15:11:52 IST
My Qt projects at ... https://github.com/ksharindam

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 10:05 am

Next thought is whether we can make fake-hwclock or systemd-timesyncd run before systemd-fsck

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 10:12 am

Another thing to try... create /etc/e2fsck.conf with the following:

Code: Select all

[options]
broken_system_clock=1

User avatar
ksharindam
Posts: 72
Joined: Sat Jan 09, 2016 4:16 pm

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 10:22 am

ShiftPlusOne wrote:
Thu Aug 30, 2018 10:12 am
Another thing to try... create /etc/e2fsck.conf with the following:

Code: Select all

[options]
broken_system_clock=1
I will also try that.
before doing that i shall enable fake-hwclock.

Btw, here is the plot svg file...
https://drive.google.com/open?id=1mEIYu ... 7uRcq1mGZS
My Qt projects at ... https://github.com/ksharindam

User avatar
ksharindam
Posts: 72
Joined: Sat Jan 09, 2016 4:16 pm

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 10:43 am

Wow ! it worked .
I created the /etc/e2fsck.conf file as you have said. And booted my raspberry multiple times.
It did not check filesystem.

Please add this fix to the next release of Raspbian.
Thanks.
My Qt projects at ... https://github.com/ksharindam

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 11:24 am

If it's not too much to ask, could you please try this alternative fix:
/etc/systemd/system/fake-hwclock.service.d/fsck.conf:

Code: Select all

[Unit]
Before=systemd-fsck-root.service
You'll need to create the directory.

The other is more of a hacky workaround, not something that would end up in the images.

User avatar
ksharindam
Posts: 72
Joined: Sat Jan 09, 2016 4:16 pm

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 1:27 pm

Yes it works.
fake-hwclock service is now run before fsck, that's what i wanted. And this solution is better than the previous.
My Qt projects at ... https://github.com/ksharindam

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 3:56 pm

I was going to open an upstream bug report against this, but am having trouble figuring out all the details to explain how to reproduce it.

If I run dumpe2fs /dev/mmcblk0p2 | less, the last write time is the time the pi thought it was when it booted and it doesn't get updated, so I never see the problem.

Any idea why that last write time field wouldn't get updated?

User avatar
ksharindam
Posts: 72
Joined: Sat Jan 09, 2016 4:16 pm

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Thu Aug 30, 2018 5:14 pm

Strange thing is that, when i enable fake-hwclock the last write time is Nov 3 2016.
But when i disable fake-hwclock the last write time it shows is Aug 30 2018.
My Qt projects at ... https://github.com/ksharindam

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Wed Sep 05, 2018 12:24 pm

I've filed an issue here: https://github.com/systemd/systemd/issues/10000

If that's fixed, we can ditch fake-hwclock and use timesyncd instead.

dawtyne10
Posts: 1
Joined: Fri Sep 07, 2018 12:47 am

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Fri Sep 07, 2018 12:58 am

@ShiftPlusOne @ksharindam

I was having the same issue on brand new install just today...

new rasp pi 3 board
new Samsung microSDHC EVO select 32gb
fresh install of raspbian stretch lite downloaded today

tried update... sudo apt-get update && sudo apt-get upgrade, still had issues

ended up going to localisation options and changed my timezone to match correct timezone instead of factory default and rebooted...

voila, no more disk check and raspbian boots up just fine... I have restarted about 10 times since changing to correct timezone and still working like it should (no disk check)

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5308
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Mon Sep 10, 2018 1:34 pm

dawtyne10 wrote: ended up going to localisation options and changed my timezone to match correct timezone instead of factory default and rebooted...
That doesn't quite address the root cause of the issue.
ShiftPlusOne wrote: I've filed an issue here: https://github.com/systemd/systemd/issues/10000
Looks like that didn't go anywhere. I'll add the fake-hwclock approach instead.

Edit: Sent the same report for fake-hwclock, in case they're interested in fixing it:
https://bugs.debian.org/cgi-bin/bugrepo ... bug=908504

vegz78
Posts: 7
Joined: Sat Jan 20, 2018 9:36 pm

Re: Raspbian Stretch 2017-11-29 performs always intensive disk check when booting w/o network.

Fri Sep 21, 2018 8:40 am

ShiftPlusOne wrote:
Thu Aug 30, 2018 11:24 am
If it's not too much to ask, could you please try this alternative fix:
/etc/systemd/system/fake-hwclock.service.d/fsck.conf:

Code: Select all

[Unit]
Before=systemd-fsck-root.service
You'll need to create the directory.

The other is more of a hacky workaround, not something that would end up in the images.
Thanks, ShiftPlusOne!

Finally solved this boot-fsck problem which has really been annoying and leaving me clueless for a long time now...

Br, Vegard

Return to “Raspbian”

Who is online

Users browsing this forum: Google [Bot] and 17 guests