Page 1 of 1

[HOWTO] Mount devices by users without password

PostPosted: May 30th, '13, 17:00
by magia
To allow users to mount devices (e.g. another partition of internal drive) without authentication, create /etc/polkit-1/rules.d/99-allow-mount.rules with these lines:

Code: Select all
// Allow all users to mount devices without authentication
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount")) {
      return polkit.Result.YES;
   }
});
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system")) {
      return polkit.Result.YES;
   }
});


Note: This howto is added to the Mageia Wiki.

Re: [HOWTO] Mount devices by users without password

PostPosted: May 31st, '13, 21:13
by doktor5000
Thanks for sharing, replaces viewtopic.php?p=5136#p5136 in my bookmarks :D

[SOLVED] mount and unmount usb media on xfce

PostPosted: Jun 4th, '13, 17:16
by hman
Hi all,
i had some errors using xfce4 to mount and unmount usb media. Sometimes i haven't any error message, other time i had permissions errors.
I solved creating an udev rules /etc/polkit-1/rules.d/10-drives.rules as follow:
Code: Select all
// Allow all users to mount devices without authentication
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount")) {
      return polkit.Result.YES;
   }
});

polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system")) {
      return polkit.Result.YES;
   }
});

// Allow to unmount
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-unmount-others")) {
      return polkit.Result.YES;
   }
});

// Allow to eject
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.eject-media")) {
      return polkit.Result.YES;
   }
});

polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.eject-media-system")) {
      return polkit.Result.YES;
   }
});

polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.eject-media-other-seat")) {
      return polkit.Result.YES;
   }
});


bye
Armando
edit doktor5000: merged into existing thread

Re: [HOWTO] Mount devices by users without password

PostPosted: Jun 10th, '13, 21:42
by man-draker
Under MGA3(64) I experience the same problem.
I created the proposed file. It enables Users to mount partitions on internal drives.
But USB-Sticks are not shown in Thunar.
They are recognised by the system:
Code: Select all
-- Logs begin at Mon, 2013-05-27 19:27:40 CEST. --
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Write Protect is off
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Mode Sense: 23 00 00 00
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] No Caching mode page present
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Assuming drive cache: write through
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] No Caching mode page present
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Assuming drive cache: write through
Jun 10 21:34:38 localhost kernel:  sdd: sdd1
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] No Caching mode page present
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Assuming drive cache: write through
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Attached SCSI removable disk

Re: [HOWTO] Mount devices by users without password

PostPosted: Jun 10th, '13, 21:48
by doktor5000
Well, if they're not shown at all, that's not the same as shown, but not mountable as user without password, no? ;)
Maybe some polkit stuff missing, or maybe thunar hasn't been updated for udisks2 "goodness" ...

Re: [HOWTO] Mount devices by users without password

PostPosted: Jun 10th, '13, 22:30
by man-draker
doktor5000 wrote:Well, if they're not shown at all, that's not the same as shown, but not mountable as user without password, no? ;)
Maybe some polkit stuff missing, or maybe thunar hasn't been updated for udisks2 "goodness" ...

OK I'll start a new thread in the german forum.

EDIT: Problem solved. Filesystem in USB-stick was defect.