Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:storage:filesystems-and-partitions [2024/03/09 03:09] – [Set up exFAT] add exfat-fsck mention palebloodskydocs:guide-user:storage:filesystems-and-partitions [2024/09/04 08:37] – [btrfs] artoria2e5
Line 2: Line 2:
 This page contains basic information about filesystems (file systems) and partitions. A filesystem is "how data is written in a partition of the storage device". Windows, macOS, and Linux use different default filesystems, and not all filesystems work equally well across operating systems.\\ This page contains basic information about filesystems (file systems) and partitions. A filesystem is "how data is written in a partition of the storage device". Windows, macOS, and Linux use different default filesystems, and not all filesystems work equally well across operating systems.\\
  
-OpenWrt is a Linux-based operating system and thus typically works best with filesystems native to Linux. However it can also read/write data with Windows and macOS filesystems, albeit sometimes slower or less reliable than with native Linux filesystems. In case you wonder, the reason for this reduced performance is patents and other ways to impede the adoption of Microsoft or Apple filesystems by other parties.\\+OpenWrt is a Linux-based operating system and thus typically works best with filesystems native to Linux. However it can also read/write data with many filesystems, albeit sometimes slower or less reliable than with native Linux filesystems. In case you wonder, the reason for this reduced performance is patents and other ways to impede the adoption of Microsoft or Apple filesystems by other parties.\\
  
 Installing these additional filesystems in OpenWrt is commonly for file sharing using [[:docs:guide-user:storage:usb-drives-quickstart|USB 3.0 storage]] and [[:docs:guide-user:services:nas:cifs.server|Samba]].  Installing these additional filesystems in OpenWrt is commonly for file sharing using [[:docs:guide-user:storage:usb-drives-quickstart|USB 3.0 storage]] and [[:docs:guide-user:services:nas:cifs.server|Samba]]. 
 +
 ==== Check available filesystems ==== ==== Check available filesystems ====
 To see what filesystems can be read currently, enter ''cat /proc/filesystems''.\\  To see what filesystems can be read currently, enter ''cat /proc/filesystems''.\\ 
Line 19: Line 20:
 The two most common Linux filesystems are [[wp>ext4]] and [[wp>f2fs]], with [[wp>btrfs]] growing in popularity:\\  The two most common Linux filesystems are [[wp>ext4]] and [[wp>f2fs]], with [[wp>btrfs]] growing in popularity:\\ 
  
-  * ext4 is well suited for HDDs and SSDs (using TRIM) and is the default filesystem of most desktop Linux distributions +  * ext4 is well suited for HDDs and SSDs (using TRIM) and is the default filesystem of most desktop Linux distributions. 
-  * f2fs is well suited for flash (SSDs or USB thumbdrives)+  * f2fs is well suited for flash (SSDs or USB thumbdrives). The format can be incompatible between kernel versions, requiring some time for "fsck" to upgrade the filesystem. 
 +  * btrfs is the default filesystem for more cutting-edge Linux distributions. It is considered the sucessor to ext4, with the author stating "there will be no ext5". It has some more advanced features such as checksumming. 
 + 
 +==== ext4 ====
  
-==== Set up ext4 ==== 
 This command will download the tools needed to create and fix ext4 (and older versions)\\ This command will download the tools needed to create and fix ext4 (and older versions)\\
 ''opkg install e2fsprogs'' ''opkg install e2fsprogs''
Line 29: Line 32:
 ''opkg install kmod-fs-ext4'' ''opkg install kmod-fs-ext4''
  
-==== Set up f2fs ====+==== f2fs ====
 This command will download the tools needed to create and fix f2fs\\ This command will download the tools needed to create and fix f2fs\\
 ''opkg install f2fs-tools'' ''opkg install f2fs-tools''
Line 36: Line 39:
 ''opkg install kmod-fs-f2fs'' ''opkg install kmod-fs-f2fs''
  
 +==== btrfs ====
 +This command will download the tools needed to create and fix btrfs\\
 +''opkg install btrfs-progs''
 +
 +If in the list of supported filesystems in your device you don't see btrfs, you must install also the driver itself\\
 +''opkg install kmod-fs-btrfs''
  
 ===== Windows filesystems ===== ===== Windows filesystems =====
  
-The two most common filesystems used by Windows are [[wp>NTFS]] and [[wp>exFAT]].+The two most common filesystems used by Windows are [[wp>NTFS]] and [[wp>exFAT]] as described below.
  
