[External USB Hard Drive] : mount UFS partition with non-root user

Hi all,

I have an external Hard Drive. I formated like below :

# dd if=/dev/zero of=/dev/da4 bs=1m count=128
# newfs -L MyPassport -O2 -U -m 6 /dev/da4

I checked with root :

# mount /dev/ufs/MyPassport /mnt

Works fine.

So, I checked my devfs and wrote :

-> /etc/devfs.rules

Code:
[mypassport=12]
add path 'ufs/MyPassport' mode 0660 group operator

and rc.conf

-> /etc/rc.conf
Code:
devfs_system_ruleset="mypassport"

With my user :

# mount /dev/ufs/MyPassport /mnt/

Unfortunately, I can't mount my external HDD :
Code:
mount: /dev/ufs/MyPassport: Operation not permitted

I did the same thing with USB stick(like handbook) and all is working fine.

Any idea ?

Thank you for your help.
 
You missed an essential part: allowing unprivileged users to mount file systems.

For that you must add vfs.usermount=1 to /etc/sysctl.conf and use sysctl(8) to set it on the running system.

The Handbook has all the details you need.
 
Thank you for your answer :)

I followed the handbook when I did the configuration.

It's why I'm here :-(
 
So do I have to understand from your post that it still doesn't work?

Another possible reason for "Operation not permitted" is that the user doesn't own/is not allowed to access the mountpoint. Since you probably don't own /mnt, you may want to create a directory inside your home directory and use it as your mountpoint instead, as the Handbook suggests. So did you do that too?
 
I found my mystake : I made some clean-up on /etc/rc.conf, and all is working fine.

Thank you !
 
Back
Top