Other FreeBSD Handbook: make a device mountable as a normal user

Hello guys !

In the FreeBSD Handbook, at the section 17.4 is shown how to make a device mountable as a normal user.

The local rule:

add path 'da*' mode 0660 group operator

is valid for any port of the PC.

But if I wanted to apply the rule to the one of the only attached device, can you tell me please if is it correct the following "interrogative" syntax:

add path 'da[0-9]?' mode 0660 group operator

Thanks in advance.

See you.
 
vince66 said:
...But if I wanted to apply the rule to the one of the only attached device, can you tell me please if is it correct the following "interrogative" syntax...
Well, if you want to apply the rule to the only attached device you can simply address it directly as it appears in /dev.
Code:
add path 'da0' mode 0660 group operator
If you have more connected devices, then your rule won't help you even if the syntax is correct, since it would apply to everything from da0 to da9.

Naturally, your "normal user" must be a member of operator group, which is not the default. Be careful there, though, since members of this group can also restart and shut down the system.
 
Helloo natharan,

first of all, thanks for your important replies to my posts.

Please, about this post, I'm agree with you.

Please, let me be more precise. I repeat my question with other words. Surely my english is not good.

I've 8 usb ports on my PC.
My question is: how can I modify the sintax of the rule in the case I randomly plug in a usb device in any of the 8 ports.

Thanks.

Regards.
 
Hi vince66,

if I'm not mistaken, the USB device number in /dev doesn't rely on specific port, but on the order in which devices are connected to the machine. So if you plug in a flash thumb stick into the first port, it becomes /dev/da0. If you unplug it, the /dev/da0 periph will be destroyed. If you then plug it into another port, say the fifth, it becomes da0 again. So if you always connect only one USB storage device at a time, it will always be da0. At least that's what my system does.

Give it a try and also check dmesg after every action to see what's happening.
 
Back
Top