=========================================================
ϡ
Linux-2.6.29/Documentation/filesystems/ubifs.txt 
Ǥ
Ρ JF ץ < http://www.linux.or.jp/JF/ >
  2009/03/25
  Seiji Kaneko < skaneko at mbn dot or dot jp >
  Masanori Kobayashi < zap03216 at nifty dot ne dot jp >
=========================================================
#Introduction
#=============
Ϥ
========

#UBIFS file-system stands for UBI File System. UBI stands for "Unsorted
#Block Images". UBIFS is a flash file system, which means it is designed
#to work with flash devices. It is important to understand, that UBIFS
#is completely different to any traditional file-system in Linux, like
#Ext2, XFS, JFS, etc. UBIFS represents a separate class of file-systems
#which work with MTD devices, not block devices. The other Linux
#file-system of this class is JFFS2.
UBIFS ե륷ƥ UBI ե륷ƥफƤޤUBI Ȥϡ֥
ȤƤʤ֥å᡼פƬʸäƤޤUBIFS ϥեå
ե륷ƥǡեåǥХư褦߷פƤޤ
ξǽפϡUBIFS  Linux νΥե륷ƥ (㤨 Ext2
XFSJFS ) ΤȤۤʤΤǤȸȤǤUBIFS ϡ֥
åǥХǤϤʤ MTD ǥХư̤Υե륷ƥΥ饹
ɽƤޤʳˤΥ饹°ե륷ƥˤ JFFS2 
ޤ

#To make it more clear, here is a small comparison of MTD devices and
#block devices.
⤦Τˤ뤿ˡʲ MTD ǥХȥ֥åǥХδñ
򤷤ޤ礦

#1 MTD devices represent flash devices and they consist of eraseblocks of
#  rather large size, typically about 128KiB. Block devices consist of
#  small blocks, typically 512 bytes.
1 MTD ǥХϥեåǥХбŪ礭ʥΥ졼
  å(õñ)̾ 128KiB鹽ޤ֥åǥХ̾ 
  512Byte Ūʥ֥åǹޤ
#2 MTD devices support 3 main operations - read from some offset within an
#  eraseblock, write to some offset within an eraseblock, and erase a whole
#  eraseblock. Block  devices support 2 main operations - read a whole
#  block and write a whole block.
2 MTD ǥХϼ 3 Ĥ򥵥ݡȤƤޤ졼֥åλ
  եåͤɤ (read)졼֥åǻꥪեåͤ˽ 
  (write)졼֥åΤõ (erase)Ǥ֥åǥХ
  Ǥϼ 2 ĤԤʤޤ֥åΤɤफ֥åΤ˽񤯤
  Ǥ
#3 The whole eraseblock has to be erased before it becomes possible to
#  re-write its contents. Blocks may be just re-written.
3 ǡƽ񤭹ߤǤ褦ˤˤϡ˥졼֥åΤõ
  ʤФʤޤ󡣥֥åʤñ˾񤭤뤳ȤǤޤ
#4 Eraseblocks become worn out after some number of erase cycles -
#  typically 100K-1G for SLC NAND and NOR flashes, and 1K-10K for MLC
#  NAND flashes. Blocks do not have the wear-out property.
4 졼֥åϷ줿졼塢̿ޤޤSLC NAND 
   NOR եåǤ̾ 100K-1G ǡMLC NAND եåǤ 1K-10K
  Ǥ֥åϼ̿Ȥޤ
#5 Eraseblocks may become bad (only on NAND flashes) and software should
#  deal with this. Blocks on hard drives typically do not become bad,
#  because hardware has mechanisms to substitute bad blocks, at least in
#  modern LBA disks.
5 졼֥å (̿ˤ) ɤˤʤ礬 (NAND եåΤߤǵ
  ޤ) եȥнԤʤʤФʤޤ󡣥ϡɥɥ饤־Υ֥
  ̾ɤˤϤʤޤ󡣤ϺǶ LBA ǥˤ (ưŪ) ɥ֥
  å֤ϡɥǽ¢Ƥ뤿Ǥ

#It should be quite obvious why UBIFS is very different to traditional
#file-systems.
ˤꡢUBIFS Υե륷ƥ礭ۤʤäƤͳ餫
Ǥ礦

#UBIFS works on top of UBI. UBI is a separate software layer which may be
#found in drivers/mtd/ubi. UBI is basically a volume management and
#wear-leveling layer. It provides so called UBI volumes which is a higher
#level abstraction than a MTD device. The programming model of UBI devices
#is very similar to MTD devices - they still consist of large eraseblocks,
#they have read/write/erase operations, but UBI devices are devoid of
#limitations like wear and bad blocks (items 4 and 5 in the above list).
UBIFS  UBI ưޤUBI ΩΥեȥ쥤ǡ
drivers/mtd/ubi ʲˤޤUBI ϴŪˤϥܥ塼ȥ
 (̿) Ԥʤ쥤ǤˤꡢMTD ǥХ̤
