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
docs:techref:filesystems [2018/06/07 20:12] – link fixed; cleanup tmomasdocs:techref:filesystems [2024/03/09 03:22] (current) – [Filesystems] add link to intro palebloodsky
Line 1: Line 1:
 ====== Filesystems ====== ====== Filesystems ======
  
-This article is about file systems in the OpenWrt installation on built-in flash+This article is about file systems used by OpenWrt for device built-in flash.
-For general external support for installing file systems on other devices, including partitioning and mounting see [[docs:guide-user:storage:start|this page about general storage]].+
  
-Please read about the -> [[flash.layout]] as well. Also, note that there are two types of flash memory: [[wp>Flash_memory#NOR_flash|NOR flash]] and [[wp>Flash_memory#NAND_flash|NAND flash]]. Also, you should read up on ''[[docs:techref:mtd]]''+For installing additional file systems, including partitioning and mounting, see this page for [[docs:guide-user:storage:start|general storage]] as well as this page to other common [[:docs:guide-user:storage:filesystems-and-partitions|filesystems]]. 
 + 
 +Please read about the [[flash.layout]] as well. Also, note that there are two types of flash memory: [[wp>Flash_memory#NOR_flash|NOR flash]] and [[wp>Flash_memory#NAND_flash|NAND flash]]. See also [[docs:techref:mtd]]. 
  
 ===== Common File System ===== ===== Common File System =====
Line 10: Line 11:
 ==== OverlayFS ==== ==== OverlayFS ====
 Used to merge two filesystems, one read-only and the other writable. [[flash.layout]] explains how this is used in OpenWrt. Used to merge two filesystems, one read-only and the other writable. [[flash.layout]] explains how this is used in OpenWrt.
 +  * [[wp>OverlayFS]]
 +  * [[https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html|Overlayfs documentation]]
   * [[https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-2.6.38/209-overlayfs.patch?rev=26213]]   * [[https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-2.6.38/209-overlayfs.patch?rev=26213]]
-  * [[http://lwn.net/Articles/447650/]] +  * [[http://lwn.net/Articles/447650/|Debating overlayfs]] on LWN.net 
-  * was mainlined in Linux kernel 3.18, see [[https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/filesystems/overlayfs.txt|/Documentation/filesystems/overlayfs.txt]] +  * Was mainlined in Linux kernel 3.18
-  * [[https://git.kernel.org/cgit/linux/kernel/git/mszeredi/vfs.git/tree/Documentation/filesystems/overlayfs.txt?h=overlayfs.current | Overlayfs documentation]] in the official development tree+
   * Overlayfs's support for inotify mechanisms is not complete yet. Events like IN_CLOSE_WRITE cannot be notified to listening process.   * Overlayfs's support for inotify mechanisms is not complete yet. Events like IN_CLOSE_WRITE cannot be notified to listening process.
 +
  
 ==== tmpfs ==== ==== tmpfs ====
-  * [[wp>tmpfs]] +[[wp>tmpfs]] is implemented on many Unix-like operating systems (including OpenWrt). It operates similar to a RAM-Disk, without writing files to disk. In OpenWrt, ''/tmp'' resides on a tmpfs-partition and ''/var'' is a symlink to it; ''/dev'' resides on a little tmpfs partition of its own
-  * ''/tmp'' resides on a tmpfs-partition and ''/var'' is a symlink to it; ''/dev'' resides on a little tmpfs partition of its own + 
-  * (+) no wear leveling+  * [[https://www.kernel.org/doc/html/latest/filesystems/tmpfs.html|Kernel documentation on tmpfs]] 
 + 
 +  * (+) doesn't directly use space on non-volatile storage 
 +  * (-) no wear leveling
   * (-) volatile (doesn't survive a reboot)   * (-) volatile (doesn't survive a reboot)
-  * [[http://lxr.free-electrons.com/source/Documentation/filesystems/tmpfs.txt|Kernel documentation on tmpfs]] 
  
 ==== SquashFS ==== ==== SquashFS ====
Line 30: Line 35:
   * (-) read only   * (-) read only
   * (-) waste space, since each time a file contained on it is modified, actually a copy of it is being copied to the second (JFFS2) partition   * (-) waste space, since each time a file contained on it is modified, actually a copy of it is being copied to the second (JFFS2) partition
-  * [[http://lxr.free-electrons.com/source/Documentation/filesystems/squashfs.txt|Kernel documentation on SquashFS]] +  * [[https://www.kernel.org/doc/html/latest/filesystems/squashfs.html|Kernel documentation on SquashFS]] 
-  * [[http://tree.celinuxforum.org/CelfPubWiki/SquashFsComparisons|SquashFs Performance Comparisons]]+  * [[https://elinux.org/Squash_Fs_Comparisons|SquashFs Performance Comparisons]]
  
-There is a generic problem when running SquashFS on NAND: The issue is that SquashFS has no bad block management at all and requires all blocks on order; but for proper NAND bad block management you also need to be able to skip bad blocks and occasionally relocate blocks (see [[http://www.infradead.org/pipermail/linux-mtd/2006-April/015386.html|squashfs and NAND flash]]). That's why raw SquashFS is a bad idea on NAND (it works if you use a FTL like UBIFS).+There is a generic problem when running SquashFS on NAND: The issue is that SquashFS has no bad block management at all and requires all blocks on order; but for proper NAND bad block management you also need to be able to skip bad blocks and occasionally relocate blocks (see [[https://www.infradead.org/pipermail/linux-mtd/2006-April/015386.html|squashfs and NAND flash]]). That's why raw SquashFS is a bad idea on NAND (it works if you use a FTL like UBIFS).
  
 ==== JFFS2 ==== ==== JFFS2 ====
Line 42: Line 47:
   * (-) is compressed, so a program (''[[docs:guide-user:additional-software:opkg]]'' in particular) cannot know in advance how much space a package will occupy   * (-) is compressed, so a program (''[[docs:guide-user:additional-software:opkg]]'' in particular) cannot know in advance how much space a package will occupy
   * (+) is compressed, so a program (which is preinstalled) takes much less space, so effectively you have more space   * (+) is compressed, so a program (which is preinstalled) takes much less space, so effectively you have more space
 +
 +For NAND-flash targets, it was replaced with UBIFS.
  
 ==== UBIFS ==== ==== UBIFS ====
   * [[wp>UBIFS]] is a file system for [[docs:techref:flash.layout|raw flash]]. It is used in OpenWrt NAND targets since :FIXME: around r40364   * [[wp>UBIFS]] is a file system for [[docs:techref:flash.layout|raw flash]]. It is used in OpenWrt NAND targets since :FIXME: around r40364
-  * [[http://lxr.free-electrons.com/source/Documentation/filesystems/ubifs.txt|Kernel documentation on UBIFS]] +  * [[https://www.kernel.org/doc/html/latest/filesystems/ubifs.html|Kernel documentation on UBIFS]] 
-  * [[https://lwn.net/Articles/704261/]] how does UBIFS understand what a "file" is? Isn't a file +  * [[https://lwn.net/Articles/704261/|UBIFS File Encryption]] how does UBIFS understand what a "file" is? Isn't a file 
-  * [[https://lwn.net/Articles/706338/]] +  * [[https://lwn.net/Articles/706338/|UBIFS File Encryption v1]] on LWN.net 
-  * [[https://lwn.net/Articles/707900/]]+  * [[https://lwn.net/Articles/707900/|UBIFS File Encryption v2]] on LWN.net
   * [[https://www.phoronix.com/scan.php?page=news_item&px=UBI-UBIFS-Linux-4.9|UBIFS Supports OverlayFS In Linux 4.9, Readying UBI For MLC Support]]   * [[https://www.phoronix.com/scan.php?page=news_item&px=UBI-UBIFS-Linux-4.9|UBIFS Supports OverlayFS In Linux 4.9, Readying UBI For MLC Support]]
  
Line 54: Line 61:
   * [[wp>ext2]]   * [[wp>ext2]]
   * Ext2/3/4 is used on x86, x86-64 and for some arch with SD-card rootfs   * Ext2/3/4 is used on x86, x86-64 and for some arch with SD-card rootfs
-  * [[http://lxr.free-electrons.com/source/Documentation/filesystems/ext2.txt|Kernel documentation on ext2]]+  * [[https://www.kernel.org/doc/html/latest/filesystems/ext2.html|Kernel documentation on ext2]]
   * (+) a program (''[[docs:guide-user:additional-software:opkg]]'' in particularly) knows how much space is left!   * (+) a program (''[[docs:guide-user:additional-software:opkg]]'' in particularly) knows how much space is left!
   * (+) good ol' veteran FOSS file system   * (+) good ol' veteran FOSS file system
-  * (-) no journaling+  * (-) no journaling (ext3, ext4 support journaling)
   * (-) no wear leveling   * (-) no wear leveling
   * (-) no transparent compression   * (-) no transparent compression
Line 64: Line 71:
 ===== Other filesystems ===== ===== Other filesystems =====
  
-OpenWrt does not use other filesystems as rootfs. It supports several filesystem attached to via various mechanisms like USB, SATA or network. For a list see [[docs:guide-user:storage:start]].+OpenWrt does not use other filesystems as rootfs. It supports several filesystems attached to via various mechanisms like USB, SATA or network. For a list see [[docs:guide-user:storage:start]].
  
 ==== mini_fo ==== ==== mini_fo ====
   * was used by older OpenWrt version and thus there are still references to this in the Wiki   * was used by older OpenWrt version and thus there are still references to this in the Wiki
   * replaced by [[#OverlayFS]] now.   * replaced by [[#OverlayFS]] now.
-  * [[https://lwn.net/Articles/135283]] +  * [[https://lwn.net/Articles/135283|The mini_fo filesystem]] on LWN.net 
-  * [[http://www.denx.de/wiki/bin/view/Know/MiniFOHome]]+  * [[https://www.denx.de/wiki/bin/view/Know/MiniFOHome|mini_fo: The mini fanout overlay file system]] official site
  
  
Line 134: Line 141:
  
 ===== Notes ===== ===== Notes =====
-Example pictures: on formated partition / how data is stored (and addressed on ext3)+Example pictures: on formatted partition / how data is stored (and addressed on ext3)
   * how data is stored and addressed by ext2:   * how data is stored and addressed by ext2:
   * how data is stored and addressed by ext3:   * how data is stored and addressed by ext3:
  • Last modified: 2018/06/07 20:12
  • by tmomas