]> git.ipfire.org Git - thirdparty/systemd.git/blob - docs/MOUNT_REQUIREMENTS.md
docs: add distributions and mastodon
[thirdparty/systemd.git] / docs / MOUNT_REQUIREMENTS.md
1 ---
2 title: Mount Requirements
3 category: Booting
4 layout: default
5 SPDX-License-Identifier: LGPL-2.1-or-later
6 ---
7
8 # Mount Point Availability Requirements
9
10 systemd makes various requirements on the time during boot where various parts
11 of the Linux file system hierarchy must be available and must be mounted. If
12 the file systems backing these mounts are located on external or remote media,
13 that require special drivers, infrastructure or networking to be set up, then
14 this implies that this functionality must be started and running at that point
15 already.
16
17 Generally, there are three categories of requirements:
18
19 1. 🌥️ *initrd*: File system mounts that must be established before the OS
20 transitions into the root file system. (i.e. that must be stablished from
21 the initrd before the initrd→host transition takes place.)
22
23 2. 🌤️ *early*: File system mounts that must be established during early boot,
24 after the initrd→host transition took place, but before regular services are
25 started. (i.e. before `local-fs.target` is reached.)
26
27 3. ☀️ *regular*: File system mounts that can be mounted at any time during the
28 boot process – but which specific, individual services might require to be
29 established at the point they are started. (i.e. these mounts are typically
30 ordered before `remote-fs.target`.)
31
32 Of course, mounts that fall into category 3 can also be mounted during the
33 initrd or in early boot. And those from category 2 can also be mounted already
34 from the initrd.
35
36 Here's a table with relevant mounts and to which category they belong:
37
38 | *Mount* | *Category* |
39 |---------------|------------|
40 | `/` (root fs) | 1 |
41 | `/usr/` | 1 |
42 | `/etc/` | 1 |
43 | `/var/` | 2 |
44 | `/var/tmp/` | 2 |
45 | `/tmp/` | 2 |
46 | `/home/` | 3 |
47 | `/srv/` | 3 |
48 | XBOOTLDR | 3 |
49 | ESP | 3 |
50
51 Or in other words: the root file system (obviously…), `/usr/` and `/etc/` (if
52 these are split off) must be mounted at the moment the initrd transitions into
53 the host. Then, `/var/` (with `/var/tmp/`) and `/tmp/` (if split off) must be
54 mounted, before the host reaches `local-fs.target` (and then `basic.target`),
55 after which any remaining mounts may be established.
56
57 If mounts such as `/var/` are not mounted during early boot (or from the
58 initrd), and require some late boot service (for example a network manager
59 implementation) to operate this will likely result in cyclic ordering
60 dependencies, and will result in various forms of boot failures.
61
62 If you intend to use network-backed mounts (NFS, SMB, iSCSI, NVME-TCP and
63 similar, including anything you add the `_netdev` pseudo mount option to) for
64 any of the mounts from category 1 or 2, make sure to use a network managing
65 implementation that is capable of running from the initrd/during early
66 boot. [`systemd-networkd(8)`](https://www.freedesktop.org/software/systemd/man/latest/systemd-networkd.html)
67 for example works well in such scenarios.
68
69 Note that
70 [`systemd-homed.service(8)`](https://www.freedesktop.org/software/systemd/man/latest/systemd-homed.html)
71 (which is a regular service, i.e. runs after `basic.target`) requires `/home/`
72 to be mounted.