Sample Header Ad - 728x90

how to mount partition with -o remount,ro option without being superuser

0 votes
1 answer
67 views
If I am root in can run the command mount -o remount,ro /data. However I can not do it in my user session without using sudo. I tried to modify my fstab : LABEL=DATA   /data        ext4  auto,rw,users  0  1 I added a polkit rule: polkit.addRule(function(action, subject) { if ((action.id == "org.freedesktop.udisks2.filesystem-mount" || action.id == "org.freedesktop.udisks2.filesystem-unmount" || action.id == "org.freedesktop.udisks2.filesystem-mount-system-internal") && subject.isInGroup("me")) { return polkit.Result.YES; } }); But I did not manage to make it works. Always with the same error : mount /data : must be superuser to use mount
Asked by void_brain (119 rep)
Jan 2, 2025, 01:12 PM
Last activity: Jan 2, 2025, 03:28 PM