[LINUX] Summary of restrictions by file system

1. Contents of this article

The correspondence between the file system type and the OS and the restrictions are organized.

The file system is one of the functions provided by the OS, and is a function required for managing and operating data stored in storage devices such as HDDs and USB memory. FAT32, exFAT, NTFS, etc. can be specified when formatting, but the supported formats differ depending on the OS.

For example, FAT32 is compatible with many operating systems such as Windows, Mac, Linux, and raspbian, so if you use a storage device formatted with FAT32, you can transfer data between personal computers. However, note that there are restrictions on the size limit of one file and the number of files that can be stored in one folder for each file system.

The sites referred to in the survey of this article are listed in the related links at the bottom of the page.

2. List of correspondence between file system types and OS

I investigated FAT32, exFAT, NTFS, and ext4, which I often use personally.

RW: Read / write RO: Read only ×: Not supported

File system Windows Mac Linux Volume size Maximum size of 1 file Maximum number of files in one directory
FAT32 RW RW RW 2TiB
* 32GiB on Windows
4GiB 65,535(※1)
exFAT RW RW × 64ZiB 16EiB 2,796,202
NTFS RW × × 16EiB 16EiB 4,294,967,295
ext4 × × RW 1EiB 16TiB i-nodedependent upon
File name format Root directory Subdirectory File name Remarks
8.3 formats 65,535 65,534 Up to 12 characters for uppercase letters and symbols only
13 characters 65,535÷3→21,845 65,534÷3→21,844 小文字や数字含む13 charactersの例
25 characters 65,535÷4→16,383 65,534÷4→16,383 小文字や数字含む25 charactersの例

3. In the end

When I tried to handle "2017 Test images [41K/6GB]" of COCO dataset on RaspberryPi, when I tried to copy to a USB memory formatted with FAT32, the following error occurred and the restrictions of FAT32 This survey was conducted because it was found that the number of files in one directory was exceeded.

I hope it will be helpful for those who have encountered similar problems.

4. Related links

Recommended Posts

Summary of restrictions by file system
Summary of python file operations
Summary of basic implementation by PyTorch
Summary of library hosting pages by language
Django tutorial summary for beginners by beginners ⑥ (static file)
[mypy] Summary of options not enabled by `--strict`
[Python] Summary of S3 file operations with boto3
Numerical summary of data
[Language processing 100 knocks 2020] Summary of answer examples by Python
Summary of Tensorflow / Keras
Summary of Python articles by pharmaceutical company researcher Yukiya
Summary of pyenv usage
Summary of Python arguments
Reimport of .py file
Summary of logrotate software logrotate
Summary of test method
Device and Linux file system
Summary of Python3 list operations
2017.3.6 ~ 3.12 Summary of what we did
Visualization of data by prefecture
Convenient usage summary of Flask
Summary of Linux distribution types
Calculation of similarity by MinHash
vtk (CAD system) Writer Summary
Basic usage of Pandas Summary
A brief summary of Linux
Summary of Proxy connection settings
Marge the characters of the box file generated by jTessBoxEditor line by line [Tesseract]