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.

0

4 Answers 4

35

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,

3
  • 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. Commented Aug 30, 2021 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? Commented Aug 31, 2021 at 6: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/ Commented Sep 4, 2021 at 12:58
7

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 
1
  • 6
    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. Commented Dec 26, 2016 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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.