What is the difference between umount and dsbmd/dsbmc?

I found out that thunar file manager won't able to view when my phone is attached to computer, but when I insert a usb it does. I found that FreeBSD doesn't have port for thunar-volman anymore so I researched and found dsbmd. However, I can't seem to understand how it would work properly. When I plug in my phone to my computer, it won't show on thunar that my phone is mountable, I had to run sudo dbsmc first so I would able to mount it on the gui client. When I would like to unmount using thunar, it won't let me, I need to run dbsmc as sudo again then unmount it. Too much workarounds.

I research more and found umount, what it is? how to use it? is it just the same as dsbmd too? can I mount using it and access through thunar without sudo?

I apologize if this seem to be a stupid question (but I don't believe there is such thing). Let me know if the question is confusing.

Thank you!!
 
and found umount, what it is?
The counter-half of mount(8). Filesystems are mount(8)'ed, and typically only root is allowed to mount filesystems. FreeBSD has a switch though, vfs.usermount which would allow regular users to mount filesystems. But they can only mount on mountpoints they own.

Code:
# sysctl -d vfs.usermount
vfs.usermount: Unprivileged users may mount and unmount file systems

 
I cannot find the device. I searched it using these commands: lsblk, gpart show, geom disk list, camcontrol devlist but I can't find the phone.

But, whenever I use dsbmc, it would able to find the phone connected and able to mount it, but it was too hassle.
Code:
$ doas dsbmc

Is there any method to mount my phone—even automatically, and see the filesystem of it when I use a file manager like thunar?

When I connect a USB stick, it would able to immediately seen as mounted in thunar, though.
 
When you plug your phone in, what changes in /dev?

To find a device, the best ways are (a) look at the output of dmesg when the device is plugged or unplugged, and see what device is created, and (b) look inside /dev.

Note that lsblk is not a native FreeBSD command. I bet it exists as a port of a Linux command, but I wouldn't trust its output. However, camcontrol is native and reliable, so if camcontrol says that the phone isn't there, then it isn't.

My theory: dsbmd might do something actively to turn storage device functionality of the phone on and off.

Note that the author of dsbmd is (or at least was) on the forum, username mrclksr.
 
Hi there,
So, after reading some threads, I found this one:
https://forums.freebsd.org/threads/dsbmd-a-media-mounting-daemon-automounter-for-freebsd.63534/

I followed the instructions, and I can now automount/mount my phone on computer without being a root user.
However, there is an issue. I am unable to eject/unmount the device:
Screenshot_2025-09-04_19-20-46.png

Screenshot_2025-09-04_19-21-44.png


It won't let me eject/unmount unless I force it using dsbmc client:
Screenshot_2025-09-04_19-22-25.png


Another thing, even though I enabled automount in the dsbmc client, it won't do unless I explicitly run/open dsbmc first.
 
Update: I'm using the cli now but I still don't know how to unmount the device properly. I just unplug it everytime, for now (which I think is unsafe).
 
Note that lsblk is not a native FreeBSD command. I bet it exists as a port of a Linux command, but I wouldn't trust its output.
It is a shell script written by vermaden that mimics lsblk from Linux indeed but made for our FreeBSD usage, so it is reliable, at least it has been for me since I use it.

bochard
Opening an issue on the github repo to ask your question directly to the author of this tool might be more successful. (It looks like he doesn't come by anymore).
Just be sure to add the relevant information and details (output from commands, logs, config, etc ...).
 
Update: I'm using the cli now but I still don't know how to unmount the device properly. I just unplug it everytime, for now (which I think is unsafe).
You said that
When you plug your phone in, what changes in /dev?
in your commen #4, so it can be assumed the umass storage is in your phone, right?

If your phone is mimicing LAN adapter, and you've configured for the interface, it can block unmounting (same device node for usb, ugen* is in use). In the case, possibly explicit ifconfig [ifname] down prior to unmounting could help.

And another possibilities could be that the phone has micro SD card slot (or something others) with a media inserted and exposing internal drive and SD to be different drives. In this case, both need to be unmounted. But this is device dependent (some devices exposes SD cards as subdirectory of internal drive, thus, single drive).
 
Note that lsblk is not a native FreeBSD command. I bet it exists as a port of a Linux command, but I wouldn't trust its output.
I would not trust Linux lsblk(8) either - that is why I wrote my own lsblk(8) version from scratch for FreeBSD - https://vermaden.wordpress.com/2019/09/27/list-block-devices-on-freebsd-lsblk8-style/ - details here.

Also - Linux lsblk(8) is written in C and supports dozens of options and switches. Mine is written in POSIX sh(1) and has only default output and list all disks w/o partition with -d option.

Mine lsblk(8) uses native FreeBSD tools under the hood the gather all needed data, like geom(8), gpart(8), diskinfo(8) or fstyp(8) commands.

... and since quite some time its also available in the FreeBSD Ports and pkg(8) packages - does not matter which method you will use - there is nothing to compile anyway.

Hope that helps.
 
I made it work. But, there's problem, whenever I plug my phone and enable file transfer, a few seconds after, it would unmount or detach by itself. What could be the problem?

here is the log:
Code:
$ tail /var/log/automount.log
2025-09-14 09:55:31 /dev/ugen0.5: mount OK: 'simple-mtpfs --device 1 /media/ugen0.5 -o allow_other -o uid=0 -o gid=0'
2025-09-14 09:55:31 /dev/ugen0.5: chown '/media/ugen0.5' dir with 'root:wheel' rights
2025-09-14 09:55:31 /dev/ugen0.5: detach
2025-09-14 09:55:31 /dev/ugen0.5: starting 'exo-open --launch FileManager' file manager
2025-09-14 09:55:31 /dev/ugen0.5: (direct) umount '/media/ugen0.5'
2025-09-14 09:55:31 /dev/ugen0.5: (state) umount '/media/ugen0.5'
2025-09-14 09:55:31 /dev/ugen0.5: (direct) mount point '/media/ugen0.5' removed
2025-09-14 09:55:31 /dev/ugen0.5: (state) mount point '/media/ugen0.5' removed
2025-09-14 09:55:31 /dev/ugen0.5: attach
2025-09-14 09:55:31 /dev/ugen0.5: no MTP devices found
2025-09-14 09:55:37 /dev/ugen0.5: detach
2025-09-14 09:55:37 /dev/ugen0.5: (direct) umount '/media/ugen0.5'
2025-09-14 09:55:37 /dev/ugen0.5: (direct) mount point '/media/ugen0.5' removed
2025-09-14 09:55:37 /dev/ugen0.5: attach
2025-09-14 09:55:37 /dev/ugen0.5: no MTP devices found
 
I made it work. But, there's problem, whenever I plug my phone and enable file transfer, a few seconds after, it would unmount or detach by itself. What could be the problem?

here is the log:
Code:
$ tail /var/log/automount.log
2025-09-14 09:55:31 /dev/ugen0.5: mount OK: 'simple-mtpfs --device 1 /media/ugen0.5 -o allow_other -o uid=0 -o gid=0'
2025-09-14 09:55:31 /dev/ugen0.5: chown '/media/ugen0.5' dir with 'root:wheel' rights
2025-09-14 09:55:31 /dev/ugen0.5: detach
2025-09-14 09:55:31 /dev/ugen0.5: starting 'exo-open --launch FileManager' file manager
2025-09-14 09:55:31 /dev/ugen0.5: (direct) umount '/media/ugen0.5'
2025-09-14 09:55:31 /dev/ugen0.5: (state) umount '/media/ugen0.5'
2025-09-14 09:55:31 /dev/ugen0.5: (direct) mount point '/media/ugen0.5' removed
2025-09-14 09:55:31 /dev/ugen0.5: (state) mount point '/media/ugen0.5' removed
2025-09-14 09:55:31 /dev/ugen0.5: attach
2025-09-14 09:55:31 /dev/ugen0.5: no MTP devices found
2025-09-14 09:55:37 /dev/ugen0.5: detach
2025-09-14 09:55:37 /dev/ugen0.5: (direct) umount '/media/ugen0.5'
2025-09-14 09:55:37 /dev/ugen0.5: (direct) mount point '/media/ugen0.5' removed
2025-09-14 09:55:37 /dev/ugen0.5: attach
2025-09-14 09:55:37 /dev/ugen0.5: no MTP devices found
That is how MTP works - after 1st attach phone/USB device is visible but you can not mount anything - this is the time you are asked on the phone screen if you want to share the files - then You agree and this '1st' device disappears and new '2nd' device appears with mount option ... but it does not work always that well unfortunately. I will try jmtpfs as alternative but last time I tried - it also failed me.

I am personally sick and tired of that MTP bullshit - so I attach USB pendrive to phone and copy files there ... this one - has both USB-C and USB-A plugs:

sandisk-dual-usb.jpg
 
Back
Top