Solved Normal user mount usb by gpt label

Good day all,

Please indulge me and tell me the answer which is eluding me, probably due to me not using the correct terms in search boxes.

I am content for staff to mount usb pen drives as a normal user,

mount /dev/da0p1

with the devfs rule

add path ‘da*’ mode 0660 group wheel.

What I would really like is to mount using it’s gpt label.

As root I can mount using

mount /dev/gpt/label mountpoint

So the issue would seem to be the rule. What should it be to allow a normal user to mount /dev/gpt/label mountpoint?

Is there more info required to arrive at the required answer?

tl;dr

We work off grid using the cli only. We are a forestry company specialising in Beyond Economic Recovery timber. We are very happy using the cli on refurb hardware and due to proximity to services, even 4g towers, the transfer of data using usb drives has become our norm to the degree that site cabin laptop shutdown scripts simply cp files and directories to mounted drives for the user to bring back to home base where they are mounted and copied onto the users space. Each pen drive has the users name OR work location written on it. The office admin wants to mount the drive by what is scribbled on it. Once a day they will put all 8 drives into a usb hub and process them. They are happy to mount them individually and in reality they are done 1 at a time, or sometimes more, as staff pass through the office. We are running FreeBSD 13 (various versions) on old Samsung nc10 netbooks. We use calcurse, sc and vim and our projects are managed using tree -info of a project directory. KISS.
 
Good day Emrion, that, regretfully doesn’t answer the question. Mounting devices using the mount /dev/da0p1 and the rule I wrote work fine and have done for years. The question is how to change the rule to allow same for mount /dev/gpt/emrion-pendrive. I can’t seem to find an answer that directs me to the correct reading.

Good day T-Aoki. Again, not really the answer. I can turn on a gui and xfce will mount them all but that’s not the point. I learn nothing by using npmount which ultimately is just a layer over the base system.
 
I've tried below now and could mount/unmount as regular user belonging group operator. ESP_S05 is the label for one of my ESP partition which is not used for daily use (test environment).
Mount point is created before testing and intentionally has attribute 777.

In /etc/fstab:
/dev/msdosfs/ESP_S05 /mnt2/efi msdosfs rw,noauto 0 0

In /usr/local/etc/npmount.conf:
# Group Mount points operator /media/* operator /mnt2/*

I could mount ESP_S05 with npmount mount /mnt2/efi
and unmount it with npmount umount /mnt2/efi as non-root user belonging group operator.

Note that I could do all these test WITHOUT REBOOT.
 
I've tried below now and could mount/unmount as regular user belonging group operator. ESP_S05 is the label for one of my ESP partition which is not used for daily use (test environment).
Mount point is created before testing and intentionally has attribute 777.

In /etc/fstab:
/dev/msdosfs/ESP_S05 /mnt2/efi msdosfs rw,noauto 0 0

In /usr/local/etc/npmount.conf:
# Group Mount points operator /media/* operator /mnt2/*

I could mount ESP_S05 with npmount mount /mnt2/efi
and unmount it with npmount umount /mnt2/efi as non-root user belonging group operator.

Note that I could do all these test WITHOUT REBOOT.
Good day, npmount is not an immediate option. I am looking for the construction of a rule in devfs.rules that allows the existing add path ‘da*’ mode 0660 group wheel, which works perfectly and has done for years, to allow add path ‘dev/gpt/* group wheel. It might be that I am looking at the wrong element and it’s not devfs.rules that would allow this. Maybe I will close this and restate my problem. Adding an app doesn’t work for me. I am not asking for how to mount a usb drive as a normal user, I can do that. But thanks for your time on this.
 
Apparently it was the rule.

add path ‘da*’ mode 0660 group wheel
allows my normal user to mount da0p1

add path ‘gpt/*’ mode 0660 group wheel
allows my normal user to mount data-traveller
 
I am not asking for how to mount a usb drive as a normal user, I can do that.
I never said the partition I've used for testing is a USB drive. If so, for example, sysutils/automount would do the almost perfect job.
I thought it's not at all what you're looking for, so the partition ESP_S05 is in a SSD connected on-board SATA interface. I can't understand why you stick to devfs.rules so strongly.

Another thing to mention.
An entry under /dev/gpt/* would dissappear once it is mounted (possibly once its filesystem type is determined) and, if it's FAT (msdosfs), it stays under /dev/msdosfs/* (/dev/ufs/ for UFS partitions).
 
Back
Top