You are not logged in.

#1 2012-06-11 21:43:12

steelneck
Member
Registered: 2011-08-26
Posts: 57

[SOLVED]Udev rule stoped working

After last -Syu, with a lot of packages uppgraded (100 or so), my old udev rule to mount usb mass storage media stopped working. All my usb sticks and card reader is recognized and i can mount them manually, though it has been so long since i messed around with udev that i do not even remember where to begin to try to solve this. The udev rule (in /lib/udev/rules.d) in question looks like this:

KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"

# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"

# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"

# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,shortname=lower,gid=100,umask=002"

# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"

# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"

# Exit
LABEL="media_by_label_auto_mount_end"

Last edited by steelneck (2012-06-12 00:11:18)

Offline

#2 2012-06-11 21:47:21

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Udev rule stoped working

have you searched the forum for a similar thread which was opened recently?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2012-06-11 21:51:52

steelneck
Member
Registered: 2011-08-26
Posts: 57

Re: [SOLVED]Udev rule stoped working

Yes, but i did not find anything that i thought could be about about the same problem. If i had found something i would not need to start a new thread, then i would have been busy fixing my problem.

Last edited by steelneck (2012-06-11 21:52:08)

Offline

#4 2012-06-11 22:15:05

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Udev rule stoped working

A simple search for udev rules gets me this about 8 threads below yours. :

https://bbs.archlinux.org/viewtopic.php?id=143023


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2012-06-11 22:31:38

steelneck
Member
Registered: 2011-08-26
Posts: 57

Re: [SOLVED]Udev rule stoped working

Still cannot find anything. My rule have been working for at least 2 years, maybe more, but after last upgrade it stopped, so something has changed. What?

Offline

#6 2012-06-11 22:43:00

steelneck
Member
Registered: 2011-08-26
Posts: 57

Re: [SOLVED]Udev rule stoped working

BTW. My rule is almost the exact same as the one in the udev - ArchWiki page Mount under /media; use partition label if present, so my problem means that the ArchWiki, well go figure..

Offline

#7 2012-06-12 00:10:58

steelneck
Member
Registered: 2011-08-26
Posts: 57

Re: [SOLVED]Udev rule stoped working

Solved it. I just mv the rule from /lib/udev/rules.d to /etc/udev/rules.d and it started to work. If this is correct then the ArchWiki page needs to be changed since it says "udev rules shipped with various packages are found in /lib/udev/rules.d/", or this is a bug in udev.

Offline

#8 2012-06-12 00:53:21

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: [SOLVED]Udev rule stoped working

It says "udev rules shipped with various packages are found in /lib/udev/rules.d/". Was your rule part of a package?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-06-12 00:58:47

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED]Udev rule stoped working

steelneck wrote:

Solved it. I just mv the rule from /lib/udev/rules.d to /etc/udev/rules.d and it started to work. If this is correct then the ArchWiki page needs to be changed since it says "udev rules shipped with various packages are found in /lib/udev/rules.d/", or this is a bug in udev.

Wiki is out of date. udev rules shipped with packages should be placed in /usr/lib/udev/rules.d. Your rule never should have been in /lib, but in /etc/udev/rules.d this whole time.

Offline

#10 2012-06-12 06:36:57

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED]Udev rule stoped working

I've edited the wiki page to correct this.


Burninate!

Offline

Board footer

Powered by FluxBB