1

At least historically, Red Hat wrote

In Red Hat Enterprise Linux, the intended use for the /usr/local/ directory is slightly different from that specified by the FHS. The FHS says that /usr/local/ should be where software that is to remain safe from system software upgrades is stored. Since software upgrades can be performed safely with Red Hat Package Manager (RPM), it is not necessary to protect files by putting them in /usr/local/. Instead, the /usr/local/ directory is used for software that is local to the machine.

For instance, if the /usr/ directory is mounted as a read-only NFS share from a remote host, it is still possible to install a package or program under the /usr/local/ directory.

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-filesystem-fhs.html

But, this suggests that you have a local filesystem /usr/local, mounted on a directory of the NFS filesystem /usr.

Did Red Hat really support mounting /usr/local as a local filesystem, at the correct point after the network was connected and /usr was mounted over NFS? And vice-versa at shutdown time? How was this implemented? Are there some interesting options e.g. of mount which were required to implement this?

The RHEL init script for mounting network filesystems is called netfs.

  • Interesting Q and A. I remember coming across netfs in pre-systemd releases but never had any cause to look into it. – Anthony G - justice for Monica Aug 26 at 13:22
1

In a similar case, customers were instructed to write a custom init script to mount (and unmount) the filesystem at the necessary point.

So this would have been a possible solution, which avoids the customer worrying about any hairy details.

The example uses a comment in the init script which was recognized by chkconfig, to configure the ordering.

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Global_File_System_2/s1-manage-mountorder.html

In this example script, the values of the chkconfig statement indicate the following:

345 indicates the run levels that the script will be started in

29 is the start priority, which in this case indicates that the script will run at startup time after the GFS2 init script, which has a start priority of 26

73 is the stop priority, which in this case indicates that the script will be stopped during shutdown before the GFS2 script, which has a stop priority of 74

#!/bin/bash
#
# chkconfig: 345 29 73
# description: mount/unmount my custom bind mounts onto a gfs2 subdirectory
#
#
### BEGIN INIT INFO
# Provides: 
### END INIT INFO

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.