diff options
author | Bobby Rong <rjl931189261@126.com> | 2021-09-08 15:05:50 +0800 |
---|---|---|
committer | Bobby Rong <rjl931189261@126.com> | 2021-09-08 16:35:16 +0800 |
commit | 4c10e0ff9ddea45b344134228dd5874b9ae0bd06 (patch) | |
tree | 508852418594c61c07cd6cf5d07df5d93a747ffc /nixos/doc/manual/configuration | |
parent | 7d7d2a44556a43d8b65bde4ea95267cf6525c9f4 (diff) | |
download | nixpkgs-4c10e0ff9ddea45b344134228dd5874b9ae0bd06.tar nixpkgs-4c10e0ff9ddea45b344134228dd5874b9ae0bd06.tar.gz nixpkgs-4c10e0ff9ddea45b344134228dd5874b9ae0bd06.tar.bz2 nixpkgs-4c10e0ff9ddea45b344134228dd5874b9ae0bd06.tar.lz nixpkgs-4c10e0ff9ddea45b344134228dd5874b9ae0bd06.tar.xz nixpkgs-4c10e0ff9ddea45b344134228dd5874b9ae0bd06.tar.zst nixpkgs-4c10e0ff9ddea45b344134228dd5874b9ae0bd06.zip |
nixos: nixos/doc/manual/configuration/file-systems.xml to CommonMark
Diffstat (limited to 'nixos/doc/manual/configuration')
-rw-r--r-- | nixos/doc/manual/configuration/configuration.xml | 2 | ||||
-rw-r--r-- | nixos/doc/manual/configuration/file-systems.chapter.md | 42 | ||||
-rw-r--r-- | nixos/doc/manual/configuration/file-systems.xml | 58 |
3 files changed, 43 insertions, 59 deletions
diff --git a/nixos/doc/manual/configuration/configuration.xml b/nixos/doc/manual/configuration/configuration.xml index a55dea96c75..6f59262eae7 100644 --- a/nixos/doc/manual/configuration/configuration.xml +++ b/nixos/doc/manual/configuration/configuration.xml @@ -16,7 +16,7 @@ <xi:include href="../from_md/configuration/config-syntax.chapter.xml" /> <xi:include href="../from_md/configuration/package-mgmt.chapter.xml" /> <xi:include href="../from_md/configuration/user-mgmt.chapter.xml" /> - <xi:include href="file-systems.xml" /> + <xi:include href="../from_md/configuration/file-systems.chapter.xml" /> <xi:include href="../from_md/configuration/x-windows.chapter.xml" /> <xi:include href="../from_md/configuration/wayland.chapter.xml" /> <xi:include href="../from_md/configuration/gpu-accel.chapter.xml" /> diff --git a/nixos/doc/manual/configuration/file-systems.chapter.md b/nixos/doc/manual/configuration/file-systems.chapter.md new file mode 100644 index 00000000000..901e2e4f181 --- /dev/null +++ b/nixos/doc/manual/configuration/file-systems.chapter.md @@ -0,0 +1,42 @@ +# File Systems {#ch-file-systems} + +You can define file systems using the `fileSystems` configuration +option. For instance, the following definition causes NixOS to mount the +Ext4 file system on device `/dev/disk/by-label/data` onto the mount +point `/data`: + +```nix +fileSystems."/data" = + { device = "/dev/disk/by-label/data"; + fsType = "ext4"; + }; +``` + +This will create an entry in `/etc/fstab`, which will generate a +corresponding [systemd.mount](https://www.freedesktop.org/software/systemd/man/systemd.mount.html) +unit via [systemd-fstab-generator](https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html). +The filesystem will be mounted automatically unless `"noauto"` is +present in [options](#opt-fileSystems._name_.options). `"noauto"` +filesystems can be mounted explicitly using `systemctl` e.g. +`systemctl start data.mount`. Mount points are created automatically if they don't +already exist. For `device`, it's best to use the topology-independent +device aliases in `/dev/disk/by-label` and `/dev/disk/by-uuid`, as these +don't change if the topology changes (e.g. if a disk is moved to another +IDE controller). + +You can usually omit the file system type (`fsType`), since `mount` can +usually detect the type and load the necessary kernel module +automatically. However, if the file system is needed at early boot (in +the initial ramdisk) and is not `ext2`, `ext3` or `ext4`, then it's best +to specify `fsType` to ensure that the kernel module is available. + +::: {.note} +System startup will fail if any of the filesystems fails to mount, +dropping you to the emergency shell. You can make a mount asynchronous +and non-critical by adding `options = [ "nofail" ];`. +::: + +```{=docbook} +<xi:include href="luks-file-systems.section.xml" /> +<xi:include href="sshfs-file-systems.section.xml" /> +``` diff --git a/nixos/doc/manual/configuration/file-systems.xml b/nixos/doc/manual/configuration/file-systems.xml deleted file mode 100644 index 908b5d6c468..00000000000 --- a/nixos/doc/manual/configuration/file-systems.xml +++ /dev/null @@ -1,58 +0,0 @@ -<chapter xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:xi="http://www.w3.org/2001/XInclude" - version="5.0" - xml:id="ch-file-systems"> - <title>File Systems</title> - <para> - You can define file systems using the <option>fileSystems</option> - configuration option. For instance, the following definition causes NixOS to - mount the Ext4 file system on device - <filename>/dev/disk/by-label/data</filename> onto the mount point - <filename>/data</filename>: -<programlisting> -<xref linkend="opt-fileSystems"/>."/data" = - { device = "/dev/disk/by-label/data"; - fsType = "ext4"; - }; -</programlisting> - This will create an entry in <filename>/etc/fstab</filename>, which will - generate a corresponding - <link xlink:href="https://www.freedesktop.org/software/systemd/man/systemd.mount.html">systemd.mount</link> - unit via - <link xlink:href="https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html">systemd-fstab-generator</link>. - The filesystem will be mounted automatically unless - <literal>"noauto"</literal> is present in <link - linkend="opt-fileSystems._name_.options">options</link>. - <literal>"noauto"</literal> filesystems can be mounted explicitly using - <command>systemctl</command> e.g. <command>systemctl start - data.mount</command>. - Mount points are created automatically if they don’t already exist. For - <option><link linkend="opt-fileSystems._name_.device">device</link></option>, - it’s best to use the topology-independent device aliases in - <filename>/dev/disk/by-label</filename> and - <filename>/dev/disk/by-uuid</filename>, as these don’t change if the - topology changes (e.g. if a disk is moved to another IDE controller). - </para> - <para> - You can usually omit the file system type - (<option><link linkend="opt-fileSystems._name_.fsType">fsType</link></option>), - since <command>mount</command> can usually detect the type and load the - necessary kernel module automatically. However, if the file system is needed - at early boot (in the initial ramdisk) and is not <literal>ext2</literal>, - <literal>ext3</literal> or <literal>ext4</literal>, then it’s best to - specify <option>fsType</option> to ensure that the kernel module is - available. - </para> - <note> - <para> - System startup will fail if any of the filesystems fails to mount, dropping - you to the emergency shell. You can make a mount asynchronous and - non-critical by adding - <literal><link linkend="opt-fileSystems._name_.options">options</link> = [ - "nofail" ];</literal>. - </para> - </note> - <xi:include href="../from_md/configuration/luks-file-systems.section.xml" /> - <xi:include href="../from_md/configuration/sshfs-file-systems.section.xml" /> -</chapter> |