Skip to content

Instantly share code, notes, and snippets.

@vegertar
Created February 28, 2023 04:42
Show Gist options
  • Save vegertar/5df6f399287e59be33bc85d24d9a7c58 to your computer and use it in GitHub Desktop.
Save vegertar/5df6f399287e59be33bc85d24d9a7c58 to your computer and use it in GitHub Desktop.
Allows non-root users to mount USB sticks on DragonFlyBSD

Activation

See man vfs, search vfs.usermount, hence merely enable user mount by run sysctl vfs.usermount=1

Permission

See man devfsctl, investigate the section EXAMPLES, add some lines into /etc/devfs.conf, in my case, e.g.:

perm    da8s*           whom:whom       0644

Stuff

service devfs restart and plug into an USB stick with, say, msdos filesystem, the device is created as /dev/da8* names in my system:

root@df:~ # ls -l /dev/da8*
crw-r--r--  1 whom  whom   33, 0x1e110047 Feb 28 10:32 /dev/da8
crw-r--r--  1 whom  whom   33, 0x1e120047 Feb 28 10:32 /dev/da8s1
crw-r--r--  1 whom  whom   33, 0x1e130047 Feb 28 10:32 /dev/da8s2
crw-r--r--  1 whom  whom   33, 0x1e140047 Feb 28 10:32 /dev/da8s3

These dev files should be able to mount properly under some directories owned by whom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment