at 17.09-beta 1.8 kB view raw
1<chapter xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude" 4 version="5.0" 5 xml:id="ch-file-systems"> 6 7<title>File Systems</title> 8 9<para>You can define file systems using the 10<option>fileSystems</option> configuration option. For instance, the 11following definition causes NixOS to mount the Ext4 file system on 12device <filename>/dev/disk/by-label/data</filename> onto the mount 13point <filename>/data</filename>: 14 15<programlisting> 16fileSystems."/data" = 17 { device = "/dev/disk/by-label/data"; 18 fsType = "ext4"; 19 }; 20</programlisting> 21 22Mount points are created automatically if they don’t already exist. 23For <option>device</option>, it’s best to use the topology-independent 24device aliases in <filename>/dev/disk/by-label</filename> and 25<filename>/dev/disk/by-uuid</filename>, as these don’t change if the 26topology changes (e.g. if a disk is moved to another IDE 27controller).</para> 28 29<para>You can usually omit the file system type 30(<option>fsType</option>), since <command>mount</command> can usually 31detect the type and load the necessary kernel module automatically. 32However, if the file system is needed at early boot (in the initial 33ramdisk) and is not <literal>ext2</literal>, <literal>ext3</literal> 34or <literal>ext4</literal>, then it’s best to specify 35<option>fsType</option> to ensure that the kernel module is 36available.</para> 37 38<note><para>System startup will fail if any of the filesystems fails to mount, 39dropping you to the emergency shell. 40You can make a mount asynchronous and non-critical by adding 41<literal>options = [ "nofail" ];</literal>. 42</para></note> 43 44<xi:include href="luks-file-systems.xml" /> 45 46</chapter>