1 .. SPDX-License-Identifier: GPL-2.0 2 3 =============== 4 UBI File System 5 =============== 6 7 Introduction 8 ============ 9 10 UBIFS file-system stands for UBI File System. 11 Block Images". UBIFS is a flash file system, w 12 to work with flash devices. It is important to 13 is completely different to any traditional fil 14 Ext2, XFS, JFS, etc. UBIFS represents a separa 15 which work with MTD devices, not block devices 16 file-system of this class is JFFS2. 17 18 To make it more clear, here is a small compari 19 block devices. 20 21 1 MTD devices represent flash devices and they 22 rather large size, typically about 128KiB. B 23 small blocks, typically 512 bytes. 24 2 MTD devices support 3 main operations - read 25 eraseblock, write to some offset within an e 26 eraseblock. Block devices support 2 main op 27 block and write a whole block. 28 3 The whole eraseblock has to be erased before 29 re-write its contents. Blocks may be just re 30 4 Eraseblocks become worn out after some numbe 31 typically 100K-1G for SLC NAND and NOR flash 32 NAND flashes. Blocks do not have the wear-ou 33 5 Eraseblocks may become bad (only on NAND fla 34 deal with this. Blocks on hard drives typica 35 because hardware has mechanisms to substitut 36 modern LBA disks. 37 38 It should be quite obvious why UBIFS is very d 39 file-systems. 40 41 UBIFS works on top of UBI. UBI is a separate s 42 found in drivers/mtd/ubi. UBI is basically a v 43 wear-leveling layer. It provides so called UBI 44 level abstraction than a MTD device. The progr 45 is very similar to MTD devices - they still co 46 they have read/write/erase operations, but UBI 47 limitations like wear and bad blocks (items 4 48 49 In a sense, UBIFS is a next generation of JFFS 50 very different and incompatible to JFFS2. The 51 differences. 52 53 * JFFS2 works on top of MTD devices, UBIFS dep 54 top of UBI volumes. 55 * JFFS2 does not have on-media index and has t 56 which requires full media scan. UBIFS mainta 57 information on the flash media and does not 58 so it mounts many times faster than JFFS2. 59 * JFFS2 is a write-through file-system, while 60 which makes UBIFS much faster on writes. 61 62 Similarly to JFFS2, UBIFS supports on-the-fly 63 it possible to fit quite a lot of data to the 64 65 Similarly to JFFS2, UBIFS is tolerant of uncle 66 It does not need stuff like fsck.ext2. UBIFS a 67 journal and recovers from crashes, ensuring th 68 structures are consistent. 69 70 UBIFS scales logarithmically (most of the data 71 trees), so the mount time and memory consumpti 72 on the flash size, like in case of JFFS2. This 73 maintains the FS index on the flash media. How 74 UBI, which scales linearly. So overall UBI/UBI 75 Nevertheless, UBI/UBIFS scales considerably be 76 77 The authors of UBIFS believe, that it is possi 78 would scale logarithmically as well. UBI2 woul 79 but it would be binary incompatible to UBI. So 80 changed to use UBI2 81 82 83 Mount options 84 ============= 85 86 (*) == default. 87 88 ==================== ====================== 89 bulk_read read more in one go to 90 media that read faster 91 no_bulk_read (*) do not bulk-read 92 no_chk_data_crc (*) skip checking of CRCs 93 improve read performan 94 if the flash media is 95 of this option is that 96 of a file can go unnot 97 chk_data_crc do not skip checking C 98 compr=none override default compr 99 compr=lzo override default compr 100 compr=zlib override default compr 101 auth_key= specify the key used f 102 Passing this option ma 103 The passed key must be 104 and must be of type 'l 105 auth_hash_name= The hash algorithm use 106 both hashing and for c 107 include "sha256" or "s 108 ==================== ====================== 109 110 111 Quick usage instructions 112 ======================== 113 114 The UBI volume to mount is specified using "ub 115 where "X" is UBI device number, "Y" is UBI vol 116 UBI volume name. 117 118 Mount volume 0 on UBI device 0 to /mnt/ubifs:: 119 120 $ mount -t ubifs ubi0_0 /mnt/ubifs 121 122 Mount "rootfs" volume of UBI device 0 to /mnt/ 123 name):: 124 125 $ mount -t ubifs ubi0:rootfs /mnt/ubifs 126 127 The following is an example of the kernel boot 128 to UBI and mount volume "rootfs": 129 ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs 130 131 References 132 ========== 133 134 UBIFS documentation and FAQ/HOWTO at the MTD w 135 136 - http://www.linux-mtd.infradead.org/doc/ubifs 137 - http://www.linux-mtd.infradead.org/faq/ubifs
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.