ݲʤ줿UBI ܥ塼פȸƤФܥ塼ब󶡤ޤUBI 
ХΥץߥ󥰥ǥϡMTD ǥХΤΤȤ褯Ƥޤ - ξ
礭ʥ졼֥åʤꡢread/write/erase ޤâ UBI
ǥХϡ̿ɥ֥åʤɤ (嵭ΥꥹȤ 4  5) ϻޤ


#In a sense, UBIFS is a next generation of JFFS2 file-system, but it is
#very different and incompatible to JFFS2. The following are the main
#differences.
UBIFS Ϥ JFFS2 ե륷ƥμǤǤJFFS2 Ȥ礭ۤ
äƤߴ⤢ޤ󡣰ʲǤ

#* JFFS2 works on top of MTD devices, UBIFS depends on UBI and works on
#  top of UBI volumes.
#* JFFS2 does not have on-media index and has to build it while mounting,
#  which requires full media scan. UBIFS maintains the FS indexing
#  information on the flash media and does not require full media scan,
#  so it mounts many times faster than JFFS2.
#* JFFS2 is a write-through file-system, while UBIFS supports write-back,
#  which makes UBIFS much faster on writes.
* JFFS2  MTD ǥХưޤUBIFS  UBI ˰¸UBI ܥ塼
  ưޤ
* JFFS2 ˤϥǥ˥ǥåޥȻ˺ɬפ
  뤿ᡢǥΤΥɬפˤʤޤUBIFS Ǥ FS ǥå
  եåǥݻǥΤΥɬפ
  󡣤ä JFFS2 Ϥ뤫˹®˥ޥȲǽǤ
* JFFS2 ϥ饤ȥ롼פΥե륷ƥǡUBIFS ϥ饤ȥХå
  פΥե륷ƥǤΤᡢUBIFS Ͻ񤭹ߤäȹ®Ǥ

#Similarly to JFFS2, UBIFS supports on-the-flight compression which makes
#it possible to fit quite a lot of data to the flash.
JFFS2 Ʊͤ UBIFS Ǥɤ߽Ф񤭹߻ΰ̤򥵥ݡȤƤꡢե
å˼¤¿Υǡ뤳ȤǤޤ

#Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts.
#It does not need stuff like fsck.ext2. UBIFS automatically replays its
#journal and recovers from crashes, ensuring that the on-flash data
#structures are consistent.
JFFS2 Ʊͤ UBIFS ֡ȤŸǤФޤfsck.ext2 
褦ʽɬפޤUBIFS ϼưŪ˥㡼ʥץ쥤
夫ޤեåΥǡ¤ϰӤΤݤޤ

#UBIFS scales logarithmically (most of the data structures it uses are
#trees), so the mount time and memory consumption do not linearly depend
#on the flash size, like in case of JFFS2. This is because UBIFS
#maintains the FS index on the flash media. However, UBIFS depends on
#UBI, which scales linearly. So overall UBI/UBIFS stack scales linearly.
#Nevertheless, UBI/UBIFS scales considerably better than JFFS2.
UBIFS  (ǽ̤Ǥ) ĥϡեå奵п (Ѥؤɤ
ǡ¤ڹ¤Ǥ뤿) JFFS2 Τ褦˥ޥȻ֤ȥ̤
եå奵ˤϰ켡㤹뤳ȤϤޤ󡣤 UBIFS ե륷
ƥ।ǥåեåǥ֤Ƥ뤿ǤâUBIFS  
UBI ˰¸UBI ϥեå奵㤷ǽ̤ǤγĥĤᡢ
ΤȤ UBI/UBIFS åǽϥեå奵㤷ΤȤʤޤ
Ǥ⡢UBI/UBIFS γĥ JFFS2 ͭդͥ줿ΤǤ

#The authors of UBIFS believe, that it is possible to develop UBI2 which
#would scale logarithmically as well. UBI2 would support the same API as UBI,
#but it would be binary incompatible to UBI. So UBIFS would not need to be
#changed to use UBI2
UBIFS κԤϡĥեå奵п㤹 UBI2 Τ褦 UBI 
ϺǽȹͤƤޤUBI2  UBI Ʊ API ޤUBI ȥ
ʥߴˤʤǤ礦UBIFS ˤ UBI2 ؤѹɬפʤȹͤƤޤ


#Mount options
#=============
ޥȻΥץ
======================

#(*) == default.
(*) == 

#bulk_read		read more in one go to take advantage of flash
#			media that read faster sequentially
#no_bulk_read (*)	do not bulk-read
bulk_read		󥷥꡼ɤ®ʥեåǥ
			ᡢ礭ʥǡɤ߽Ф
no_bulk_read (*)	bulk_read Ԥʤʤ
#no_chk_data_crc		skip checking of CRCs on data nodes in order to
#			improve read performance. Use this option only
#			if the flash media is highly reliable. The effect
#			of this option is that corruption of the contents
#			of a file can go unnoticed.
#chk_data_crc (*)	do not skip checking CRCs on data nodes
no_chk_data_crc		꡼ɹ®ΤᡢǡΡɤ CRC å
			ά롣Υץϥեåǥ
			⤤Τߤ˻Ѥ뤳ȡΥץ
			ѤˤꡢեƤ˲Ťʤ
			ޤޤȤʤǽޤ
