You are not logged in.

#1 2012-09-05 17:10:31

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 258

[SOLVED] systemd-fsck prolongs boot time considerably

Hi folks, I've searched but come up blank on this one...

I've just migrated fully to systemd and all's working well apart from my boot hanging for around 16 seconds on fsck. Disabling the checks via the final column of fstab reduces my boot to under 9 seconds, which is roughly what it was with initscripts. Boot drive's an SSD, all other partitions on 2 SATA HDDs.

Here are the relevant parts of fstab

# /dev/sda3 - Backup
# =========   ------
UUID=7e23c7f4-acf6-477c-9705-15ae8870181e 	/media/Backup		ext4		defaults			0 2
#
# /dev/sdb2 - ROOT (+/home)
# =========   ------------
UUID=ee99e089-a642-41c8-b1f4-5dc80307d438	/			ext4		defaults,noatime,discard	0 1
#
# /dev/sdc1 - Data
# =========   ----
UUID=66c7a8dd-8d92-4353-a4eb-1da425449322 	/media/Data		ext4		defaults			0 2
#
# /dev/sdc2 - Scratch
# =========   -------
UUID=a8ca4753-ccca-4360-b702-8c12004bf8f8 	/media/Scratch		ext4		defaults,noatime		0 2
#
# /dev/sdc4 - bootISOs
# =========   --------
UUID=eea21a23-b3fa-479d-8a62-2502f4f9edfc 	/media/bootISOs		ext4		defaults,noatime		0 2

I do have /var on the "Data" partition and a few other relocations...

/media/Data/var		 /var					none	bind				0 0
/media/Data/logs	 /home/paul/.logs			none	bind				0 0
tmpfs			 /home/paul/.thumbnails			tmpfs	nodev,nosuid,noatime		0 0
tmpfs			 /home/paul/.Skype/Logs			tmpfs	nodev,nosuid,noatime		0 0
tmpfs			 /media/Data/wine/drive_c/windows/temp	tmpfs	nodev,nosuid,noatime		0 0

Without fsck

$ systemd-analyze
Startup finished in 1280ms (kernel) + 2220ms (initramfs) + 5112ms (userspace) = 8614ms

With fsck (typical)

$ systemd-analyze
Startup finished in 1276ms (kernel) + 3224ms (initramfs) + 20327ms (userspace) = 24829ms

Any ideas as to the slowdown or is this to be expected with this many partitions?

Thanks.

Last edited by fabertawe (2012-09-06 17:48:57)


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#2 2012-09-05 18:04:15

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] systemd-fsck prolongs boot time considerably

I'd say that initscripts ignore the sixth field (I've always had 0 there in my fstabs; both with initscripts and systemd my filesystems are checked when fsck is forced, they haven't been unmounted cleanly or days or mounts reach a set number, in case of ext). Perhaps those 1s and 2s make systemd run a forced fsck. You should see in journalctl if fsck is checking the filesystems or just reporting them as clean. You can also look at https://wiki.archlinux.org/index.php/Systemd#Automount

-edit-

Actually, my main filesystems have 1 in fstab. Well, see what you see in journalctl.

Last edited by lucke (2012-09-05 18:11:26)

Offline

#3 2012-09-05 21:41:16

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 258

Re: [SOLVED] systemd-fsck prolongs boot time considerably

Thanks for the feedback. I read somewhere that systemd honours the fstab but I just assumed it was in regards to fscking as normal or not at all.

As for journalctl, all I'm seeing are entries like this - "systemd-fsck[239]: Data: clean, 51550/17694720 files, 13102073/70778880 blocks". From what I've gathered elsewhere systemd-fsck has no progress indicator so I don't know what should be logged for a full check anyway. Someone please correct me if that's wrong though.

I'll force a fsck tomorrow when I've got more time and see what's reported.

Cheers.


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#4 2012-09-05 21:47:23

MatejLach
Member
From: United Kingdom
Registered: 2011-06-22
Posts: 309
Website

Re: [SOLVED] systemd-fsck prolongs boot time considerably

Exactly the same problem here, systemd is running fsck on every boot, but reporting it as clean - xfs


-
Everyone should read K&R C at least once in their lifetime.

Offline

#5 2012-09-05 21:54:49

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] systemd-fsck prolongs boot time considerably

systemd-fsck on ext4 reports "clean" when fsck didn't check the filesystem, and shows the fragmentation ("X% non-contiguous") when it did.

Offline

#6 2012-09-05 21:56:47

MatejLach
Member
From: United Kingdom
Registered: 2011-06-22
Posts: 309
Website

Re: [SOLVED] systemd-fsck prolongs boot time considerably

lucke wrote:

systemd-fsck on ext4 reports "clean" when fsck didn't check the filesystem, and shows the fragmentation ("X% non-contiguous") when it did.

Well, that it's certainly interesting that it spends around 3sec. on fsck on my system.


-
Everyone should read K&R C at least once in their lifetime.

Offline

#7 2012-09-06 08:32:48

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 258

Re: [SOLVED] systemd-fsck prolongs boot time considerably

Well... 'tune2fs -l | grep "ount count"' was showing all my partitions bar the boot drive had a maximum mount count of -1, therefore disabling fsck presumably. I reset all these to values under the actual mount counts and all the partitions were fscked on a reboot. There IS a progress indicator and it's recorded in the journal to this effect - "systemd-fsck[234]: Data has been mounted 59 times without being checked, check forced".

So back to my original (and still current) problem, that the boot sequence is stalling for around 16 seconds on the fsck check when no actual check is being carried out. Will keep investigating.

Edit: btw, all my partitions are ext4

Last edited by fabertawe (2012-09-06 08:34:01)


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#8 2012-09-06 08:56:04

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 812

Re: [SOLVED] systemd-fsck prolongs boot time considerably

You can try to mask "systemd-fsck-root.service" .  Then your root shouldn't be checked...
This is not a very good thing, but may be it can help you.

Offline

#9 2012-09-06 14:30:29

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 258

Re: [SOLVED] systemd-fsck prolongs boot time considerably

Root being checked isn't the problem, it's the other partitions that cause the delay. I'm still wondering if it's something to do with having /var on the "Data" partition.


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#10 2012-09-06 15:06:09

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,560

Re: [SOLVED] systemd-fsck prolongs boot time considerably

You can add "noauto,x-systemd.automount" to the options of non-essential partitions. That may speed up your boot time.

https://wiki.archlinux.org/index.php/Systemd#Automount


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#11 2012-09-06 15:50:52

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 258

Re: [SOLVED] systemd-fsck prolongs boot time considerably

WorMzy wrote:

You can add "noauto,x-systemd.automount" to the options of non-essential partitions. That may speed up your boot time.

Sorry, I should have mentioned I already tried this with the "Data" partition and just got a permanent hang in the boot sequence.

Edit: I've had 2 boots where it's not had the delay but I've no idea why, nothing was changed.

Edit2: Seems I was too quick to dismiss "noauto,x-systemd.automount"... I've applied it to all partitions except "Data" (and root, obviously) and now I'm consistently getting boot times under 9 seconds. Marking this thread as solved. Thanks to all who contributed smile

Last edited by fabertawe (2012-09-06 17:45:48)


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

Board footer

Powered by FluxBB