Can't mount a filesystem with a UDEV rule
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I don't know what I am doing wrong...
My udev rule:
ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/block/sdb/sdb1", RUN+="/bin/bash -c '/bin/mount -v --target /path/to/mount/point > /path/to/debug/file/1 2>&1; echo $? > /path/to/debug/file/2 2>&1'"
My /etc/fstab contains the line:
UUID=XXXXXXXX /path/to/mount/point vfat noauto,noexec,rw,user,uid=1000,gid=1000 0 2
After the device is plugged in:
Debug file 1 contains:
mount: /path/to/mount/point: permission denied.
Debug file 2 contains:
32
And here's the thing:
When I run
mount /path/to/mount/point
manually (after the devices is plugged in), it gets mounted without problems!
Error code "32" is not very informative in the mount man pages. It just states "mount failure"...
I also chose the DEVPATH key after monitoring the uevents with "udevadm monitor", such that it is the last event which triggers the rule. Such that the environment is fully built when the rule gets triggered.
I've experimented with different rules/scripts/configs for days now, without any effort. I tried many HDDs and several file systems. I get this "permission denied" error every. single. time.
I am utterly frustrated/devastated/embittered/defeated/insertnegativeadjectivehere with this issue and asking you guys now as my last hope...
mount udev
add a comment |Â
up vote
0
down vote
favorite
I don't know what I am doing wrong...
My udev rule:
ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/block/sdb/sdb1", RUN+="/bin/bash -c '/bin/mount -v --target /path/to/mount/point > /path/to/debug/file/1 2>&1; echo $? > /path/to/debug/file/2 2>&1'"
My /etc/fstab contains the line:
UUID=XXXXXXXX /path/to/mount/point vfat noauto,noexec,rw,user,uid=1000,gid=1000 0 2
After the device is plugged in:
Debug file 1 contains:
mount: /path/to/mount/point: permission denied.
Debug file 2 contains:
32
And here's the thing:
When I run
mount /path/to/mount/point
manually (after the devices is plugged in), it gets mounted without problems!
Error code "32" is not very informative in the mount man pages. It just states "mount failure"...
I also chose the DEVPATH key after monitoring the uevents with "udevadm monitor", such that it is the last event which triggers the rule. Such that the environment is fully built when the rule gets triggered.
I've experimented with different rules/scripts/configs for days now, without any effort. I tried many HDDs and several file systems. I get this "permission denied" error every. single. time.
I am utterly frustrated/devastated/embittered/defeated/insertnegativeadjectivehere with this issue and asking you guys now as my last hope...
mount udev
IIRC udev scripts get executed in a somewhat restricted environment, so/path/to/mount/point
may indeed have some parts in it that are not accessible. An obvious workaround is to execute a setuid script with the correct user/group. Runningmount
manually as root will of course execute without problems. The (no longer maintained) Debian packageusbmount
does the same thing, so you can also have a look at how they solved it.
â dirkt
Aug 27 at 6:10
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I don't know what I am doing wrong...
My udev rule:
ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/block/sdb/sdb1", RUN+="/bin/bash -c '/bin/mount -v --target /path/to/mount/point > /path/to/debug/file/1 2>&1; echo $? > /path/to/debug/file/2 2>&1'"
My /etc/fstab contains the line:
UUID=XXXXXXXX /path/to/mount/point vfat noauto,noexec,rw,user,uid=1000,gid=1000 0 2
After the device is plugged in:
Debug file 1 contains:
mount: /path/to/mount/point: permission denied.
Debug file 2 contains:
32
And here's the thing:
When I run
mount /path/to/mount/point
manually (after the devices is plugged in), it gets mounted without problems!
Error code "32" is not very informative in the mount man pages. It just states "mount failure"...
I also chose the DEVPATH key after monitoring the uevents with "udevadm monitor", such that it is the last event which triggers the rule. Such that the environment is fully built when the rule gets triggered.
I've experimented with different rules/scripts/configs for days now, without any effort. I tried many HDDs and several file systems. I get this "permission denied" error every. single. time.
I am utterly frustrated/devastated/embittered/defeated/insertnegativeadjectivehere with this issue and asking you guys now as my last hope...
mount udev
I don't know what I am doing wrong...
My udev rule:
ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/block/sdb/sdb1", RUN+="/bin/bash -c '/bin/mount -v --target /path/to/mount/point > /path/to/debug/file/1 2>&1; echo $? > /path/to/debug/file/2 2>&1'"
My /etc/fstab contains the line:
UUID=XXXXXXXX /path/to/mount/point vfat noauto,noexec,rw,user,uid=1000,gid=1000 0 2
After the device is plugged in:
Debug file 1 contains:
mount: /path/to/mount/point: permission denied.
Debug file 2 contains:
32
And here's the thing:
When I run
mount /path/to/mount/point
manually (after the devices is plugged in), it gets mounted without problems!
Error code "32" is not very informative in the mount man pages. It just states "mount failure"...
I also chose the DEVPATH key after monitoring the uevents with "udevadm monitor", such that it is the last event which triggers the rule. Such that the environment is fully built when the rule gets triggered.
I've experimented with different rules/scripts/configs for days now, without any effort. I tried many HDDs and several file systems. I get this "permission denied" error every. single. time.
I am utterly frustrated/devastated/embittered/defeated/insertnegativeadjectivehere with this issue and asking you guys now as my last hope...
mount udev
mount udev
edited Aug 26 at 20:37
jasonwryan
47.3k14128178
47.3k14128178
asked Aug 26 at 19:11
de_dust
101
101
IIRC udev scripts get executed in a somewhat restricted environment, so/path/to/mount/point
may indeed have some parts in it that are not accessible. An obvious workaround is to execute a setuid script with the correct user/group. Runningmount
manually as root will of course execute without problems. The (no longer maintained) Debian packageusbmount
does the same thing, so you can also have a look at how they solved it.
â dirkt
Aug 27 at 6:10
add a comment |Â
IIRC udev scripts get executed in a somewhat restricted environment, so/path/to/mount/point
may indeed have some parts in it that are not accessible. An obvious workaround is to execute a setuid script with the correct user/group. Runningmount
manually as root will of course execute without problems. The (no longer maintained) Debian packageusbmount
does the same thing, so you can also have a look at how they solved it.
â dirkt
Aug 27 at 6:10
IIRC udev scripts get executed in a somewhat restricted environment, so
/path/to/mount/point
may indeed have some parts in it that are not accessible. An obvious workaround is to execute a setuid script with the correct user/group. Running mount
manually as root will of course execute without problems. The (no longer maintained) Debian package usbmount
does the same thing, so you can also have a look at how they solved it.â dirkt
Aug 27 at 6:10
IIRC udev scripts get executed in a somewhat restricted environment, so
/path/to/mount/point
may indeed have some parts in it that are not accessible. An obvious workaround is to execute a setuid script with the correct user/group. Running mount
manually as root will of course execute without problems. The (no longer maintained) Debian package usbmount
does the same thing, so you can also have a look at how they solved it.â dirkt
Aug 27 at 6:10
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464955%2fcant-mount-a-filesystem-with-a-udev-rule%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
IIRC udev scripts get executed in a somewhat restricted environment, so
/path/to/mount/point
may indeed have some parts in it that are not accessible. An obvious workaround is to execute a setuid script with the correct user/group. Runningmount
manually as root will of course execute without problems. The (no longer maintained) Debian packageusbmount
does the same thing, so you can also have a look at how they solved it.â dirkt
Aug 27 at 6:10