chk_data_crc (*)	ǡΡɤ CRC åάʤ
#compr=none              override default compressor and set it to "none"
#compr=lzo               override default compressor and set it to "lzo"
#compr=zlib              override default compressor and set it to "zlib"
compr=none              ɸΰ񤭤֤ʤפˤ롣
compr=lzo               ɸΰ񤭤lzoפˤ롣
compr=zlib              ɸΰ񤭤zlibפˤ롣


#Quick usage instructions
#========================
ñˡ
==============

#The UBI volume to mount is specified using "ubiX_Y" or "ubiX:NAME" syntax,
#where "X" is UBI device number, "Y" is UBI volume number, and "NAME" is
#UBI volume name.
ޥȤȤ褦Ȥ UBI ܥ塼 ubiX_Y ޤ ubiX:NAME ν񼰤ǻ
ꤷޤ X  UBI ǥХֹ桢Y  UBI ܥ塼ֹ桢NAME  
UBI ܥ塼̾Ǥ

#Mount volume 0 on UBI device 0 to /mnt/ubifs:
/mnt/ubifs  UBI ǥХ 0 ܥ塼 0 ޥȤ롣
$ mount -t ubifs ubi0_0 /mnt/ubifs

#Mount "rootfs" volume of UBI device 0 to /mnt/ubifs ("rootfs" is volume
#name):
/mnt/ubifs  UBI ǥХ 0  "rootfs" ޥȤ ("rootfs" ϥܥ
̾)
$ mount -t ubifs ubi0:rootfs /mnt/ubifs

#The following is an example of the kernel boot arguments to attach mtd0
#to UBI and mount volume "rootfs":
#ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs
ʲϡmtd0  UBI ˥åơ"rootfs" ޥȤ륫ͥ֡
ѥ᡼Ǥ
ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs


#Module Parameters for Debugging
#===============================
ǥХåΤΥ⥸塼ѥ᡼
====================================

#When UBIFS has been compiled with debugging enabled, there are 3 module
#parameters that are available to control aspects of testing and debugging.
#The parameters are unsigned integers where each bit controls an option.
#The parameters are:
UBIFS ǥХåǽͭˤƥѥ뤷硢ƥȤǥХåεǽ
椹뤿 3 ĤΥ⥸塼ѥ᡼󶡤Ƥޤ
ѥ᡼̵ǡƥӥåȤץ椷ޤ
ѥ᡼ϰʲ̤Ǥ

#debug_msgs	Selects which debug messages to display, as follows:
debug_msgs	ʲΤ褦ˤɽǥХååꤷޤ

#		Message Type				Flag value
		å			ե饰

#		General messages			1
#		Journal messages			2
#		Mount messages				4
#		Commit messages				8
#		LEB search messages			16
#		Budgeting messages			32
#		Garbage collection messages		64
#		Tree Node Cache (TNC) messages		128
#		LEB properties (lprops) messages	256
#		Input/output messages			512
#		Log messages				1024
#		Scan messages				2048
#		Recovery messages			4096
		̥å				1
		㡼ʥå			2
		ޥȥå				4
		ߥåȥå				8
		LEB å			16
		ͽ					32
		١쥯ȥå			64
		Tree Node Cache(TNC) å		128
		LEB ץѥƥ (lprops) å		256
		ϥå				512
		å				1024
		å				2048
		ꥫХå				4096

#debug_chks	Selects extra checks that UBIFS can do while running:
debug_chks	UBIFS ¹Ի˼»ܤǤɲäΥåǽ򤹤

#		Check					Flag value
		å				ե饰

#		General checks				1
#		Check Tree Node Cache (TNC)		2
#		Check indexing tree size		4
#		Check orphan area			8
#		Check old indexing tree			16
#		Check LEB properties (lprops)		32
#		Check leaf nodes and inodes		64
		̤Υå				1
		Tree Node Cache (TNC) Υå		2
		ǥåڥå			4
		orchan ꥢå			8
		쥤ǥåڤΥå			16
		LEB ץѥƥ (lprops) å		32
		꡼եΡɤ inode Υå		64

#debug_tsts	Selects a mode of testing, as follows:
debug_tsts	ƥȥ⡼ɤʲΤ褦ꤹ

#		Test mode				Flag value
		ƥȥ⡼				ե饰

#		Force in-the-gaps method		2
#		Failure mode for recovery testing	4
		in-the-gap ˡ򤹤			2
		ꥫХƥȤΤθξ⡼		4

#For example, set debug_msgs to 5 to display General messages and Mount
#messages.
㤨С̥åȥޥȥåɽˤϡdebug_msgs 
5 ˥åȤޤ


#References
#==========
ʸ
========

#UBIFS documentation and FAQ/HOWTO at the MTD web site:
UBIFS βʸ FAQ/HOWTO  MTD ֥Ȥˤޤ
http://www.linux-mtd.infradead.org/doc/ubifs.html
http://www.linux-mtd.infradead.org/faq/ubifs.html

