Skip to content

Commit 489fcb9

Browse files
djwongtytso
authored andcommitted
ext4: convert ext4.rst to restructuredtext format
Convert the existing ext4 documentation into rst format and link it in with the rest of the kernel documentation. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent a801e56 commit 489fcb9

3 files changed

Lines changed: 89 additions & 48 deletions

File tree

‎Documentation/filesystems/ext4/ext4.rst‎

Lines changed: 65 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
.. SPDX-License-Identifier: GPL-2.0
12
2-
Ext4 Filesystem
3-
===============
3+
========================
4+
General Information
5+
========================
46

57
Ext4 is an advanced level of the ext3 filesystem which incorporates
68
scalability and reliability enhancements for supporting large filesystems
@@ -11,18 +13,18 @@ Mailing list: linux-ext4@vger.kernel.org
1113
Web site: http://ext4.wiki.kernel.org
1214

1315

14-
1. Quick usage instructions:
15-
===========================
16+
Quick usage instructions
17+
========================
1618

1719
Note: More extensive information for getting started with ext4 can be
18-
found at the ext4 wiki site at the URL:
19-
http://ext4.wiki.kernel.org/index.php/Ext4_Howto
20+
found at the ext4 wiki site at the URL:
21+
http://ext4.wiki.kernel.org/index.php/Ext4_Howto
2022

2123
- Compile and install the latest version of e2fsprogs (as of this
2224
writing version 1.41.3) from:
2325

2426
http://sourceforge.net/project/showfiles.php?group_id=2406
25-
27+
2628
or
2729

2830
https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/
@@ -37,24 +39,24 @@ Note: More extensive information for getting started with ext4 can be
3739
you will need to merge your changes with the version from e2fsprogs
3840
1.41.x.
3941

40-
- Create a new filesystem using the ext4 filesystem type:
42+
- Create a new filesystem using the ext4 filesystem type:::
4143

42-
# mke2fs -t ext4 /dev/hda1
44+
# mke2fs -t ext4 /dev/hda1
4345

44-
Or to configure an existing ext3 filesystem to support extents:
46+
Or to configure an existing ext3 filesystem to support extents:::
4547

4648
# tune2fs -O extents /dev/hda1
4749

4850
If the filesystem was created with 128 byte inodes, it can be
49-
converted to use 256 byte for greater efficiency via:
51+
converted to use 256 byte for greater efficiency via:::
5052

5153
# tune2fs -I 256 /dev/hda1
5254

5355
(Note: we currently do not have tools to convert an ext4
5456
filesystem back to ext3; so please do not do try this on production
5557
filesystems.)
5658

57-
- Mounting:
59+
- Mounting:::
5860

5961
# mount -t ext4 /dev/hda1 /wherever
6062

@@ -75,10 +77,11 @@ Note: More extensive information for getting started with ext4 can be
7577
the filesystem with a large journal can also be helpful for
7678
metadata-intensive workloads.
7779

78-
2. Features
79-
===========
80+
Features
81+
========
8082

81-
2.1 Currently available
83+
Currently Available
84+
-------------------
8285

8386
* ability to use filesystems > 16TB (e2fsprogs support not available yet)
8487
* extent format reduces metadata overhead (RAM, IO for access, transactions)
@@ -103,7 +106,8 @@ Note: More extensive information for getting started with ext4 can be
103106
[1] Filesystems with a block size of 1k may see a limit imposed by the
104107
directory hash tree having a maximum depth of two.
105108

106-
2.2 Candidate features for future inclusion
109+
Candidate Features for Future Inclusion
110+
---------------------------------------
107111

108112
* online defrag (patches available but not well tested)
109113
* reduced mke2fs time via lazy itable initialization in conjunction with
@@ -122,12 +126,15 @@ grouping of bitmaps and inode tables. Some test results available here:
122126
- http://www.bullopensource.org/ext4/20080818-ffsb/ffsb-write-2.6.27-rc1.html
123127
- http://www.bullopensource.org/ext4/20080818-ffsb/ffsb-readwrite-2.6.27-rc1.html
124128

125-
3. Options
126-
==========
129+
Options
130+
=======
127131

128132
When mounting an ext4 filesystem, the following option are accepted:
129133
(*) == default
130134

135+
======================= =======================================================
136+
Mount Option Description
137+
======================= =======================================================
131138
ro Mount filesystem read only. Note that ext4 will
132139
replay the journal (and thus write to the
133140
partition) even when mounted "read only". The
@@ -387,33 +394,38 @@ i_version Enable 64-bit inode version support. This option is
387394
dax Use direct access (no page cache). See
388395
Documentation/filesystems/dax.txt. Note that
389396
this option is incompatible with data=journal.
397+
======================= =======================================================
390398

391399
Data Mode
392400
=========
393401
There are 3 different data modes:
394402

395403
* writeback mode
396-
In data=writeback mode, ext4 does not journal data at all. This mode provides
397-
a similar level of journaling as that of XFS, JFS, and ReiserFS in its default
398-
mode - metadata journaling. A crash+recovery can cause incorrect data to
399-
appear in files which were written shortly before the crash. This mode will
400-
typically provide the best ext4 performance.
404+
405+
In data=writeback mode, ext4 does not journal data at all. This mode provides
406+
a similar level of journaling as that of XFS, JFS, and ReiserFS in its default
407+
mode - metadata journaling. A crash+recovery can cause incorrect data to
408+
appear in files which were written shortly before the crash. This mode will
409+
typically provide the best ext4 performance.
401410

402411
* ordered mode
403-
In data=ordered mode, ext4 only officially journals metadata, but it logically
404-
groups metadata information related to data changes with the data blocks into a
405-
single unit called a transaction. When it's time to write the new metadata
406-
out to disk, the associated data blocks are written first. In general,
407-
this mode performs slightly slower than writeback but significantly faster than journal mode.
412+
413+
In data=ordered mode, ext4 only officially journals metadata, but it logically
414+
groups metadata information related to data changes with the data blocks into
415+
a single unit called a transaction. When it's time to write the new metadata
416+
out to disk, the associated data blocks are written first. In general, this
417+
mode performs slightly slower than writeback but significantly faster than
418+
journal mode.
408419

409420
* journal mode
410-
data=journal mode provides full data and metadata journaling. All new data is
411-
written to the journal first, and then to its final location.
412-
In the event of a crash, the journal can be replayed, bringing both data and
413-
metadata into a consistent state. This mode is the slowest except when data
414-
needs to be read from and written to disk at the same time where it
415-
outperforms all others modes. Enabling this mode will disable delayed
416-
allocation and O_DIRECT support.
421+
422+
data=journal mode provides full data and metadata journaling. All new data is
423+
written to the journal first, and then to its final location. In the event of
424+
a crash, the journal can be replayed, bringing both data and metadata into a
425+
consistent state. This mode is the slowest except when data needs to be read
426+
from and written to disk at the same time where it outperforms all others
427+
modes. Enabling this mode will disable delayed allocation and O_DIRECT
428+
support.
417429

418430
/proc entries
419431
=============
@@ -425,10 +437,12 @@ Information about mounted ext4 file systems can be found in
425437
in table below.
426438

427439
Files in /proc/fs/ext4/<devname>
428-
..............................................................................
440+
441+
================ =======
429442
File Content
443+
================ =======
430444
mb_groups details of multiblock allocator buddy cache of free blocks
431-
..............................................................................
445+
================ =======
432446

433447
/sys entries
434448
============
@@ -439,28 +453,30 @@ Information about mounted ext4 file systems can be found in
439453
/sys/fs/ext4/dm-0). The files in each per-device directory are shown
440454
in table below.
441455

442-
Files in /sys/fs/ext4/<devname>
456+
Files in /sys/fs/ext4/<devname>:
457+
443458
(see also Documentation/ABI/testing/sysfs-fs-ext4)
444-
..............................................................................
445-
File Content
446459

460+
============================= =================================================
461+
File Content
462+
============================= =================================================
447463
delayed_allocation_blocks This file is read-only and shows the number of
448464
blocks that are dirty in the page cache, but
449465
which do not have their location in the
450466
filesystem allocated yet.
451467

452-
inode_goal Tuning parameter which (if non-zero) controls
468+
inode_goal Tuning parameter which (if non-zero) controls
453469
the goal inode used by the inode allocator in
454470
preference to all other allocation heuristics.
455471
This is intended for debugging use only, and
456472
should be 0 on production systems.
457473

458-
inode_readahead_blks Tuning parameter which controls the maximum
474+
inode_readahead_blks Tuning parameter which controls the maximum
459475
number of inode table blocks that ext4's inode
460476
table readahead algorithm will pre-read into
461477
the buffer cache
462478

463-
lifetime_write_kbytes This file is read-only and shows the number of
479+
lifetime_write_kbytes This file is read-only and shows the number of
464480
kilobytes of data that have been written to this
465481
filesystem since it was created.
466482

@@ -508,7 +524,7 @@ Files in /sys/fs/ext4/<devname>
508524
in the file system. If there is not enough space
509525
for the reserved space when mounting the file
510526
mount will _not_ fail.
511-
..............................................................................
527+
============================= =================================================
512528

513529
Ioctls
514530
======
@@ -518,8 +534,10 @@ through the system call interfaces. The list of all Ext4 specific ioctls are
518534
shown in the table below.
519535

520536
Table of Ext4 specific ioctls
521-
..............................................................................
522-
Ioctl Description
537+
538+
============================= =================================================
539+
Ioctl Description
540+
============================= =================================================
523541
EXT4_IOC_GETFLAGS Get additional attributes associated with inode.
524542
The ioctl argument is an integer bitfield, with
525543
bit values described in ext4.h. This ioctl is an
@@ -610,8 +628,7 @@ Table of Ext4 specific ioctls
610628
normal user by accident.
611629
The data blocks of the previous boot loader
612630
will be associated with the given inode.
613-
614-
..............................................................................
631+
============================= =================================================
615632

616633
References
617634
==========
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
====
4+
ext4
5+
====
6+
7+
General usage and on-disk artifacts writen by ext4. More documentation may
8+
be ported from the wiki as time permits. This should be considered the
9+
canonical source of information as the details here have been reviewed by
10+
the ext4 community.
11+
12+
.. toctree::
13+
:maxdepth: 5
14+
:numbered:
15+
16+
ext4

‎Documentation/filesystems/index.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
Linux Filesystems API
33
=====================
44

5+
The documentation in this section are provided by specific filesystem
6+
subprojects.
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
11+
ext4/index
12+
513
The Linux VFS
614
=============
715

0 commit comments

Comments
 (0)