You are not logged in.

#1 2023-11-27 20:41:40

musbur
Member
Registered: 2022-01-14
Posts: 46

I don't understand systemd automount.

Hello,

I noticed that systemd is trying to mount each and every partition it can find and seems to spend considerable time doing so. I'm booting this machine from a mobile USB3 disk /dev/sda, and /dev/sda2 is a LUKS container with a logical volume group which of course has been dealt with by initramfs. However, I find this in the journalctl logs:

Nov 27 21:08:59 jenna systemd[1]: Starting media-automount@sda2.service...
Nov 27 21:08:59 jenna media-automount[634]: mounting device /dev/sda2 in /media/sda2.crypto_LUKS
Nov 27 21:08:59 jenna media-automount[634]: <13>Nov 27 21:08:59 media-automount: mounting device /dev/sda2 in /media/sda2.crypto_LUKS
Nov 27 21:09:02 jenna media-automount[655]: Device /dev/mapper/_dev_sda2 does not exist or access denied.
Nov 27 21:09:02 jenna media-automount[870]: Command was : mount -t auto -o remount-ro,relatime,utf8,user,sync /dev/sda2 /media/sda2.crypto_LUKS
Nov 27 21:09:02 jenna media-automount[870]: <13>Nov 27 21:09:02 media-automount: Command was : mount -t auto -o remount-ro,relatime,utf8,user,sync /dev/sda2 /media/sda2.crypto_LUKS
Nov 27 21:09:02 jenna systemd[1]: media-automount@sda2.service: Control process exited, code=exited, status=1/FAILURE
Nov 27 21:09:02 jenna systemd[1]: media-automount@sda2.service: Failed with result 'exit-code'.
Nov 27 21:09:02 jenna systemd[1]: Failed to start media-automount@sda2.service.
Nov 27 21:09:02 jenna systemd[1]: media-automount@sda2.service: Consumed 6.844s CPU time.

Does this mean that systemd really burned almost seven seconds of CPU time trying to open a LUKS container it had no business of opening?

Another thing I noticed was /dev/sdb1. This happens to be a FAT formatted SD card inserted in my machine. Systemd tries to automount this but fails. Why? I can "sudo mount /dev/sdb1 /mnt" just fine from the prompt, with no extra options.

So the whole automounting thing seems pretty pointless: It tries to mount stuff it shouldn't, and doesn't mount stuff that might be helpful. I don't know which package this comes from; the logs start only on the day I installed pam_mount.

Nov 27 21:08:59 jenna systemd[1]: Starting media-automount@sdb1.service...
Nov 27 21:08:59 jenna media-automount[645]: mounting device /dev/sdb1 in /media/sdb1.vfat
Nov 27 21:08:59 jenna media-automount[645]: <13>Nov 27 21:08:59 media-automount: mounting device /dev/sdb1 in /media/sdb1.vfat
Nov 27 21:09:00 jenna media-automount[653]: mount: /media/sdb1.vfat: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error.
Nov 27 21:09:00 jenna kernel: FAT-fs (sdb1): Unrecognized mount option "remount-ro" or missing value
Nov 27 21:09:00 jenna media-automount[661]: Command was : mount -t auto -o remount-ro,relatime,utf8,user,flush,gid=100,dmask=000,fmask=111 /dev/sdb1 /media/sdb1.vfat
Nov 27 21:09:00 jenna media-automount[661]: <13>Nov 27 21:09:00 media-automount: Command was : mount -t auto -o remount-ro,relatime,utf8,user,flush,gid=100,dmask=000,fmask=111 /dev/sdb1 /media/sdb1.vfat
Nov 27 21:09:00 jenna systemd[1]: media-automount@sdb1.service: Control process exited, code=exited, status=1/FAILURE
Nov 27 21:09:00 jenna systemd[1]: media-automount@sdb1.service: Failed with result 'exit-code'.
Nov 27 21:09:00 jenna systemd[1]: Failed to start media-automount@sdb1.service.

Offline

#2 2023-11-27 21:24:50

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: I don't understand systemd automount.

musbur wrote:
Nov 27 21:08:59 jenna systemd[1]: Starting media-automount@sda2.service...

I might be wrong but I don't think that's part of systemd.

What does this say:

# pacman -Fy media-automount@.service

Offline

#3 2023-11-28 10:00:44

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,764

Offline

#4 2023-11-28 11:55:29

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,896
Website

Re: I don't understand systemd automount.

Mod note: Moving to AUR Issues.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB