Score:0

NFS mount best practice

hr flag

Say I have some data on an NFS server that is currently mounted to /mnt/data on a client but I want to have it accessible at /home/user/data instead, both server and client are running 22.04.

Would it be best practice to mount the NFS data share directly to /home/user/data or use some kind of symlink or hard link to point /home/user/data to /mnt/data?

Or does it really not matter? My gut feeling is to just mount the NFS share directly to the desired location.

Marco avatar
br flag
Is `/home/user` mounted via NFS?
twinsuns avatar
hr flag
no it's not, `/mnt/data` is the only NFS mount
Marco avatar
br flag
Will `/home/user/data` be the only place where `data` should be used, or are there more places (in future) ? e.g. `/home/user2/data` ?
twinsuns avatar
hr flag
`/home/user/data` will be the only place `data` will be used.
Score:0
br flag

The answer depends on some things.

Parent folder is NFS mount: In this case I would use a symlink, because in worst case the mount-in-mount might freeze your whole system (network down, nfs-server restart, ...)

Need it at several places: I think multiple mounts of the same NFS directory in worst case could lead to data loss (locking). Better use symlink to the single mount.

Access Permissions: Be aware, that Linux is a multiuser System (many user can be logged in, e.g. from remote via ssh, xdmcp, ...). Depending on the security needs mounting it "somewhere" and using symlink might give others access without being aware of.

As the question asking for an "opinion", not for a "solution", this is my personal opinion from my experience. Others might see this different.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.