Lofs

Does anyone use lofs (loopback file systems)? I'm not looking for any deep details, but are there actually any advantages to using lofs? If anyone knows, what are the basic advantages?

Thanks.
-S

i only use loopback when mounting iso's

Sowser, you need specify what OS you are using. There are at least two very different kinds of loopback filesystems.

2 types? no kidding? Solaris 8 is the version. I see it used in this new environment. It is simply a standard to use it. No one can give me a good reason for it. I was hoping for any type of info.

Thanks.

-S

The Solaris style of loopback filesystem is an alternative to symbolic links. Let's assume that you have / and /usr filesystems and they are somewhat full but you want to create a /usr/local hierarchy. And let's assume that you have a /export filesystem with plenty of space. You could create a directory called, say, /export/usr.local then create a symbolic link called /usr/local that points to it. Symbolic links have various problems though. As one example:
cd /usr/local/
cd ..
might place you in /export or it might place you in /usr. Some shells like ksh have a "cd -L" and a "cd -P" so they can do either. Other shells might do one or the other. But now instead of a symlink, we can make a directory called /usr/local and do a loopback mount of /export/usr.local on it. Now, /usr/local has only one parent directory, which is /usr. That is pretty much it. It removes the screwy side effects of symlinks.

One other interesting thing to note is what happens when using the automounter.

lets say you have auto_home like this:

/home/* homeserver:/export/home/&

Now if you log into a server other than homeserver it will NFS mount the home directory from /export/home/<username> on homeserver.

If however you do the same thing on homeserver it will resolve this an perform a loopback mount /export/home/<username> on /home/username.

Is this analogous to what linux can do with remount?

I guess so, if by that you mean:

mount --rbind /mounted_directory /secondary_mount_point