Operating System - HP-UX
1752577 Members
4814 Online
108788 Solutions
New Discussion юеВ

loopback filesystem, or what?

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

loopback filesystem, or what?

While collecting fstype information for writing a Perl script that should run on different flavours of Unix (i.e. HP-UX, AIX, Solaris, Linux) I stumbled over the fstype lofs in HP-UX's fstab manpage.
Looking for a more explicit explantion I couldn't find a mkfs_lofs manpage.
The only somewhat disturbing hint I found is the WARNINGS paragraph in the mount_lofs manpage, "...should only be used by experienced users...blah blah...can be confusing...blah blah".
Doing occasional backups on CD-R/RW on my Linux box at home using mkisofs and cdrecord, I know you can create an image file before burning, that you can mount as a loopback device as if accessing an already burned CDROM to check that everything has been included.
Is HP-UX's lofs something similar or am I on a totally wrong track?
Madness, thy name is system administration
3 REPLIES 3
John Palmer
Honored Contributor
Solution

Re: loopback filesystem, or what?

Hi Ralph,

The following is an extract from the 10.20 Release notes (found in /usr/share/doc):-

LOFS allows mounting an existing directory onto another directory.
The effect is similar to that of a symbolic link, except that the
usual mount options are available, and there are no issues with the
meaning of "..". When an application does a stat(2) on a LOFS file,
the values returned are the same as for the file in its original
location, except that the st_fstype field indicates LOFS. In particular,
st_dev and st_ino are the same, so that the conventional test for
whether two pathnames name the same file (device and inumber match)
continues to work.

Some applications that walk file trees use stat's st_dev to detect the
crossing of mount points. This will not work with LOFS because an
LOFS file has the st_dev of its original location. Code that needs
to identify a particular file system (in the sense of a particular
mount) should use f_fsid from statfs(2) or statvfs(2).

Hope this helps,
John
Ralph Grothe
Honored Contributor

Re: loopback filesystem, or what?

John,

thank you for the lengthy explanation.
Now I know I will have no need for employing HP-UX's loopback filesystems. ;-)
But at least my conclusion to loopback FS from the acronym lofs was correct, even though my notion and usage of lofs under Linux is slightly deviating.

Rainer,

thank you for providing the link.
Isn't it amazing how much CGI URL encoding line noise the HP webdevelopers can put in a single string? ;-)
Madness, thy name is system administration