(bash) How to find the maximum supported file system size?

(bash) For a specific directory, I need to determine the maximum file size supported by this file system. Perhaps the file system is installed on an external USB drive and may be FAT32, NTFS, exfat or ext2.

I know that I could partially guess the information from mount, but I would like to get a cleaner solution - plus in the case of exfat, it mountshows the file system type as "fuseblk".

(I am running Linux 3.2.0-4-686-pae # 1 SMP Debian 3.2.51-1 i686 GNU / Linux)


getconf FILESIZEBITS pathdoes not work to mount fuseblkthe exfat file system: it returns 32, which is inaccurate . Therefore, this is not a general solution.

+4
source share
2 answers

I think you can use getconf /pathfor this. Among many sizes, it prints as well FILESIZEBITS. APUE says this:

the minimum number of bits required to be represented as a signed integer value, the maximum size of a regular file allowed in the specified directory

There is some concern that it getconfdoes not return information specific to the file system:

getconf is basically unable to answer such a question because it depends on the file system.

This is not true:

[cnicutar@lux ~]$ getconf FILESIZEBITS /some/fuseblk/mount
32

[cnicutar@lux ~]$ getconf FILESIZEBITS /
64
+4
source
+1

Source: https://habr.com/ru/post/1528035/


All Articles