Determine filesystem type by directory

630 views Asked by At

I launch this command via Process to determine the file system of specific directory.

stat -f -c %T path

Unfortunately the output is not reliable. For example

$ stat -f -c %T /                                    
romfs
$ stat -f -c %T /sdcard/                             
UNKNOWN
$ stat -f -c %T /mnt/external_sd/                    
msdos

The Partition Table app from the Google Play shows valid names like "ext4", "yaffs" and "vfat". How can I achieve that? Note: I rely on busybox so no problem with lacking tools.

1

There are 1 answers

3
pevik On BEST ANSWER

How about use mount? You just have to determine in which partition is your directory.