sata/ata device permission for user

Polytropon freebsd at edvax.de
Sun Apr 14 08:40:24 UTC 2013


On Sun, 14 Apr 2013 01:11:38 -0700 (PDT), Beeblebrox wrote:
> My user is unable to mount cdrom and cannot use qemu for the HDD devices. Why
> is access to these devices being refused for my user?

Because there have to be certain permissions in order to allow
a non-root user perform such tasks:

1. The setting vfs.usermount=1 has to be present in /etc/sysctl.conf .

2. The user must have write access to the device file.

3. The user has to own the mount directory.

It helps if the user is in the "wheel" group.



> 1. % mount_cd9660 /dev/cd0 /cdrom
> mount_cd9660: /dev/cd0: Operation not permitted

Check permissions of /dev/cd0 and /cdrom.



> 2. % qemu-system-x86_64 -hda /dev/ada2
> qemu-system-x86_64: -hda /dev/ada2: could not open disk image /dev/ada2:
> Operation not permitted

Check permissions of /dev/ada2, maybe write permission is needed?



> *SETTINGS:*
> % id => uid=1001(xyz) gid=0(wheel) groups=0(wheel),5(operator),1001(xyz)
> 
> /etc/devfs.rules has:  [localrules=10]
> add path 'ada[0-9]*' mode 0660 group operator
> add path 'da[0-9]*' mode 0660 group operator
> add path 'cd[0-9]*' mode 0660 group operator
> 
> /etc/rc.conf has:
> devfs_system_ruleset="localrules"

Looks correct, but doesn't seem to be sufficient. But take into
mind that /etc/devfs.rules is used for dynamically allocated devices,
and /etc/devfs.conf for those present at boot time (usually cd,
maybe also da and ada depending on your setup).



Also see:

http://forums.freebsd.org/showthread.php?t=5796

Compare to Handbook 19.5.2:

http://www.freebsd.org/doc/en/books/handbook/usb-disks.html

Maybe also helpful:

http://www.cyberciti.biz/faq/freebsd-allow-ordinary-users-mount-cd-rom-dvds-usb-removabledevice/


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list