1

I am developing a script which provides mount only specific USB Storage.

First I blocked automount feature from /etc/udev/rules.d/85-no-automount.rules by adding

blockrule="SUBSYSTEMS=="usb", ENV{UDISKS_AUTO}:="0", ENV{UDISKS_IGNORE}:="1";

It works properly

Secondly, mount command runs in a script having root permission.

mount -t vfat -o umask=0000 /dev/sdb1 /media/AA;

It also work properly, standart user, administator who is logged read write USB.

Problems occur when a user want to unmout USB drive from GUI

Unmount from GUI

Error1

When i added fstab following line

/dev/sdb1 /media/AA vfat rw,umask=0 0 0

Message is changed to:

enter image description here

/media folder has:

(/media)
 ∴ ll
total 24
drwxr-xr-x   6 root root  4096 Ağu 21 11:15 .
drwxr-xr-x  24 root root  4096 Ağu 20 09:33 ..
drwxrwxrwx   3 root ossec 4096 Oca  1  1970 AA
drwxr-x---+  2 root root  4096 Ağu 20 15:34 deneme
drwxr-x---+  2 root root  4096 Ağu 21 10:29 root

I thought the problem is owner of mounted dictionary

drwxrwxrwx   3 root ossec 4096 Oca  1  1970 AA

So I tried the change mount command to

mount -t vfat -o uid=1004,gid=1004 umask=0000 /dev/sdb1 /media/AA;

/media folder was changed to:

(/media)
 ∴ ll
total 24
drwxr-xr-x   6 root   root   4096 Ağu 21 11:42 .
drwxr-xr-x  24 root   root   4096 Ağu 20 09:33 ..
drwxrwxrwx   3 deneme deneme 4096 Oca  1  1970 AA
drwxr-x---+  3 root   root   4096 Ağu 20 15:22 aagin
drwxr-x---+  2 root   root   4096 Ağu 20 15:34 deneme
drwxr-x---+  2 root   root   4096 Ağu 21 10:29 root

Owner of mounted dictionary is changed to

drwxrwxrwx   3 deneme deneme 4096 Oca  1  1970 AA

But it is not solve problem. I also changed

/usr/share/polkit-1/actions/ org.freedesktop.udisks.policy
/usr/share/polkit-1/actions/ org.freedesktop.udisks2.policy

inside of these files, every node has:

<defaults>
  <allow_any>yes</allow_any>
  <allow_inactive>yes</allow_inactive>
  <allow_active>yes</allow_active>
</defaults>

How can standart user unmount from GUI?

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.