I am writing this software that creates virtual block device nodes almost like loop does. I need to allow non-superusers to mount and umount filesystems from these devices. I don't know the names of the block device nodes beforehand so i can't use fstab entries to add "user" or "owner" flags there.

Currently i solve this by providing a small suid helper tool that verifies that this is indeed "my" block device the user is trying to mount and then just call /sbin/mount or /sbin/umount to do the job. This is definitely better than setting a suid bit for the whole program but not really perfect. Is there a better way?


1 Answer 1


Perhaps the pmount program can help you. Another option is setting sudo rules. The sudo program does allow you to define some pretty specific rules once you grok its config syntax.

  • I'm taking a look at pmount. Without me installing it first, can you say if it will (or should) work with archivemount? Thanks
    – MountainX
    Jun 20, 2013 at 23:02
  • @MountainX Do you have, or do you use, an fstab file? If so, you might just try the user option there first.
    – Keith
    Jun 21, 2013 at 0:43
  • Yes, I can use fstab. But I don't know the syntax when using archivemount with fstab and I couldn't find examples anywhere.
    – MountainX
    Jun 21, 2013 at 7:03
  • I have googled to the best of my ability to find achievemount fstab examples. I have not found relevant/helpful results yet.
    – MountainX
    Jun 21, 2013 at 20:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.