vermaden / lsblk

List information about block devices in the FreeBSD system.
BSD 2-Clause "Simplified" License
25 stars 2 forks source link

list fuse mountpoints #2

Closed ddowse closed 1 year ago

ddowse commented 3 years ago

Hello,

this will show the mount point regardless of what fuse daemon is used.

Best regards

Daniel

vermaden commented 3 years ago

On my FreeBSD 13.0 system that does not show a lot.

Here with exFAT mounted.

# mount -t fusefs
/dev/fuse on /media/da0 (fusefs)

// AS USER

% fstat /dev/fuse
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME

// AS ROOT

# fstat /dev/fuse
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME
root     mount.exfat-fuse 97173    4 /dev        442 crw-rw-rw-    fuse rw  /dev/fuse

Only with -f option it at least showed da0 device ... but without mountpoint:

# fstat -f /dev/fuse | grep da0
root     mount.exfat-fuse 97173    3 /dev        509 crw-rw----     da0 rw

What is the output of these as root on your system:

# fstat -f /dev/fuse
# fstat /dev/fuse
ddowse commented 3 years ago

When i run fstat /dev/fuse user I get the commands and PIDs reported that belong to me.

USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME

datasmur sshfs 49537 3 /dev 419 crw-rw---- fuse rw /dev/fuse datasmur sshfs 51651 3 /dev 419 crw-rw---- fuse rw /dev/fuse
datasmur sshfs 65543 3 /dev 419 crw-rw---- fuse rw /dev/fuse

As root the same as before + from any other user.

fuse-ext2 /dev/da0p1 /mnt

with fusefs branch as root

da0 1:211 932G GPT - -

-:- 1.0M - - - da0p1 1:212 932G linux-data - /mnt -:- 711K - - -
vermaden commented 3 years ago

Useless information on my box ...

# fuse-ext2 -o force /dev/da0 /media/da0

# mount -f fusefs
/dev/fuse on /media/da0 (fusefs)

% fstat /dev/fuse 
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME

# fstat /dev/fuse
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME
vermaden fuse-ext2  58821    3 /dev        442 crw-rw-rw-    fuse rw  /dev/fuse
ddowse commented 3 years ago

2021-05-22-221628_1045x753_scrot

vermaden commented 3 years ago

2021-05-22-221628_1045x753_scrot

That fstat output does not show devices not mountpoints.

ddowse commented 3 years ago

I think i do not completely understand, what you mean, now. Sorry

Instead of pgrep ing for a specific fuse command/daemon, i just use fstat and filter then the PIDs just like before.

vermaden commented 3 years ago

Sorry ... I probably did not get what the enhancement here was :)

I was expecting fstat to show devices and mountpoints ... and you wanted to get PIDs the other way ... am I getting that right now? :)

ddowse commented 3 years ago

Yes. Getting the PIDs that belong to a fuse mount command by using fstat on /dev/fuse. I guess i have to be more precise in stating the nature of the commit next time to avoid confusion. Sorry.

vermaden commented 3 years ago

... or I was too little too 'fast' or hoping for a miracle to know exact mountpoints and devices from fstat :)

Anyway - thank You for your suggestion - I may not directly merge this pull request but I will definitely use that in some form.

Regards.

ddowse commented 3 years ago

Yes, not going to happen getting the fuse mountpoints with one shot pretty printed ( I have seen your tweet/ml post :-) , there is an old unresolved Forum Post about this, too. And on the fuse sourceforge ML archives there was also no answer to find to that question. This got me courious, too. So i checked this tool of yours and didn't see any mountpoints from fuse-ext2 (i have no other foreign fs at hand) and then i check the line in your code and came up with this idea.

Best regards.