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

media-automount ignores devices if their label matches mount point in fstab #25

Open
lmoellendorf opened this issue Mar 25, 2024 · 0 comments · May be fixed by #26
Open

media-automount ignores devices if their label matches mount point in fstab #25

lmoellendorf opened this issue Mar 25, 2024 · 0 comments · May be fixed by #26

Comments

@lmoellendorf
Copy link

Steps to reproduce

  1. Format an USB thumb drive and set volume name:
mkfs.vfat -n data /dev/sda1
  1. Add a line to your /etc/fstab containing the label as mount point, e.g.:
/dev/mmcblk0p3       /data                auto       defaults              0  2
  1. Insert the thumb drive

Expected result

Thumb drive should be mounted.

Actual result

Thumb drive is ignored:

 /dev/sda1 already in /etc/fstab, automount won't manage it: /dev/mmcblk0p3       /data                auto       defaults              0  2

Possible fix

In line 78 LABEL is used to find devices in fstab.

If the regex is changed to not allow spaces before ${LABEL} it will ignore mount points:

LABEL=data; grep /etc/fstab -e "^[^# ]*${LABEL}"
LABEL=mmcblk0p3; grep /etc/fstab -e "^[^# ]*${LABEL}"
/dev/mmcblk0p3       /data                auto       defaults              0  2

But I am not aware what possible values have to be matched in fstab.

lmoellendorf added a commit to lmoellendorf/udev-media-automount that referenced this issue Mar 26, 2024
Do not allow spaces if matching LABEL in order to ignore mount point and
other fstab line content.

fixes Ferk#25
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