]>
Commit | Line | Data |
---|---|---|
6b2a2776 | 1 | --- |
2 | title: Booting Without /usr is Broken | |
3 | category: Manuals and Documentation for Users and Administrators | |
4 | layout: default | |
5 | SPDX-License-Identifier: LGPL-2.1-or-later | |
6 | --- | |
7 | ||
8 | # Booting Without /usr is Broken | |
9 | ||
d6f9d007 | 10 | You probably discovered this page because your shiny new systemd system referred you here during boot time, |
11 | when it warned you that booting without `/usr` pre-mounted wasn't supported anymore. | |
12 | And now you wonder what this all is about. | |
13 | Here's an attempt of an explanation: | |
6b2a2776 | 14 | |
d6f9d007 | 15 | One thing in advance: |
16 | systemd itself is actually mostly fine with `/usr` on a separate file system that is not pre-mounted at boot time. | |
17 | However, the common basic set of OS components of modern Linux machines is not, and has not been in quite some time. | |
18 | And it is unlikely that this is going to be fixed any time soon, or even ever. | |
6b2a2776 | 19 | |
d6f9d007 | 20 | Most of the failures you will experience with `/usr` split off and not pre-mounted in the initramfs are graceful failures: |
21 | they won't become directly visible, however certain features become unavailable due to these failures. | |
22 | Quite a number of programs these days hook themselves into the early boot process at various stages. | |
23 | A popular way to do this is for example via udev rules. | |
24 | The binaries called from these rules are sometimes located on `/usr/bin`, or link against libraries in `/usr/lib`, | |
25 | or use data files from `/usr/share`. | |
26 | If these rules fail udev will proceed with the next one, | |
27 | however later on applications will then not properly detect these udev devices or features of these devices. | |
28 | Here's a short, very in-comprehensive list of software we are aware of that currently are not able to provide the full set of functionality when `/usr` is split off and not pre-mounted at boot: | |
29 | udev-pci-db/udev-usb-db and all rules depending on this | |
30 | (using the PCI/USB database in `/usr/share`), | |
31 | PulseAudio, NetworkManager, ModemManager, udisks, libatasmart, usb\_modeswitch, | |
32 | gnome-color-manager, usbmuxd, ALSA, D-Bus, CUPS, Plymouth, LVM, hplip, multipath, Argyll, VMWare, | |
33 | the locale logic of most programs and a lot of other stuff. | |
6b2a2776 | 34 | |
d6f9d007 | 35 | You don't believe us? |
36 | Well, here's a command line that reveals a few obvious cases of udev rules that will silently fail to work if `/usr` is split off and not pre-mounted: | |
37 | `egrep 'usb-db|pci-db|FROM_DATABASE|/usr' /*/udev/rules.d/*` | |
38 | -- and you find a lot more if you actually look for it. | |
39 | On my fresh Fedora 15 install that's 23 obvious cases. | |
6b2a2776 | 40 | |
41 | ## The Status Quo | |
42 | ||
d6f9d007 | 43 | Due to this, many upstream developers have decided to consider the problem of a separate |
44 | `/usr` that is not mounted during early boot an outdated question, | |
45 | and started to close bugs regarding these issues as WONTFIX. | |
46 | We certainly cannot blame them, as the benefit of supporting this is questionable and brings a lot of additional work with it. | |
6b2a2776 | 47 | |
48 | And let's clarify a few things: | |
49 | ||
d6f9d007 | 50 | 1. **It isn't systemd's fault.** systemd mostly works fine with `/usr` on a separate file system that is not pre-mounted at boot. |
6b2a2776 | 51 | 2. **systemd is merely the messenger.** Don't shoot the messenger. |
d6f9d007 | 52 | 3. **There's no news in all of this.** The message you saw is just a statement of fact, describing the status quo. |
53 | Things have been this way since a while. | |
6b2a2776 | 54 | 4. **The message is merely a warning.** You can choose to ignore it. |
d6f9d007 | 55 | 5. **Don't blame us**, don't abuse us, it's not our fault. |
56 | We have been working on the Linux userspace since quite some time, | |
57 | and simply have enough of the constant bug reports regarding these issues, | |
58 | since they are actually very hard to track down because the failures are mostly graceful. | |
59 | Hence we placed this warning into the early boot process of every systemd Linux system with a split off and not pre-mounted | |
60 | `/usr`, so that people understand what is going on. | |
6b2a2776 | 61 | |
62 | ## Going Forward | |
63 | ||
d6f9d007 | 64 | `/usr` on its own filesystem is useful in some custom setups. |
65 | But instead of expecting the traditional Unix way to (sometimes mindlessly) distributing tools between `/usr` and `/`, | |
66 | and require more and more tools to move to `/`, | |
67 | we now just expect `/usr` to be pre-mounted from inside the initramfs, to be available before 'init' starts. | |
68 | The duty of the minimal boot system that consisted of `/bin`, `/sbin` and `/lib` on traditional Unix, | |
69 | has been taken over by the initramfs of modern Linux. | |
70 | An initramfs that supports mounting `/usr` on top of `/` before it starts 'init', makes all existing setups work properly. | |
6b2a2776 | 71 | |
d6f9d007 | 72 | There is no way to reliably bring up a modern system with an empty `/usr`. |
73 | There are two alternatives to fix it: move `/usr` back to the rootfs or use an initramfs which can hide the split-off from the system. | |
6b2a2776 | 74 | |
d6f9d007 | 75 | On the Fedora distribution we have succeeded to clean up the situation and the confusion the current split between `/` and `/usr` has created. |
76 | We have moved all tools that over time have been moved to `/` back to `/usr` (where they belong), | |
77 | and the root file system only contains compatibility symlinks for `/bin` and `/sbin` into `/usr`. | |
78 | All binaries of the system are exclusively located within the `/usr` hierarchy. | |
6b2a2776 | 79 | |
d6f9d007 | 80 | In this new definition of `/usr`, the directory can be mounted read-only by default, |
81 | while the rootfs may be either read-write or read-only (for stateless systems) and contains only the empty mount point directories, | |
82 | compat-symlinks to `/usr` and the host-specific data like `/etc`, `/root`, `/srv`. | |
83 | In comparison to today's setups, the rootfs will be very small. | |
84 | The host-specific data will be properly separated from the installed operating system. | |
85 | The new `/usr` could also easily be shared read-only across several systems. | |
86 | Such a setup would be more efficient, can provide additional security, is more flexible to use, | |
87 | provides saner options for custom setups, and is much simpler to setup and maintain. | |
6b2a2776 | 88 | |
0d592a5e | 89 | For more information on this please continue to [The Case for the /usr Merge](/THE_CASE_FOR_THE_USR_MERGE). |