Abstract


  • A Data Structure with features that the Kernel uses to control how data is stored and retrieved on a storage device
  • Provides a way to organise File Directory into folders, and to keep track of which File are stored where on the device

List the filesystem of attached block device

Linux Kernel

lsblk --fs

MacOS

diskutil list

Manipulate Filesystem with mkfs

Format a storage device to specific filesystem with sudo mkfs -t <FILESYSTEM_TYPE> -f /dev/<STORAGE_NAME>.

Check the storage size of current directory recursively

du -sh .
  • -s means summary
  • -h means human-readable

Disk re-sizing

You can refer to Increase the size of a persistent disk | Google Cloud to play with re-sizing a file system.

Mounted File System

Always perform mount on empty file directory

Otherwise, the File in the mounted Directory of the original File System can’t be accessed

Common File Systems


APFS

  • Apple File System
  • Created by Apple, used for macOS, iOS, iPadOS, tvOS, and watchOS
  • We need to use FUSE to mount APFS on Linux Kernel. One common option is sgan81/apfs-fuse

Ext4

  • Extended Filesystem 4
  • The default choice on many Linux distributions. Mature, stable, and offers good all-around performance
  • Commonly used in Linux Kernel

exFAT

  • EXtended File Allocation Table
  • Windows standard filesystem, both macOS and Linux Kernel support
  • Designed as a successor to FAT32, specifically for flash drives and other external storage. Handles large files and better cross-compatibility than FAT32

ZFS

  • Zettabyte File System
  • Originally from Solaris, known for extreme scalability, data integrity protection, and comprehensive features (snapshots, compression, volumes). Can be resource-intensive
  • Commonly used in Linux Kernel