mount cdrom as user

I hope this is the right forum to ask. When I try to mount a cdrom as user it won't let me. Asks for root permissions. The problem is that if I want to see a dvd, I also must run vlc or mplayer as root because as user they cannot read the cdrom. And I guess it's not a good idea to run programs as root. Any idea?
 
Add this to devfs.conf:
Code:
own acd* U:G
perm acd0 0660
U:G is your user with its group.
Allow user to mount via /etc/sysctl:
Code:
sysctl vfs.usermount=1
Don't forget to add it to /etc/sysctl.conf so you haven't to change it after every boot.
Code:
vfs.usermount=1
Now restart devfs:
Code:
/etc/rc.d/devfs restart
See: man devfs.conf
 
I read both of them. And aragons links and also I tried SIFES post.

My devfs.conf
Code:
own acd* emberdaemon:wheel
perm acd0 0660
perm acd1 0660

My /etc/sysctl
Code:
sysctl vfs.usermount=1

My /etc/sysctl.conf
Code:
vfs.usermount=1

But /etc/rc.d/devfs restart
Code:
chown: acd0: Operation not permitted
chown: acd0t01: Operation not permitted
chown: acd1: Operation not permitted
chmod: acd0: Operation not permitted
chmod: acd1: Operation not permitted
Something must be wrong on group on devfs.conf
I tried root, wheel, operator
 
Code:
[localrules=5]
add path 'da*' mode 0660 group operator
add path 'cd*' mode 0660 group operator
add path 'acd*' mode 0660 group operator

.. is my devfs, just replace `operator` with any group you want the members to be able to mount.

As well as the kernel tunable (sysctl) value, make sure that

Code:
devfs_system_ruleset="localrules"

is in rc.conf

The above is adapted from the tutorial in the official handbook (for usb memory devices)

http://www.freebsd.org/doc/handbook/usb-disks.html
(near the botton)
 
MR sk8harddiefast, did you restartdevfs as root
No. As emberdaemon.
My /dev

Code:
acd0        ad10s1e     ata         cuau0.lock  fido        kbd2        mixer2      stderr      ttyv3       ttyvd       ugen4.2     usb
acd0t01     ad10s1f     atkbd0      cuse        fw0         kbdmux0     nfslock     stdin       ttyv4       ttyve       ugen5.1     usbctl
acd1        ad12        audit       dcons       fw0.0       klog        null        stdout      ttyv5       ttyvf       ugen6.1     vboxnetctl
acpi        ad12s1      bpf         devctl      fwmem0      kmem        nvidia0     sysmouse    ttyv6       ufsid       ugen6.2     video0
ad10        ad12s1d     bpf0        devstat     fwmem0.0    log         nvidiactl   ttyu0       ttyv7       ugen0.1     ugen6.3     xpt0
ad10s1      ad14        console     dgdb        geom.ctl    mdctl       pci         ttyu0.init  ttyv8       ugen1.1     ugen7.1     zero
ad10s1a     ad14s1      consolectl  dsp0.0      io          mem         ptmx        ttyu0.lock  ttyv9       ugen2.1     ukbd0
ad10s1b     ad6         ctty        dsp1.0      iso9660     midistat    pts         ttyv0       ttyva       ugen3.1     ums0
ad10s1b.bde ad6s1       cuau0       dsp2.0      kbd0        mixer0      random      ttyv1       ttyvb       ugen3.2     ums1
ad10s1d     ad6s1d      cuau0.init  fd          kbd1        mixer1      sndstat     ttyv2       ttyvc       ugen4.1     urandom

I read this http://www.freebsd.org/doc/handbook/usb-disks.html

So I created a file devfs.rules and I wrote these lines
Code:
[localrules=5]
add path 'da*' mode 0660 group wheel
add path 'cd*' mode 0660 group wheel
add path 'acd*' mode 0660 group wheel
Also on rc.conf I add this line
Code:
devfs_system_ruleset="localrules"

Now the output of /etc/rc.d/devfs restart as emberdaemon
Code:
devfs rule: ioctl DEVFSIO_RGETNEXT: Operation not permitted
/etc/rc.d/devfs: WARNING: devfs_set_ruleset: you must specify a ruleset number
/etc/rc.d/devfs: WARNING: devfs_apply_ruleset: you must specify a ruleset
 
Yeap. Worked :)
I run vlc as emberdaemon and now can read my dvd :)
Also [cmd=]sudo etc/rc.d/devfs restart[/cmd] returns me none error :)
Thanks all of you!
 
Back
Top