From 4c10e0ff9ddea45b344134228dd5874b9ae0bd06 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Wed, 8 Sep 2021 15:05:50 +0800 Subject: [PATCH] nixos: nixos/doc/manual/configuration/file-systems.xml to CommonMark --- .../manual/configuration/configuration.xml | 2 +- .../configuration/file-systems.chapter.md | 42 ++++++++++++++ .../doc/manual/configuration/file-systems.xml | 58 ------------------- .../configuration/file-systems.chapter.xml | 55 ++++++++++++++++++ 4 files changed, 98 insertions(+), 59 deletions(-) create mode 100644 nixos/doc/manual/configuration/file-systems.chapter.md delete mode 100644 nixos/doc/manual/configuration/file-systems.xml create mode 100644 nixos/doc/manual/from_md/configuration/file-systems.chapter.xml diff --git a/nixos/doc/manual/configuration/configuration.xml b/nixos/doc/manual/configuration/configuration.xml index a55dea96c757..6f59262eae70 100644 --- a/nixos/doc/manual/configuration/configuration.xml +++ b/nixos/doc/manual/configuration/configuration.xml @@ -16,7 +16,7 @@ - + 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 000000000000..901e2e4f181b --- /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} + + +``` diff --git a/nixos/doc/manual/configuration/file-systems.xml b/nixos/doc/manual/configuration/file-systems.xml deleted file mode 100644 index 908b5d6c4681..000000000000 --- a/nixos/doc/manual/configuration/file-systems.xml +++ /dev/null @@ -1,58 +0,0 @@ - - File Systems - - You can define file systems using the - 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: - -."/data" = - { device = "/dev/disk/by-label/data"; - fsType = "ext4"; - }; - - This will create an entry in /etc/fstab, which will - generate a corresponding - systemd.mount - unit via - systemd-fstab-generator. - The filesystem will be mounted automatically unless - "noauto" is present in 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 - , - 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 - (), - 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 to ensure that the kernel module is - available. - - - - 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" ];. - - - - - diff --git a/nixos/doc/manual/from_md/configuration/file-systems.chapter.xml b/nixos/doc/manual/from_md/configuration/file-systems.chapter.xml new file mode 100644 index 000000000000..71441d8b4a5b --- /dev/null +++ b/nixos/doc/manual/from_md/configuration/file-systems.chapter.xml @@ -0,0 +1,55 @@ + + 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: + + +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 + unit via + systemd-fstab-generator. + The filesystem will be mounted automatically unless + "noauto" is present in + 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. + + + + 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" ];. + + + + +