25

when I run mount, I can see my hard drive mount as fuseblk.

/dev/sdb1 on /media/ecarroll/hd type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)

However, fuseblk doesn't tell me what filesystem is on my device. I found it using gparted but I want to know how to find the fs using the command line utilities.

Evan Carroll
  • 30,763
  • 48
  • 183
  • 315

4 Answers4

36

I found the answer provided by in the comments by Don Crissti to be the best

lsblk -no name,fstype

This shows me exactly what I want and I don't have to unmount the device,

mmcblk0     
└─mmcblk0p1 exfat

See also,

Evan Carroll
  • 30,763
  • 48
  • 183
  • 315
  • For this to work you have to be root. Surprisingly (for me) lsblk strips off FS and other infos from its output if you aren't root. This also applies to other solutions proposed below. – Gianluca Frustagli Aug 30 '21 at 22:57
  • @GianlucaFrustagli I do not have to be root to run lsblk -no name,fstype what distro are you using? What are your permissions in /run/udev/data, and /sys? – Evan Carroll Aug 31 '21 at 06:02
  • I'm using OpenSUSE. FS permissions on /run/udev/data and /sys are: drwxr-xr-x 2 root root /run/udev/data/ dr-xr-xr-x 12 root root /sys/ – Gianluca Frustagli Sep 04 '21 at 12:58
6

In general, it is not possible to go from a FUSE mount point to the process implementing it.

If you know something about how that filesystem works, then it might be possible. You have to track the device side, not the mount point. For example, in your case, the FUSE filesystem is exposing a filesystem on a block device, so you can look for processes that have the blockd device open: lsof /dev/sdb1 or fuser /dev/sdb1. Similarly, with SSHFS, you can use lsof or netstat to look for a process that has a connection to the right server, etc. This gives you a process ID, and ps can then tell you what program that process is running.

0

You can find the fs of /dev/sdb1 through :

fsck command:

fsck -N /dev/sdb1

mount command:

mount | grep /dev/sdb1

file command:

file -sL /dev/sdb1

df command:

df -T | grep /dev/sdb1
schaiba
  • 7,631
GAD3R
  • 66,769
  • 5
    That only works in the special case where the device entry is an actual device, which is rarely the case with FUSE. Furthermore it only reports what the content of the device looks like, which is not always a full indication of which filesystem driver is being used. – Gilles 'SO- stop being evil' Dec 26 '16 at 21:57
0

A generic way to query backing filesystem for any given file is to do

lsblk -no name,fstype,mountpoint "$(findmnt --target "$FILE" -no SOURCE)"

The output will look something like

sdd1 exfat  /media/USER/CARD-A123

where sdd1 is the device name, exfat is the underlying filesystem type (e.g. mount will show just fuseblk for both NFTS and exFat and this will show the real filesystem) and the rest of the output is the mount point for this filesystem.

If you get error such as

lsblk: : not a block device

the $FILE didn't point to readable file or directory.