1

I would like to understand the root filesystem better and after some research I finally found this root filesystem definition.

The exact contents of the root filesystem will vary according to the computer, but they will include the files that are necessary for booting the system and for bringing it up to such a state that the other filesystems can be mounted as well as tools for fixing a broken system and for recovering lost files from backups. The contents will include the root directory together with a minimal set of subdirectories and files including /boot, /dev, /etc, /bin, /sbin and sometimes /tmp (for temporary files).

As the definition states above the contents of the root filesystem can vary but it should only contain the data that is needed to boot the system. For that reason I assume that the other directories that are part of the filesystem hierarchy standard like /home or /user are not typically part of the root filesystem?

3
  • 1
    The text mentions a minimum set of directories that likely must be part of the root filesystem. It does not say what directories should typically not be part of the root filesystem. What directories are typically part of the root filesystems differs between typical uses of a Linux system. Commented Nov 11, 2022 at 10:47
  • 2
    The definition you found assumes that the root file system is used to boot the system, but at least on Linux that is typically no longer the case: the kernel uses an initramfs to boot, and that has everything needed to mount all the file systems (root and others) needed to fully boot the system. Commented Nov 11, 2022 at 11:51
  • 1
    /root must be on root filesystem (in case of emergency/failed mounting of remote filesystems, etc.) Commented Nov 11, 2022 at 13:12

1 Answer 1

1

Copyright © 2006 The Linux Information Project. All Rights Reserved.

… a slight hint that this might be obsolete information :)

Let's talk about what "typically" means, because it is kind of hard to pinpoint at what kind of Linux system you're looking at.

If we're talking classic "GNU-style" Linux (and not, say, Android), then the vast majority of userlands are probably container or VM workloads, which typically have but one single filesystem for all transient data, and only the persistible payload data might be on a separate file system, and which data that would be depends on whether you're running a database server, an email server or some authentication microservice.

If we're instead constraining us to what you'll find on PCs and laptops, then the answer is "it really depends", as the large distros have moved to defaulting to install everything but /home into a single file system; in some standard installations, that might not even be the case. To make matters just slightly more confusing, default installations for Ubuntu and Fedora (and thus, for the majority of users) end up on btrfs and btrfs subvolumes. Is a subvolume a separate file system? Depends on how you want to define file system.

Distros also differ in how they deal with non-persistent file systems. My /tmp is a tmpfs, so not put on any disk at all, but the OpenSUSE servers at work use the root filesystem for it; /var/run, /var/tmp have similar fates. /boot is on new installations typically only a separate file system if the bootloader can't understand the root file system. Within /boot, there's on modern systems always an EFI subdirectory which is actually a separate FAT32 file system, because that's what the UEFI of your PC knows to boot your bootloader. (Your document can't know that, it predates all this, including even initial ramdisks being the default method of booting for practically any Linux distro, so all they say about boot-time files is inherently not applicable to modern Linux system.)

2
  • Thank you very much for this detailed answer. I think I understand the subject a little better now. It is good to know that large distros have moved to defaulting to install everything but /home into a single file system. I have two more question about that topic. If a user creates a new directory /new_directory, it won't become part of the root file system, will it? Do you also maybe know where I can find more information/literature about this? Commented Nov 12, 2022 at 23:23
  • 1
    Yes it will become part of the root filesystem. Where else would it be? Commented Nov 12, 2022 at 23:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.