ext4.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ========================
  3. ext4 General Information
  4. ========================
  5. Ext4 is an advanced level of the ext3 filesystem which incorporates
  6. scalability and reliability enhancements for supporting large filesystems
  7. (64 bit) in keeping with increasing disk capacities and state-of-the-art
  8. feature requirements.
  9. Mailing list: linux-ext4@vger.kernel.org
  10. Web site: http://ext4.wiki.kernel.org
  11. Quick usage instructions
  12. ========================
  13. Note: More extensive information for getting started with ext4 can be
  14. found at the ext4 wiki site at the URL:
  15. http://ext4.wiki.kernel.org/index.php/Ext4_Howto
  16. - The latest version of e2fsprogs can be found at:
  17. https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/
  18. or
  19. http://sourceforge.net/project/showfiles.php?group_id=2406
  20. or grab the latest git repository from:
  21. https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
  22. - Create a new filesystem using the ext4 filesystem type:
  23. # mke2fs -t ext4 /dev/hda1
  24. Or to configure an existing ext3 filesystem to support extents:
  25. # tune2fs -O extents /dev/hda1
  26. If the filesystem was created with 128 byte inodes, it can be
  27. converted to use 256 byte for greater efficiency via:
  28. # tune2fs -I 256 /dev/hda1
  29. - Mounting:
  30. # mount -t ext4 /dev/hda1 /wherever
  31. - When comparing performance with other filesystems, it's always
  32. important to try multiple workloads; very often a subtle change in a
  33. workload parameter can completely change the ranking of which
  34. filesystems do well compared to others. When comparing versus ext3,
  35. note that ext4 enables write barriers by default, while ext3 does
  36. not enable write barriers by default. So it is useful to use
  37. explicitly specify whether barriers are enabled or not when via the
  38. '-o barriers=[0|1]' mount option for both ext3 and ext4 filesystems
  39. for a fair comparison. When tuning ext3 for best benchmark numbers,
  40. it is often worthwhile to try changing the data journaling mode; '-o
  41. data=writeback' can be faster for some workloads. (Note however that
  42. running mounted with data=writeback can potentially leave stale data
  43. exposed in recently written files in case of an unclean shutdown,
  44. which could be a security exposure in some situations.) Configuring
  45. the filesystem with a large journal can also be helpful for
  46. metadata-intensive workloads.
  47. Features
  48. ========
  49. Currently Available
  50. -------------------
  51. * ability to use filesystems > 16TB (e2fsprogs support not available yet)
  52. * extent format reduces metadata overhead (RAM, IO for access, transactions)
  53. * extent format more robust in face of on-disk corruption due to magics,
  54. * internal redundancy in tree
  55. * improved file allocation (multi-block alloc)
  56. * lift 32000 subdirectory limit imposed by i_links_count[1]
  57. * nsec timestamps for mtime, atime, ctime, create time
  58. * inode version field on disk (NFSv4, Lustre)
  59. * reduced e2fsck time via uninit_bg feature
  60. * journal checksumming for robustness, performance
  61. * persistent file preallocation (e.g for streaming media, databases)
  62. * ability to pack bitmaps and inode tables into larger virtual groups via the
  63. flex_bg feature
  64. * large file support
  65. * inode allocation using large virtual block groups via flex_bg
  66. * delayed allocation
  67. * large block (up to pagesize) support
  68. * efficient new ordered mode in JBD2 and ext4 (avoid using buffer head to force
  69. the ordering)
  70. * Case-insensitive file name lookups
  71. * file-based encryption support (fscrypt)
  72. * file-based verity support (fsverity)
  73. [1] Filesystems with a block size of 1k may see a limit imposed by the
  74. directory hash tree having a maximum depth of two.
  75. case-insensitive file name lookups
  76. ======================================================
  77. The case-insensitive file name lookup feature is supported on a
  78. per-directory basis, allowing the user to mix case-insensitive and
  79. case-sensitive directories in the same filesystem. It is enabled by
  80. flipping the +F inode attribute of an empty directory. The
  81. case-insensitive string match operation is only defined when we know how
  82. text in encoded in a byte sequence. For that reason, in order to enable
  83. case-insensitive directories, the filesystem must have the
  84. casefold feature, which stores the filesystem-wide encoding
  85. model used. By default, the charset adopted is the latest version of
  86. Unicode (12.1.0, by the time of this writing), encoded in the UTF-8
  87. form. The comparison algorithm is implemented by normalizing the
  88. strings to the Canonical decomposition form, as defined by Unicode,
  89. followed by a byte per byte comparison.
  90. The case-awareness is name-preserving on the disk, meaning that the file
  91. name provided by userspace is a byte-per-byte match to what is actually
  92. written in the disk. The Unicode normalization format used by the
  93. kernel is thus an internal representation, and not exposed to the
  94. userspace nor to the disk, with the important exception of disk hashes,
  95. used on large case-insensitive directories with DX feature. On DX
  96. directories, the hash must be calculated using the casefolded version of
  97. the filename, meaning that the normalization format used actually has an
  98. impact on where the directory entry is stored.
  99. When we change from viewing filenames as opaque byte sequences to seeing
  100. them as encoded strings we need to address what happens when a program
  101. tries to create a file with an invalid name. The Unicode subsystem
  102. within the kernel leaves the decision of what to do in this case to the
  103. filesystem, which select its preferred behavior by enabling/disabling
  104. the strict mode. When Ext4 encounters one of those strings and the
  105. filesystem did not require strict mode, it falls back to considering the
  106. entire string as an opaque byte sequence, which still allows the user to
  107. operate on that file, but the case-insensitive lookups won't work.
  108. Options
  109. =======
  110. When mounting an ext4 filesystem, the following option are accepted:
  111. (*) == default
  112. ro
  113. Mount filesystem read only. Note that ext4 will replay the journal (and
  114. thus write to the partition) even when mounted "read only". The mount
  115. options "ro,noload" can be used to prevent writes to the filesystem.
  116. journal_checksum
  117. Enable checksumming of the journal transactions. This will allow the
  118. recovery code in e2fsck and the kernel to detect corruption in the
  119. kernel. It is a compatible change and will be ignored by older
  120. kernels.
  121. journal_async_commit
  122. Commit block can be written to disk without waiting for descriptor
  123. blocks. If enabled older kernels cannot mount the device. This will
  124. enable 'journal_checksum' internally.
  125. journal_path=path, journal_dev=devnum
  126. When the external journal device's major/minor numbers have changed,
  127. these options allow the user to specify the new journal location. The
  128. journal device is identified through either its new major/minor numbers
  129. encoded in devnum, or via a path to the device.
  130. norecovery, noload
  131. Don't load the journal on mounting. Note that if the filesystem was
  132. not unmounted cleanly, skipping the journal replay will lead to the
  133. filesystem containing inconsistencies that can lead to any number of
  134. problems.
  135. data=journal
  136. All data are committed into the journal prior to being written into the
  137. main file system. Enabling this mode will disable delayed allocation
  138. and O_DIRECT support.
  139. data=ordered (*)
  140. All data are forced directly out to the main file system prior to its
  141. metadata being committed to the journal.
  142. data=writeback
  143. Data ordering is not preserved, data may be written into the main file
  144. system after its metadata has been committed to the journal.
  145. commit=nrsec (*)
  146. This setting limits the maximum age of the running transaction to
  147. 'nrsec' seconds. The default value is 5 seconds. This means that if
  148. you lose your power, you will lose as much as the latest 5 seconds of
  149. metadata changes (your filesystem will not be damaged though, thanks
  150. to the journaling). This default value (or any low value) will hurt
  151. performance, but it's good for data-safety. Setting it to 0 will have
  152. the same effect as leaving it at the default (5 seconds). Setting it
  153. to very large values will improve performance. Note that due to
  154. delayed allocation even older data can be lost on power failure since
  155. writeback of those data begins only after time set in
  156. /proc/sys/vm/dirty_expire_centisecs.
  157. barrier=<0|1(*)>, barrier(*), nobarrier
  158. This enables/disables the use of write barriers in the jbd code.
  159. barrier=0 disables, barrier=1 enables. This also requires an IO stack
  160. which can support barriers, and if jbd gets an error on a barrier
  161. write, it will disable again with a warning. Write barriers enforce
  162. proper on-disk ordering of journal commits, making volatile disk write
  163. caches safe to use, at some performance penalty. If your disks are
  164. battery-backed in one way or another, disabling barriers may safely
  165. improve performance. The mount options "barrier" and "nobarrier" can
  166. also be used to enable or disable barriers, for consistency with other
  167. ext4 mount options.
  168. inode_readahead_blks=n
  169. This tuning parameter controls the maximum number of inode table blocks
  170. that ext4's inode table readahead algorithm will pre-read into the
  171. buffer cache. The default value is 32 blocks.
  172. bsddf (*)
  173. Make 'df' act like BSD.
  174. minixdf
  175. Make 'df' act like Minix.
  176. debug
  177. Extra debugging information is sent to syslog.
  178. abort
  179. Simulate the effects of calling ext4_abort() for debugging purposes.
  180. This is normally used while remounting a filesystem which is already
  181. mounted.
  182. errors=remount-ro
  183. Remount the filesystem read-only on an error.
  184. errors=continue
  185. Keep going on a filesystem error.
  186. errors=panic
  187. Panic and halt the machine if an error occurs. (These mount options
  188. override the errors behavior specified in the superblock, which can be
  189. configured using tune2fs)
  190. data_err=ignore(*)
  191. Just print an error message if an error occurs in a file data buffer.
  192. data_err=abort
  193. Abort the journal if an error occurs in a file data buffer.
  194. grpid | bsdgroups
  195. New objects have the group ID of their parent.
  196. nogrpid (*) | sysvgroups
  197. New objects have the group ID of their creator.
  198. resgid=n
  199. The group ID which may use the reserved blocks.
  200. resuid=n
  201. The user ID which may use the reserved blocks.
  202. sb=
  203. Use alternate superblock at this location.
  204. quota, noquota, grpquota, usrquota
  205. These options are ignored by the filesystem. They are used only by
  206. quota tools to recognize volumes where quota should be turned on. See
  207. documentation in the quota-tools package for more details
  208. (http://sourceforge.net/projects/linuxquota).
  209. jqfmt=<quota type>, usrjquota=<file>, grpjquota=<file>
  210. These options tell filesystem details about quota so that quota
  211. information can be properly updated during journal replay. They replace
  212. the above quota options. See documentation in the quota-tools package
  213. for more details (http://sourceforge.net/projects/linuxquota).
  214. stripe=n
  215. Number of filesystem blocks that mballoc will try to use for allocation
  216. size and alignment. For RAID5/6 systems this should be the number of
  217. data disks * RAID chunk size in file system blocks.
  218. delalloc (*)
  219. Defer block allocation until just before ext4 writes out the block(s)
  220. in question. This allows ext4 to better allocation decisions more
  221. efficiently.
  222. nodelalloc
  223. Disable delayed allocation. Blocks are allocated when the data is
  224. copied from userspace to the page cache, either via the write(2) system
  225. call or when an mmap'ed page which was previously unallocated is
  226. written for the first time.
  227. max_batch_time=usec
  228. Maximum amount of time ext4 should wait for additional filesystem
  229. operations to be batch together with a synchronous write operation.
  230. Since a synchronous write operation is going to force a commit and then
  231. a wait for the I/O complete, it doesn't cost much, and can be a huge
  232. throughput win, we wait for a small amount of time to see if any other
  233. transactions can piggyback on the synchronous write. The algorithm
  234. used is designed to automatically tune for the speed of the disk, by
  235. measuring the amount of time (on average) that it takes to finish
  236. committing a transaction. Call this time the "commit time". If the
  237. time that the transaction has been running is less than the commit
  238. time, ext4 will try sleeping for the commit time to see if other
  239. operations will join the transaction. The commit time is capped by
  240. the max_batch_time, which defaults to 15000us (15ms). This
  241. optimization can be turned off entirely by setting max_batch_time to 0.
  242. min_batch_time=usec
  243. This parameter sets the commit time (as described above) to be at least
  244. min_batch_time. It defaults to zero microseconds. Increasing this
  245. parameter may improve the throughput of multi-threaded, synchronous
  246. workloads on very fast disks, at the cost of increasing latency.
  247. journal_ioprio=prio
  248. The I/O priority (from 0 to 7, where 0 is the highest priority) which
  249. should be used for I/O operations submitted by kjournald2 during a
  250. commit operation. This defaults to 3, which is a slightly higher
  251. priority than the default I/O priority.
  252. auto_da_alloc(*), noauto_da_alloc
  253. Many broken applications don't use fsync() when replacing existing
  254. files via patterns such as fd = open("foo.new")/write(fd,..)/close(fd)/
  255. rename("foo.new", "foo"), or worse yet, fd = open("foo",
  256. O_TRUNC)/write(fd,..)/close(fd). If auto_da_alloc is enabled, ext4
  257. will detect the replace-via-rename and replace-via-truncate patterns
  258. and force that any delayed allocation blocks are allocated such that at
  259. the next journal commit, in the default data=ordered mode, the data
  260. blocks of the new file are forced to disk before the rename() operation
  261. is committed. This provides roughly the same level of guarantees as
  262. ext3, and avoids the "zero-length" problem that can happen when a
  263. system crashes before the delayed allocation blocks are forced to disk.
  264. noinit_itable
  265. Do not initialize any uninitialized inode table blocks in the
  266. background. This feature may be used by installation CD's so that the
  267. install process can complete as quickly as possible; the inode table
  268. initialization process would then be deferred until the next time the
  269. file system is unmounted.
  270. init_itable=n
  271. The lazy itable init code will wait n times the number of milliseconds
  272. it took to zero out the previous block group's inode table. This
  273. minimizes the impact on the system performance while file system's
  274. inode table is being initialized.
  275. discard, nodiscard(*)
  276. Controls whether ext4 should issue discard/TRIM commands to the
  277. underlying block device when blocks are freed. This is useful for SSD
  278. devices and sparse/thinly-provisioned LUNs, but it is off by default
  279. until sufficient testing has been done.
  280. nouid32
  281. Disables 32-bit UIDs and GIDs. This is for interoperability with
  282. older kernels which only store and expect 16-bit values.
  283. block_validity(*), noblock_validity
  284. These options enable or disable the in-kernel facility for tracking
  285. filesystem metadata blocks within internal data structures. This
  286. allows multi- block allocator and other routines to notice bugs or
  287. corrupted allocation bitmaps which cause blocks to be allocated which
  288. overlap with filesystem metadata blocks.
  289. dioread_lock, dioread_nolock
  290. Controls whether or not ext4 should use the DIO read locking. If the
  291. dioread_nolock option is specified ext4 will allocate uninitialized
  292. extent before buffer write and convert the extent to initialized after
  293. IO completes. This approach allows ext4 code to avoid using inode
  294. mutex, which improves scalability on high speed storages. However this
  295. does not work with data journaling and dioread_nolock option will be
  296. ignored with kernel warning. Note that dioread_nolock code path is only
  297. used for extent-based files. Because of the restrictions this options
  298. comprises it is off by default (e.g. dioread_lock).
  299. max_dir_size_kb=n
  300. This limits the size of directories so that any attempt to expand them
  301. beyond the specified limit in kilobytes will cause an ENOSPC error.
  302. This is useful in memory constrained environments, where a very large
  303. directory can cause severe performance problems or even provoke the Out
  304. Of Memory killer. (For example, if there is only 512mb memory
  305. available, a 176mb directory may seriously cramp the system's style.)
  306. i_version
  307. Enable 64-bit inode version support. This option is off by default.
  308. dax
  309. Use direct access (no page cache). See
  310. Documentation/filesystems/dax.rst. Note that this option is
  311. incompatible with data=journal.
  312. inlinecrypt
  313. When possible, encrypt/decrypt the contents of encrypted files using the
  314. blk-crypto framework rather than filesystem-layer encryption. This
  315. allows the use of inline encryption hardware. The on-disk format is
  316. unaffected. For more details, see
  317. Documentation/block/inline-encryption.rst.
  318. Data Mode
  319. =========
  320. There are 3 different data modes:
  321. * writeback mode
  322. In data=writeback mode, ext4 does not journal data at all. This mode provides
  323. a similar level of journaling as that of XFS and JFS in its default
  324. mode - metadata journaling. A crash+recovery can cause incorrect data to
  325. appear in files which were written shortly before the crash. This mode will
  326. typically provide the best ext4 performance.
  327. * ordered mode
  328. In data=ordered mode, ext4 only officially journals metadata, but it logically
  329. groups metadata information related to data changes with the data blocks into
  330. a single unit called a transaction. When it's time to write the new metadata
  331. out to disk, the associated data blocks are written first. In general, this
  332. mode performs slightly slower than writeback but significantly faster than
  333. journal mode.
  334. * journal mode
  335. data=journal mode provides full data and metadata journaling. All new data is
  336. written to the journal first, and then to its final location. In the event of
  337. a crash, the journal can be replayed, bringing both data and metadata into a
  338. consistent state. This mode is the slowest except when data needs to be read
  339. from and written to disk at the same time where it outperforms all others
  340. modes. Enabling this mode will disable delayed allocation and O_DIRECT
  341. support.
  342. /proc entries
  343. =============
  344. Information about mounted ext4 file systems can be found in
  345. /proc/fs/ext4. Each mounted filesystem will have a directory in
  346. /proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or
  347. /proc/fs/ext4/dm-0). The files in each per-device directory are shown
  348. in table below.
  349. Files in /proc/fs/ext4/<devname>
  350. mb_groups
  351. details of multiblock allocator buddy cache of free blocks
  352. /sys entries
  353. ============
  354. Information about mounted ext4 file systems can be found in
  355. /sys/fs/ext4. Each mounted filesystem will have a directory in
  356. /sys/fs/ext4 based on its device name (i.e., /sys/fs/ext4/hdc or
  357. /sys/fs/ext4/dm-0). The files in each per-device directory are shown
  358. in table below.
  359. Files in /sys/fs/ext4/<devname>:
  360. (see also Documentation/ABI/testing/sysfs-fs-ext4)
  361. delayed_allocation_blocks
  362. This file is read-only and shows the number of blocks that are dirty in
  363. the page cache, but which do not have their location in the filesystem
  364. allocated yet.
  365. inode_goal
  366. Tuning parameter which (if non-zero) controls the goal inode used by
  367. the inode allocator in preference to all other allocation heuristics.
  368. This is intended for debugging use only, and should be 0 on production
  369. systems.
  370. inode_readahead_blks
  371. Tuning parameter which controls the maximum number of inode table
  372. blocks that ext4's inode table readahead algorithm will pre-read into
  373. the buffer cache.
  374. lifetime_write_kbytes
  375. This file is read-only and shows the number of kilobytes of data that
  376. have been written to this filesystem since it was created.
  377. max_writeback_mb_bump
  378. The maximum number of megabytes the writeback code will try to write
  379. out before move on to another inode.
  380. mb_group_prealloc
  381. The multiblock allocator will round up allocation requests to a
  382. multiple of this tuning parameter if the stripe size is not set in the
  383. ext4 superblock
  384. mb_max_to_scan
  385. The maximum number of extents the multiblock allocator will search to
  386. find the best extent.
  387. mb_min_to_scan
  388. The minimum number of extents the multiblock allocator will search to
  389. find the best extent.
  390. mb_order2_req
  391. Tuning parameter which controls the minimum size for requests (as a
  392. power of 2) where the buddy cache is used.
  393. mb_stats
  394. Controls whether the multiblock allocator should collect statistics,
  395. which are shown during the unmount. 1 means to collect statistics, 0
  396. means not to collect statistics.
  397. mb_stream_req
  398. Files which have fewer blocks than this tunable parameter will have
  399. their blocks allocated out of a block group specific preallocation
  400. pool, so that small files are packed closely together. Each large file
  401. will have its blocks allocated out of its own unique preallocation
  402. pool.
  403. session_write_kbytes
  404. This file is read-only and shows the number of kilobytes of data that
  405. have been written to this filesystem since it was mounted.
  406. reserved_clusters
  407. This is RW file and contains number of reserved clusters in the file
  408. system which will be used in the specific situations to avoid costly
  409. zeroout, unexpected ENOSPC, or possible data loss. The default is 2% or
  410. 4096 clusters, whichever is smaller and this can be changed however it
  411. can never exceed number of clusters in the file system. If there is not
  412. enough space for the reserved space when mounting the file mount will
  413. _not_ fail.
  414. Ioctls
  415. ======
  416. Ext4 implements various ioctls which can be used by applications to access
  417. ext4-specific functionality. An incomplete list of these ioctls is shown in the
  418. table below. This list includes truly ext4-specific ioctls (``EXT4_IOC_*``) as
  419. well as ioctls that may have been ext4-specific originally but are now supported
  420. by some other filesystem(s) too (``FS_IOC_*``).
  421. Table of Ext4 ioctls
  422. FS_IOC_GETFLAGS
  423. Get additional attributes associated with inode. The ioctl argument is
  424. an integer bitfield, with bit values described in ext4.h.
  425. FS_IOC_SETFLAGS
  426. Set additional attributes associated with inode. The ioctl argument is
  427. an integer bitfield, with bit values described in ext4.h.
  428. EXT4_IOC_GETVERSION, EXT4_IOC_GETVERSION_OLD
  429. Get the inode i_generation number stored for each inode. The
  430. i_generation number is normally changed only when new inode is created
  431. and it is particularly useful for network filesystems. The '_OLD'
  432. version of this ioctl is an alias for FS_IOC_GETVERSION.
  433. EXT4_IOC_SETVERSION, EXT4_IOC_SETVERSION_OLD
  434. Set the inode i_generation number stored for each inode. The '_OLD'
  435. version of this ioctl is an alias for FS_IOC_SETVERSION.
  436. EXT4_IOC_GROUP_EXTEND
  437. This ioctl has the same purpose as the resize mount option. It allows
  438. to resize filesystem to the end of the last existing block group,
  439. further resize has to be done with resize2fs, either online, or
  440. offline. The argument points to the unsigned logn number representing
  441. the filesystem new block count.
  442. EXT4_IOC_MOVE_EXT
  443. Move the block extents from orig_fd (the one this ioctl is pointing to)
  444. to the donor_fd (the one specified in move_extent structure passed as
  445. an argument to this ioctl). Then, exchange inode metadata between
  446. orig_fd and donor_fd. This is especially useful for online
  447. defragmentation, because the allocator has the opportunity to allocate
  448. moved blocks better, ideally into one contiguous extent.
  449. EXT4_IOC_GROUP_ADD
  450. Add a new group descriptor to an existing or new group descriptor
  451. block. The new group descriptor is described by ext4_new_group_input
  452. structure, which is passed as an argument to this ioctl. This is
  453. especially useful in conjunction with EXT4_IOC_GROUP_EXTEND, which
  454. allows online resize of the filesystem to the end of the last existing
  455. block group. Those two ioctls combined is used in userspace online
  456. resize tool (e.g. resize2fs).
  457. EXT4_IOC_MIGRATE
  458. This ioctl operates on the filesystem itself. It converts (migrates)
  459. ext3 indirect block mapped inode to ext4 extent mapped inode by walking
  460. through indirect block mapping of the original inode and converting
  461. contiguous block ranges into ext4 extents of the temporary inode. Then,
  462. inodes are swapped. This ioctl might help, when migrating from ext3 to
  463. ext4 filesystem, however suggestion is to create fresh ext4 filesystem
  464. and copy data from the backup. Note, that filesystem has to support
  465. extents for this ioctl to work.
  466. EXT4_IOC_ALLOC_DA_BLKS
  467. Force all of the delay allocated blocks to be allocated to preserve
  468. application-expected ext3 behaviour. Note that this will also start
  469. triggering a write of the data blocks, but this behaviour may change in
  470. the future as it is not necessary and has been done this way only for
  471. sake of simplicity.
  472. EXT4_IOC_RESIZE_FS
  473. Resize the filesystem to a new size. The number of blocks of resized
  474. filesystem is passed in via 64 bit integer argument. The kernel
  475. allocates bitmaps and inode table, the userspace tool thus just passes
  476. the new number of blocks.
  477. EXT4_IOC_SWAP_BOOT
  478. Swap i_blocks and associated attributes (like i_blocks, i_size,
  479. i_flags, ...) from the specified inode with inode EXT4_BOOT_LOADER_INO
  480. (#5). This is typically used to store a boot loader in a secure part of
  481. the filesystem, where it can't be changed by a normal user by accident.
  482. The data blocks of the previous boot loader will be associated with the
  483. given inode.
  484. References
  485. ==========
  486. kernel source: <file:fs/ext4/>
  487. <file:fs/jbd2/>
  488. programs: http://e2fsprogs.sourceforge.net/
  489. useful links: https://fedoraproject.org/wiki/ext3-devel
  490. http://www.bullopensource.org/ext4/
  491. http://ext4.wiki.kernel.org/index.php/Main_Page
  492. https://fedoraproject.org/wiki/Features/Ext4