ext3.txt 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. Ext3 Filesystem
  2. ===============
  3. Ext3 was originally released in September 1999. Written by Stephen Tweedie
  4. for the 2.2 branch, and ported to 2.4 kernels by Peter Braam, Andreas Dilger,
  5. Andrew Morton, Alexander Viro, Ted Ts'o and Stephen Tweedie.
  6. Ext3 is the ext2 filesystem enhanced with journalling capabilities.
  7. Options
  8. =======
  9. When mounting an ext3 filesystem, the following option are accepted:
  10. (*) == default
  11. ro Mount filesystem read only. Note that ext3 will replay
  12. the journal (and thus write to the partition) even when
  13. mounted "read only". Mount options "ro,noload" can be
  14. used to prevent writes to the filesystem.
  15. journal=update Update the ext3 file system's journal to the current
  16. format.
  17. journal=inum When a journal already exists, this option is ignored.
  18. Otherwise, it specifies the number of the inode which
  19. will represent the ext3 file system's journal file.
  20. journal_path=path
  21. journal_dev=devnum When the external journal device's major/minor numbers
  22. have changed, these options allow the user to specify
  23. the new journal location. The journal device is
  24. identified through either its new major/minor numbers
  25. encoded in devnum, or via a path to the device.
  26. norecovery Don't load the journal on mounting. Note that this forces
  27. noload mount of inconsistent filesystem, which can lead to
  28. various problems.
  29. data=journal All data are committed into the journal prior to being
  30. written into the main file system.
  31. data=ordered (*) All data are forced directly out to the main file
  32. system prior to its metadata being committed to the
  33. journal.
  34. data=writeback Data ordering is not preserved, data may be written
  35. into the main file system after its metadata has been
  36. committed to the journal.
  37. commit=nrsec (*) Ext3 can be told to sync all its data and metadata
  38. every 'nrsec' seconds. The default value is 5 seconds.
  39. This means that if you lose your power, you will lose
  40. as much as the latest 5 seconds of work (your
  41. filesystem will not be damaged though, thanks to the
  42. journaling). This default value (or any low value)
  43. will hurt performance, but it's good for data-safety.
  44. Setting it to 0 will have the same effect as leaving
  45. it at the default (5 seconds).
  46. Setting it to very large values will improve
  47. performance.
  48. barrier=<0|1(*)> This enables/disables the use of write barriers in
  49. barrier (*) the jbd code. barrier=0 disables, barrier=1 enables.
  50. nobarrier This also requires an IO stack which can support
  51. barriers, and if jbd gets an error on a barrier
  52. write, it will disable again with a warning.
  53. Write barriers enforce proper on-disk ordering
  54. of journal commits, making volatile disk write caches
  55. safe to use, at some performance penalty. If
  56. your disks are battery-backed in one way or another,
  57. disabling barriers may safely improve performance.
  58. The mount options "barrier" and "nobarrier" can
  59. also be used to enable or disable barriers, for
  60. consistency with other ext3 mount options.
  61. user_xattr Enables Extended User Attributes. Additionally, you
  62. need to have extended attribute support enabled in the
  63. kernel configuration (CONFIG_EXT3_FS_XATTR). See the
  64. attr(5) manual page and http://acl.bestbits.at/ to
  65. learn more about extended attributes.
  66. nouser_xattr Disables Extended User Attributes.
  67. acl Enables POSIX Access Control Lists support.
  68. Additionally, you need to have ACL support enabled in
  69. the kernel configuration (CONFIG_EXT3_FS_POSIX_ACL).
  70. See the acl(5) manual page and http://acl.bestbits.at/
  71. for more information.
  72. noacl This option disables POSIX Access Control List
  73. support.
  74. reservation
  75. noreservation
  76. bsddf (*) Make 'df' act like BSD.
  77. minixdf Make 'df' act like Minix.
  78. check=none Don't do extra checking of bitmaps on mount.
  79. nocheck
  80. debug Extra debugging information is sent to syslog.
  81. errors=remount-ro Remount the filesystem read-only on an error.
  82. errors=continue Keep going on a filesystem error.
  83. errors=panic Panic and halt the machine if an error occurs.
  84. (These mount options override the errors behavior
  85. specified in the superblock, which can be
  86. configured using tune2fs.)
  87. data_err=ignore(*) Just print an error message if an error occurs
  88. in a file data buffer in ordered mode.
  89. data_err=abort Abort the journal if an error occurs in a file
  90. data buffer in ordered mode.
  91. grpid Give objects the same group ID as their creator.
  92. bsdgroups
  93. nogrpid (*) New objects have the group ID of their creator.
  94. sysvgroups
  95. resgid=n The group ID which may use the reserved blocks.
  96. resuid=n The user ID which may use the reserved blocks.
  97. sb=n Use alternate superblock at this location.
  98. quota These options are ignored by the filesystem. They
  99. noquota are used only by quota tools to recognize volumes
  100. grpquota where quota should be turned on. See documentation
  101. usrquota in the quota-tools package for more details
  102. (http://sourceforge.net/projects/linuxquota).
  103. jqfmt=<quota type> These options tell filesystem details about quota
  104. usrjquota=<file> so that quota information can be properly updated
  105. grpjquota=<file> during journal replay. They replace the above
  106. quota options. See documentation in the quota-tools
  107. package for more details
  108. (http://sourceforge.net/projects/linuxquota).
  109. Specification
  110. =============
  111. Ext3 shares all disk implementation with the ext2 filesystem, and adds
  112. transactions capabilities to ext2. Journaling is done by the Journaling Block
  113. Device layer.
  114. Journaling Block Device layer
  115. -----------------------------
  116. The Journaling Block Device layer (JBD) isn't ext3 specific. It was designed
  117. to add journaling capabilities to a block device. The ext3 filesystem code
  118. will inform the JBD of modifications it is performing (called a transaction).
  119. The journal supports the transactions start and stop, and in case of a crash,
  120. the journal can replay the transactions to quickly put the partition back into
  121. a consistent state.
  122. Handles represent a single atomic update to a filesystem. JBD can handle an
  123. external journal on a block device.
  124. Data Mode
  125. ---------
  126. There are 3 different data modes:
  127. * writeback mode
  128. In data=writeback mode, ext3 does not journal data at all. This mode provides
  129. a similar level of journaling as that of XFS, JFS, and ReiserFS in its default
  130. mode - metadata journaling. A crash+recovery can cause incorrect data to
  131. appear in files which were written shortly before the crash. This mode will
  132. typically provide the best ext3 performance.
  133. * ordered mode
  134. In data=ordered mode, ext3 only officially journals metadata, but it logically
  135. groups metadata and data blocks into a single unit called a transaction. When
  136. it's time to write the new metadata out to disk, the associated data blocks
  137. are written first. In general, this mode performs slightly slower than
  138. writeback but significantly faster than journal mode.
  139. * journal mode
  140. data=journal mode provides full data and metadata journaling. All new data is
  141. written to the journal first, and then to its final location.
  142. In the event of a crash, the journal can be replayed, bringing both data and
  143. metadata into a consistent state. This mode is the slowest except when data
  144. needs to be read from and written to disk at the same time where it
  145. outperforms all other modes.
  146. Compatibility
  147. -------------
  148. Ext2 partitions can be easily convert to ext3, with `tune2fs -j <dev>`.
  149. Ext3 is fully compatible with Ext2. Ext3 partitions can easily be mounted as
  150. Ext2.
  151. External Tools
  152. ==============
  153. See manual pages to learn more.
  154. tune2fs: create a ext3 journal on a ext2 partition with the -j flag.
  155. mke2fs: create a ext3 partition with the -j flag.
  156. debugfs: ext2 and ext3 file system debugger.
  157. ext2online: online (mounted) ext2 and ext3 filesystem resizer
  158. References
  159. ==========
  160. kernel source: <file:fs/ext3/>
  161. <file:fs/jbd/>
  162. programs: http://e2fsprogs.sourceforge.net/
  163. http://ext2resize.sourceforge.net
  164. useful links: http://www.ibm.com/developerworks/library/l-fs7/index.html
  165. http://www.ibm.com/developerworks/library/l-fs8/index.html