Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after updating to bookworm I see automount failures on SD card partitions and other things that should not be automounted #31

Open
ballle98 opened this issue Oct 23, 2024 · 1 comment · May be fixed by #33

Comments

@ballle98
Copy link

openhabian@openhabian:~ $ systemctl | grep fail
● [email protected]                                                                                                                  loaded failed failed    [email protected][email protected]                                                                                                                        loaded failed failed    [email protected][email protected]                                                                                                                       loaded failed failed    [email protected][email protected]                                                                                                              loaded failed failed    [email protected][email protected]                                                                                                                loaded failed failed    [email protected][email protected]                                                                                                                      loaded failed failed    [email protected][email protected]                                                                                                             loaded failed failed    [email protected][email protected]                                                                                                                       loaded failed failed    [email protected]

openhabian@openhabian:~/git/udev-media-automount $ systemctl status [email protected]
× [email protected]
     Loaded: loaded (/lib/systemd/system/[email protected]; static)
     Active: failed (Result: timeout) since Mon 2024-10-21 21:25:29 CDT; 19h ago
    Process: 608 ExecStart=/usr/bin/media-automount mmcblk0p1 (code=killed, signal=TERM)
        CPU: 32ms

Oct 21 21:23:38 openhabian systemd[1]: Starting [email protected]...
Oct 21 21:25:29 openhabian systemd[1]: [email protected]: start operation timed out. Terminating.
Oct 21 21:25:29 openhabian systemd[1]: [email protected]: Failed with result 'timeout'.
Oct 21 21:25:29 openhabian systemd[1]: Failed to start [email protected].

openhabian@openhabian:~/git/udev-media-automount $ mount | grep p1
/dev/mmcblk0p1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

openhabian@openhabian:/media/bootfs.vfat $ cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=8b550118-01  /boot/firmware  vfat    defaults          0       2
PARTUUID=8b550118-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
@ballle98 ballle98 changed the title after updating to bookwork I see automount failures on SD card partitions and other things that should not be automounted after updating to bookworm I see automount failures on SD card partitions and other things that should not be automounted Oct 23, 2024
ballle98 added a commit to ballle98/udev-media-automount that referenced this issue Jan 3, 2025
…ions and other things that should not be automounted

Fixes Ferk#31
@ballle98
Copy link
Author

ballle98 commented Jan 3, 2025

turned on some debug and the real problem was flock was not released because of long running ntfs child process holding FD 3

This was one of the jobs failing:

Jan 02 17:04:06 openhabian media-automount[596]: + [ mmcblk0p1 ]
Jan 02 17:04:06 openhabian media-automount[596]: + dev=/dev/mmcblk0p1
Jan 02 17:04:06 openhabian media-automount[636]: + findmnt -n -o SOURCE /
Jan 02 17:04:06 openhabian media-automount[596]: + [ /dev/mmcblk0p1 = /dev/mmcblk0p2 ]
Jan 02 17:04:06 openhabian media-automount[596]: + acquire_lock
Jan 02 17:04:06 openhabian media-automount[596]: + exec
Jan 02 17:04:06 openhabian media-automount[596]: + flock -x 3
Jan 02 17:05:56 openhabian systemd[1]: [email protected]: start operation timed out. Terminating.
Jan 02 17:05:56 openhabian systemd[1]: [email protected]: Failed with result 'timeout'.
Jan 02 17:05:56 openhabian systemd[1]: Failed to start [email protected].

The one that succeeded:

Jan 02 17:04:06 openhabian media-automount[712]: mounting device /dev/sda2 in /media/PICTURES.ntfs
Jan 02 17:04:06 openhabian media-automount[658]: + mkdir -p /media/PICTURES.ntfs
Jan 02 17:04:06 openhabian media-automount[658]: + mount -t ntfs-3g -o errors=remount-ro,relatime,utf8,users,flush /dev/sda2 /media/PICTURES.ntfs
Jan 02 17:04:07 openhabian ntfs-3g[805]: Version 2022.10.3 integrated FUSE 28
Jan 02 17:04:07 openhabian ntfs-3g[805]: Mounted /dev/sda2 (Read-Write, label "PICTURES", NTFS 3.1)
Jan 02 17:04:07 openhabian ntfs-3g[805]: Cmdline options: rw,relatime,noexec,nosuid,nodev,errors=remount-ro,utf8,flush,users
Jan 02 17:04:07 openhabian ntfs-3g[805]: Mount options: noexec,nosuid,nodev,errors=remount-ro,utf8,flush,users,allow_other,nonempty,relatime,rw,fsname=/dev/sda2,blkdev,blksize=4096
Jan 02 17:04:07 openhabian ntfs-3g[805]: Ownership and permissions disabled, configuration type 7
Jan 02 17:04:07 openhabian media-automount[808]: + ps au
Jan 02 17:04:07 openhabian media-automount[809]: + awk $11 ~ /^xinit/ { print $1; exit }
Jan 02 17:04:07 openhabian media-automount[658]: + username=
Jan 02 17:04:07 openhabian media-automount[658]: + [  ]
Jan 02 17:04:07 openhabian media-automount[658]: + log Device successfully mounted: /media/PICTURES.ntfs
Jan 02 17:04:07 openhabian media-automount[826]: + echo Device successfully mounted: /media/PICTURES.ntfs
Jan 02 17:04:07 openhabian media-automount[827]: + systemd-cat -p info -t media-automount
Jan 02 17:04:07 openhabian media-automount[827]: Device successfully mounted: /media/PICTURES.ntfs
Jan 02 17:04:07 openhabian media-automount[658]: + release_lock
Jan 02 17:04:07 openhabian media-automount[658]: + exec
Jan 02 17:04:07 openhabian media-automount[658]: + exit 0

flock not released:

[13:07:45] root@openhabian:~# lsof /var/run/media-automount.lock
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mount.ntf 805 root    3w   REG   0,21        0 1259 /run/media-automount.lock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant