Isphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget&/translations/zh_CN/filesystems/nilfs2modnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/zh_TW/filesystems/nilfs2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/it_IT/filesystems/nilfs2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ja_JP/filesystems/nilfs2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ko_KR/filesystems/nilfs2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/sp_SP/filesystems/nilfs2modnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh@/var/lib/git/docbuild/linux/Documentation/filesystems/nilfs2.rsthKubhsection)}(hhh](htitle)}(hNILFS2h]hNILFS2}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXUNILFS2 is a log-structured file system (LFS) supporting continuous snapshotting. In addition to versioning capability of the entire file system, users can even restore files mistakenly overwritten or destroyed just a few seconds ago. Since NILFS2 can keep consistency like conventional LFS, it achieves quick recovery after system crashes.h]hXUNILFS2 is a log-structured file system (LFS) supporting continuous snapshotting. In addition to versioning capability of the entire file system, users can even restore files mistakenly overwritten or destroyed just a few seconds ago. Since NILFS2 can keep consistency like conventional LFS, it achieves quick recovery after system crashes.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX*NILFS2 creates a number of checkpoints every few seconds or per synchronous write basis (unless there is no change). Users can select significant versions among continuously created checkpoints, and can change them into snapshots which will be preserved until they are changed back to checkpoints.h]hX*NILFS2 creates a number of checkpoints every few seconds or per synchronous write basis (unless there is no change). Users can select significant versions among continuously created checkpoints, and can change them into snapshots which will be preserved until they are changed back to checkpoints.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThere is no limit on the number of snapshots until the volume gets full. Each snapshot is mountable as a read-only file system concurrently with its writable mount, and this feature is convenient for online backup.h]hThere is no limit on the number of snapshots until the volume gets full. Each snapshot is mountable as a read-only file system concurrently with its writable mount, and this feature is convenient for online backup.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX@The userland tools are included in nilfs-utils package, which is available from the following download page. At least "mkfs.nilfs2", "mount.nilfs2", "umount.nilfs2", and "nilfs_cleanerd" (so called cleaner or garbage collector) are required. Details on the tools are described in the man pages included in the package.h]hXPThe userland tools are included in nilfs-utils package, which is available from the following download page. At least “mkfs.nilfs2”, “mount.nilfs2”, “umount.nilfs2”, and “nilfs_cleanerd” (so called cleaner or garbage collector) are required. Details on the tools are described in the man pages included in the package.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh field_list)}(hhh](hfield)}(hhh](h field_name)}(hProject web pageh]hProject web page}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hj hhhKubh field_body)}(hhttps://nilfs.sourceforge.io/h]h)}(hj!h]h reference)}(hj!h]hhttps://nilfs.sourceforge.io/}(hj(hhhNhNubah}(h]h ]h"]h$]h&]refurij!uh1j&hj#ubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj )}(hhh](j)}(h Download pageh]h Download page}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjHhhhKubj)}(h-https://nilfs.sourceforge.io/en/download.htmlh]h)}(hj[h]j')}(hj[h]h-https://nilfs.sourceforge.io/en/download.html}(hj`hhhNhNubah}(h]h ]h"]h$]h&]refurij[uh1j&hj]ubah}(h]h ]h"]h$]h&]uh1hhhhK hjYubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhhhK hjhhubj )}(hhh](j)}(h List infoh]h List info}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjhhhKubj)}(h3http://vger.kernel.org/vger-lists.html#linux-nilfs h]h)}(h2http://vger.kernel.org/vger-lists.html#linux-nilfsh]j')}(hjh]h2http://vger.kernel.org/vger-lists.html#linux-nilfs}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1j&hjubah}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK!hjhhubeh}(h]h ]h"]h$]h&]uh1jhhhhhhhKubh)}(hhh](h)}(hCaveatsh]hCaveats}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK$ubh)}(h+Features which NILFS2 does not support yet:h]h+Features which NILFS2 does not support yet:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjhhubh block_quote)}(hM- atime - extended attributes - POSIX ACLs - quotas - fsck - defragmentation h]h bullet_list)}(hhh](h list_item)}(hatimeh]h)}(hjh]hatime}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hextended attributesh]h)}(hjh]hextended attributes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h POSIX ACLsh]h)}(hjh]h POSIX ACLs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hquotash]h)}(hj2h]hquotas}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hj0ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hfsckh]h)}(hjIh]hfsck}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjGubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hdefragmentation h]h)}(hdefragmentationh]hdefragmentation}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hj^ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhK(hjubah}(h]h ]h"]h$]h&]uh1jhhhK(hjhhubeh}(h]caveatsah ]h"]caveatsah$]h&]uh1hhhhhhhhK$ubh)}(hhh](h)}(h Mount optionsh]h Mount options}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK0ubh)}(h;NILFS2 supports the following mount options: (*) == defaulth]h;NILFS2 supports the following mount options: (*) == default}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK7uh1jhjubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(h barrier(*)h]h barrier(*)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h6This enables/disables the use of write barriers. Thish]h6This enables/disables the use of write barriers. This}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h nobarrierh]h nobarrier}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hrequires an IO stack which can support barriers, and if nilfs gets an error on a barrier write, it will disable again with a warning.h]hrequires an IO stack which can support barriers, and if nilfs gets an error on a barrier write, it will disable again with a warning.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hj%ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(herrors=continueh]herrors=continue}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjEubah}(h]h ]h"]h$]h&]uh1jhjBubj)}(hhh]h)}(h!Keep going on a filesystem error.h]h!Keep going on a filesystem error.}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hj\ubah}(h]h ]h"]h$]h&]uh1jhjBubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(herrors=remount-ro(*)h]herrors=remount-ro(*)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hj|ubah}(h]h ]h"]h$]h&]uh1jhjyubj)}(hhh]h)}(h-Remount the filesystem read-only on an error.h]h-Remount the filesystem read-only on an error.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjubah}(h]h ]h"]h$]h&]uh1jhjyubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h errors=panich]h errors=panic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK /dev/block_device /snap_dirh]h<# mount -t nilfs2 -r -o cp= /dev/block_device /snap_dir}hj7 sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhjhhubh)}(h5where is the checkpoint number of the snapshot.h]h5where is the checkpoint number of the snapshot.}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h7To unmount the NILFS2 mount point or snapshot, simply::h]h6To unmount the NILFS2 mount point or snapshot, simply:}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(h # umount /dirh]h # umount /dir}hja sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhjhhubh)}(haThen, the cleaner daemon is automatically shut down by the umount helper program (umount.nilfs2).h]haThen, the cleaner daemon is automatically shut down by the umount helper program (umount.nilfs2).}(hjo hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] nilfs2-usageah ]h"] nilfs2 usageah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Disk formath]h Disk format}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hA nilfs2 volume is equally divided into a number of segments except for the super block (SB) and segment #0. A segment is the container of logs. Each log is composed of summary information blocks, payload blocks, and an optional super root block (SR)::h]hA nilfs2 volume is equally divided into a number of segments except for the super block (SB) and segment #0. A segment is the container of logs. Each log is composed of summary information blocks, payload blocks, and an optional super root block (SR):}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hX% ______________________________________________________ | |SB| | Segment | Segment | Segment | ... | Segment | | |_|__|_|____0____|____1____|____2____|_____|____N____|_| 0 +1K +4K +8M +16M +24M +(8MB x N) . . (Typical offsets for 4KB-block) . . .______________________. | log | log |... | log | |__1__|__2__|____|__m__| . . . . . . .______________________________. | Summary | Payload blocks |SR| |_blocks__|_________________|__|h]hX% ______________________________________________________ | |SB| | Segment | Segment | Segment | ... | Segment | | |_|__|_|____0____|____1____|____2____|_____|____N____|_| 0 +1K +4K +8M +16M +24M +(8MB x N) . . (Typical offsets for 4KB-block) . . .______________________. | log | log |... | log | |__1__|__2__|____|__m__| . . . . . . .______________________________. | Summary | Payload blocks |SR| |_blocks__|_________________|__|}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hiThe payload blocks are organized per file, and each file consists of data blocks and B-tree node blocks::h]hhThe payload blocks are organized per file, and each file consists of data blocks and B-tree node blocks:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hX |<--- File-A --->|<--- File-B --->| _______________________________________________________________ | Data blocks | B-tree blocks | Data blocks | B-tree blocks | ... _|_____________|_______________|_____________|_______________|_h]hX |<--- File-A --->|<--- File-B --->| _______________________________________________________________ | Data blocks | B-tree blocks | Data blocks | B-tree blocks | ... _|_____________|_______________|_____________|_______________|_}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hsSince only the modified blocks are written in the log, it may have files without data blocks or B-tree node blocks.h]hsSince only the modified blocks are written in the log, it may have files without data blocks or B-tree node blocks.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hThe organization of the blocks is recorded in the summary information blocks, which contains a header structure (nilfs_segment_summary), per file structures (nilfs_finfo), and per block structures (nilfs_binfo)::h]hThe organization of the blocks is recorded in the summary information blocks, which contains a header structure (nilfs_segment_summary), per file structures (nilfs_finfo), and per block structures (nilfs_binfo):}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(h _________________________________________________________________________ | Summary | finfo | binfo | ... | binfo | finfo | binfo | ... | binfo |... |_blocks__|___A___|_(A,1)_|_____|(A,Na)_|___B___|_(B,1)_|_____|(B,Nb)_|___h]h _________________________________________________________________________ | Summary | finfo | binfo | ... | binfo | finfo | binfo | ... | binfo |... |_blocks__|___A___|_(A,1)_|_____|(A,Na)_|___B___|_(B,1)_|_____|(B,Nb)_|___}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hThe logs include regular files, directory files, symbolic link files and several meta data files. The meta data files are the files used to maintain file system meta data. The current version of NILFS2 uses the following meta data files::h]hThe logs include regular files, directory files, symbolic link files and several meta data files. The meta data files are the files used to maintain file system meta data. The current version of NILFS2 uses the following meta data files:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hX1) Inode file (ifile) -- Stores on-disk inodes 2) Checkpoint file (cpfile) -- Stores checkpoints 3) Segment usage file (sufile) -- Stores allocation state of segments 4) Data address translation file -- Maps virtual block numbers to usual (DAT) block numbers. This file serves to make on-disk blocks relocatable.h]hX1) Inode file (ifile) -- Stores on-disk inodes 2) Checkpoint file (cpfile) -- Stores checkpoints 3) Segment usage file (sufile) -- Stores allocation state of segments 4) Data address translation file -- Maps virtual block numbers to usual (DAT) block numbers. This file serves to make on-disk blocks relocatable.}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(h?The following figure shows a typical organization of the logs::h]h>The following figure shows a typical organization of the logs:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(h _________________________________________________________________________ | Summary | regular file | file | ... | ifile | cpfile | sufile | DAT |SR| |_blocks__|_or_directory_|_______|_____|_______|________|________|_____|__|h]h _________________________________________________________________________ | Summary | regular file | file | ... | ifile | cpfile | sufile | DAT |SR| |_blocks__|_or_directory_|_______|_____|_______|________|________|_____|__|}hj" sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hX1To stride over segment boundaries, this sequence of files may be split into multiple logs. The sequence of logs that should be treated as logically one log, is delimited with flags marked in the segment summary. The recovery code of nilfs2 looks this boundary information to ensure atomicity of updates.h]hX1To stride over segment boundaries, this sequence of files may be split into multiple logs. The sequence of logs that should be treated as logically one log, is delimited with flags marked in the segment summary. The recovery code of nilfs2 looks this boundary information to ensure atomicity of updates.}(hj0 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hXThe super root block is inserted for every checkpoints. It includes three special inodes, inodes for the DAT, cpfile, and sufile. Inodes of regular files, directories, symlinks and other special files, are included in the ifile. The inode of ifile itself is included in the corresponding checkpoint entry in the cpfile. Thus, the hierarchy among NILFS2 files can be depicted as follows::h]hXThe super root block is inserted for every checkpoints. It includes three special inodes, inodes for the DAT, cpfile, and sufile. Inodes of regular files, directories, symlinks and other special files, are included in the ifile. The inode of ifile itself is included in the corresponding checkpoint entry in the cpfile. Thus, the hierarchy among NILFS2 files can be depicted as follows:}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hXSuper block (SB) | v Super root block (the latest cno=xx) |-- DAT |-- sufile `-- cpfile |-- ifile (cno=c1) |-- ifile (cno=c2) ---- file (ino=i1) : : |-- file (ino=i2) `-- ifile (cno=xx) |-- file (ino=i3) : : `-- file (ino=yy) ( regular file, directory, or symlink )h]hXSuper block (SB) | v Super root block (the latest cno=xx) |-- DAT |-- sufile `-- cpfile |-- ifile (cno=c1) |-- ifile (cno=c2) ---- file (ino=i1) : : |-- file (ino=i2) `-- ifile (cno=xx) |-- file (ino=i3) : : `-- file (ino=yy) ( regular file, directory, or symlink )}hjL sbah}(h]h ]h"]h$]h&]hhuh1jhhhM hj hhubh)}(hjFor detail on the format of each file, please see nilfs2_ondisk.h located at include/uapi/linux directory.h]hjFor detail on the format of each file, please see nilfs2_ondisk.h located at include/uapi/linux directory.}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hThere are no patents or other intellectual property that we protect with regard to the design of NILFS2. It is allowed to replicate the design in hopes that other operating systems could share (mount, read, write, etc.) data stored in this format.h]hThere are no patents or other intellectual property that we protect with regard to the design of NILFS2. It is allowed to replicate the design in hopes that other operating systems could share (mount, read, write, etc.) data stored in this format.}(hjh hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h] disk-formatah ]h"] disk formatah$]h&]uh1hhhhhhhhKubeh}(h]nilfs2ah ]h"]nilfs2ah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j j jjjIjFjjj j j{ jx u nametypes}(j jjIjj j{ uh}(j hjjjFjjjLj jjx j u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.