-==== Set up NTFS ====+==== NTFS ====
  
 NTFS is the primary Windows filesystem and is available via the ''NTFS-3G'' driver. With kernel 5.15 onward the new [[https://www.phoronix.com/news/NTFS3-For-Linux-5.15|NTFS3 driver]] called ''NTFS3'' aims to provide improved performance as an in-kernel driver similar to other Linux filesystems. Either driver may be used in OpenWrt, however below is written for the legacy driver.\\ NTFS is the primary Windows filesystem and is available via the ''NTFS-3G'' driver. With kernel 5.15 onward the new [[https://www.phoronix.com/news/NTFS3-For-Linux-5.15|NTFS3 driver]] called ''NTFS3'' aims to provide improved performance as an in-kernel driver similar to other Linux filesystems. Either driver may be used in OpenWrt, however below is written for the legacy driver.\\
  
-Download and install via the NTFS-3G driver:\\+Download and install via the NTFS-3G driver\\
 ''opkg install ntfs-3g'' ''opkg install ntfs-3g''
  
-This command will download the tools needed to create and fix NTFS:\\ +This command will download the tools needed to create and fix NTFS\\ 
 ''opkg install ntfsprogs_ntfs-3g'' ''opkg install ntfsprogs_ntfs-3g''
  
-See [[docs:guide-user:storage:writable_ntfs|Writable NTFS]] for important information on mounting options for better performance and features. +See [[docs:guide-user:storage:writable_ntfs|Writable NTFS]] for important information on mounting options for better performance and features. TRIM is supported under Linux/OpenWRT.
- +
- +
-==== Set up exFAT ==== +
- +
-exFAT is commonly used by OEMs for external SSDs and SD cards. The downside to this filesystem is the lack of journaling support. As of Linux kernel 5.4 there is a [[https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.4-Released|new exFAT driver]] this is available with low overhead. This new driver is quite performant and will max out gigabit LAN at 120 MB/s using USB 3.0 external drives on some targets, as tested on the [[:toh:linksys:wrt_ac_series]]. exFAT will provide good performance while maintaining compatibility with Windows and macOS. +
- +
-This will install the driver to use exFAT and the tool to be able to run check disk if needed:\\ +
-''opkg install kmod-fs-exfat exfat-fsck''+
  
 ===== Apple filesystems ===== ===== Apple filesystems =====
 In Apple land you have [[wp>HFS]], [[wp>HFS+]] and [[wp>APFS]]. There is a driver available for HFS and HFS+ but it has low performance and does not support all features. APFS was introduced in 2017 but there is currently no support for it in OpenWrt (nor in Linux). In Apple land you have [[wp>HFS]], [[wp>HFS+]] and [[wp>APFS]]. There is a driver available for HFS and HFS+ but it has low performance and does not support all features. APFS was introduced in 2017 but there is currently no support for it in OpenWrt (nor in Linux).
  
-==== Set up HFS and HFS+ ====+==== HFS and HFS+ ====
 This command will download the tools needed to create and fix HFS and HFS+\\ This command will download the tools needed to create and fix HFS and HFS+\\
 ''opkg install hfsfsck'' ''opkg install hfsfsck''
Line 73: Line 74:
  
 ===== Multiplatform filesystems ===== ===== Multiplatform filesystems =====
 +
 +==== FAT32 ====
 [[wp>FAT32]] was a common multiplatform file system. It can be read/write by Windows, macOS, Linux, and any other device you might have (smartTV, tablets, car audio with usb, etc). Its has two major drawbacks given its age: it cannot store files larger than 3.9 GB, and it lacks journaling support, meaning it's also prone to corruption if the device is disconnected while writing. This can lead to data loss if the device is written again without running a filesystem check. [[wp>FAT32]] was a common multiplatform file system. It can be read/write by Windows, macOS, Linux, and any other device you might have (smartTV, tablets, car audio with usb, etc). Its has two major drawbacks given its age: it cannot store files larger than 3.9 GB, and it lacks journaling support, meaning it's also prone to corruption if the device is disconnected while writing. This can lead to data loss if the device is written again without running a filesystem check.
  
-==== Set up FAT32 ==== 
 This command will download the tools needed to create and fix FAT32 (and older versions)\\ This command will download the tools needed to create and fix FAT32 (and older versions)\\
 ''opkg install dosfstools'' (The dosfstools package includes the [[https://linux.die.net/man/8/mkfs.vfat|mkfs.fat]] and [[https://linux.die.net/man/8/fsck.vfat|fsck.fat]] utilities, which respectively make and check MS-DOS FAT filesystems.) ''opkg install dosfstools'' (The dosfstools package includes the [[https://linux.die.net/man/8/mkfs.vfat|mkfs.fat]] and [[https://linux.die.net/man/8/fsck.vfat|fsck.fat]] utilities, which respectively make and check MS-DOS FAT filesystems.)
Line 103: Line 105:
 | kmod-nls-utf8       | Kernel module for NLS UTF-8                                | | kmod-nls-utf8       | Kernel module for NLS UTF-8                                |
  
 +==== exFAT ====
 +
 +exFAT is commonly used by OEMs for external SSDs and SD cards. The downside to this filesystem is the lack of journaling support, which makes breakage during sudden poweroff more likely. exFAT will provide good performance while maintaining compatibility with Windows and macOS.
 +
 +As of Linux kernel 5.4 there is a [[https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.4-Released|new exFAT driver]] this is available with low overhead. This new driver is quite performant and will max out gigabit LAN at 120 MB/s using USB 3.0 external drives on some targets, as tested on the [[:toh:linksys:wrt_ac_series]]. 
 +
 +This will install the driver to use exFAT and the tool to be able to run check disk if needed:\\
 +''opkg install kmod-fs-exfat exfat-fsck''
 +
 +Under Windows, exFAT does not support TRIM; but under Linux/OpenWRT, it does.
  
 ===== Partitions ===== ===== Partitions =====
  • Last modified: 2024/10/31 23:23
  • by palebloodsky