Show Table of Contents
2.3. File System Layout
Red Hat Enterprise Linux 7 introduces two major changes to the layout of the file system.
- The
/bin,/sbin,/liband/lib64directories are now under the/usrdirectory. - The
/tmpdirectory can now be used as a temporary file storage system (tmpfs). - The
/rundirectory is now used as a temporary file storage system (tmpfs). Applications can now use/runthe same way they use the/var/rundirectory.
2.3.1. New layout for root file system
Traditionally, only the minimum necessary content was included in the
/bin and /lib directories to avoid slowing down the boot process. Some of the utilities needed to be at the root (/) level in order to mount the /usr partition. This created a situation where other utilities spread their content over multiple levels of directories, for example, in both /bin and /usr/bin.
Red Hat Enterprise Linux 7 moves the
/bin, /sbin, /lib and /lib64 directories into /usr. Because the /usr file system can now be mounted by initramfs rather than by utilities in root level directories, there is no longer a need to split package contents between the two different directory levels. This allows for a much smaller root file system, enabling systems that can more efficiently share disk space, and systems that are easier to maintain, more flexible, and more secure.
To lessen the impact of this change, the previous
/bin directory is now a symbolic link to /usr/bin, /sbin to /usr/sbin, and so on.
2.3.1.1. Preparing your file system for upgrade
Warning
Note, that if
/usr is on a separate partition, the in-place upgrade is not possible. If you decide to move the /usr from the separate partition, be aware that this is at your own risk.
If
/var is on a separate partition, you must manually convert /var/run and /var/lock to symbolic links:
# mv -f /var/run /var/run.runmove~ # ln -sfn /run /var/run # mv -f /var/lock /var/lock.lockmove~ # ln -sfn /run/lock /var/lock
Important
You must make sure you address all preupgrade-assistant results regarding partitioning scheme.
When your preparations are complete, see the Red Hat Enterprise Linux 7 Installation Guide for additional details on performing the upgrade process.
2.3.1.2. Verifying a successful upgrade
After performing the upgrade process, it is important to verify that the upgrade worked as expected.
- Check that the following symbolic links exist:
/binis a symbolic link to/usr/bin/sbinis a symbolic link to/usr/sbin/libis a symbolic link to/usr/lib/lib64is a symbolic link to/usr/lib64/var/runis a symbolic link to/run/var/lockis a symbolic link to/run/lock
If the directories listed are symbolic links, as expected, two more checks are required. - Check the output of the following find command:
# find /usr/{lib,lib64,bin,sbin} -name '.usrmove'Files or directories displayed in response to this command could not be copied to/usrbecause a file or directory with the same name was already present in/usr. You will need to manually resolve these naming conflicts. - Check the following directories for files that you want to keep:
/var/run.runmove~/var/lock.lockmove~
If any of the directories listed are not symbolic links, you will need to follow the recovery process outlined in Section 2.3.1.3, “Recovering from a failed upgrade”.
2.3.1.3. Recovering from a failed upgrade
The upgrade process may fail for a number of reasons. Check the output of the following commands to see what went wrong:
# dmesg # journalctl -ab --full
If no errors are visible, check that:
/is writable/usris writable/usrmounted correctly/has sufficient space/usrhas sufficient space/varis mounted in the rhelup tool
Contact Red Hat Support if you need further assistance.
2.3.2. Changes to the /tmp directory
Red Hat Enterprise Linux 7 offers the ability to use
/tmp as a mount point for a temporary file storage system (tmpfs).
When enabled, this temporary storage appears as a mounted file system, but stores its content in volatile memory instead of on a persistent storage device. No files in
/tmp are stored on the hard drive except when memory is low, in which case swap space is used. This means that the contents of /tmp are not persisted across a reboot.
To enable this feature, execute the following command:
# systemctl enable tmp.mount
To disable this feature, execute the following command:
# systemctl disable tmp.mount
Red Hat recommends the following uses for the various types of temporary storage space in Red Hat Enterprise Linux 7.
- Privileged processes, such as daemons, should use
/run/processnameto store temporary data. - Processes that store a large amount of data, or require temporary data to persist across reboots, should use
/var/tmp. - All other processes should use
/tmpto store temporary data.
2.3.3. Changes to the /run directory
Important
Preupgrade Assistant did not yet check for the effects of this change in the initial release of Red Hat Enterprise Linux 7.0. This issue was corrected in RHBA-2014:1627, available here: https://rhn.redhat.com/errata/RHBA-2014-1627.html.
Previous versions of Red Hat Enterprise Linux allowed some programs to store runtime data in the
/dev directory during early boot, prior to the /var directory being mounted. Consensus between major Linux distributions is that /run should be used instead, as the /dev directory should be used only for device nodes.
Therefore, in Red Hat Enterprise Linux 7, the
/run directory is a temporary file storage system (tmpfs) that bind mounts the /var/run directory. Likewise, the /run/lock directory now bind mounts the /var/lock directory. Files stored in /run and /run/lock are no longer persistent and do not survive a reboot. This means that applications must recreate their own files and directories on startup, rather than doing this once at installation time. An /etc/app_name directory would be ideal for this.
For details on how to recreate files and directories at startup, see the
tmpfiles.d man page: man tmpfiles.d. For example configuration, see the configuration files in /etc/tmpfiles.d.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.