Forum Moderators: mack

Message Too Old, No Replies

Too many levels of symbolic link...

..an explanation, please.

         

Syzygy

9:07 pm on Jan 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We've parted company with one of our web hosting & development companies. In the meantime they're still hosting a couple of small sites for us.

I, as a complete amateur, have been asked (well, actually I volunteered) to make some changes to the content of one of the sites, however, when trying to access it I get, "Cannot open remote folder: too many levels of symbolic link".

This means absolutely nothing to me.

Really, I need an explanation so that, a) I know what the problem is, and b) I can tell them what the problem is...

Syzygy

iamlost

1:21 am on Jan 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Probably:
* One: the pathname lookup encountered more levels of symbolic links than the server's internal limit; or
* Two: the pathname lookup encountered a self-referencing loop.

Note: If not a symbolic link loop problem it is probably an overuse of symbolic links in your filesystem. This situation should be avoided due to potential filesystem tree structure disruption.

Note: Simple basenames should never be used for pathname arguments where the last argument is a directory because the resulting symbolic link likely points to itself: a self-referencing loop.

Note: Never link a file to a symbolic link: a self-referencing loop.

To resolve the problem either reduce the number of symbolic links in the path or remove the symbolic link loop.

This is something to discuss with a server-admin-type-person unless you are happy reworking your files links within the server and you have that authorisation level.

Syzygy

8:05 pm on Jan 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the info, iamlost, but now I am lost...

Think idiot, think dummy, think as stupid as they come - and then think me...

An explanation at that level would really be useful...

Syzygy

Syzygy

12:16 am on Jan 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I'm please to say that I've 'solved' the problem; it came in the guise of the host directory name.

The hosting company appears to be unaware as to what this is - and have supplied me with variations on a theme that haven't worked. I expanded on this theme, and lo and behold, I've now managed to ftp into the site successfully...

Call it luck, call it intuition, call it done.

Regardless, my post above still stands, a guide for a complete idiot would still be appreciated.

Syzygy

iamlost

5:07 am on Jan 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I kept simplifying until it made absolutely no sense and then backed up to here. I think it makes sense and is reasonably accurate. Hope it helps visualise the process.

--------------------------------------------------

Basic Filesystem Links:

* One: A filesystem link - not a web site link! - is a systems file that points (refers) to an object (usually a file or program or directory). In essence the aggregate of such link files is a *nix computers index.

* Two: *nix has two kinds of links:
1: hard. Think Windows registry
2: soft or symbolic. Think Windows shortcuts

* Three: *nix files consist of two parts:
1: a data part that is also associated with an inode which maps the disk location, the file permissions, etc. for the data.
2: a filename part consisting of a name and an associated inode number.

* Four: Each file on a *nix filesystem has a back end which is the file's content on the disk and a front end which is a hard link to that disk address.

* Five: In *nix you can create multiple hard links which point to the same file contents on disk. All hard links to a file are the same irregardless of creation date which is why there is a column (right after the file permissions column) specifically listing the hard links. There is no other easy way (for us - the computer has no prob!) to determine the number of hard links to a file.

* Six: A *nix filesystem automatically creates a hard link (named ".") to a directory when it is created. Similarly all subdirectories also get created with hard links (named "..")
to their parent directories. This is why the command "cd .."
will move you up one directory.

* Seven: Hard Link Summary:
1: the source file must exist.
2: both links must be resident of the same filesystem; cannot span disk drives.
3: can point to programs and files but not directories ("." and ".." are relative; user cannot create a different direct hard link to a specific directory).
4: point to the same inode and the same set of data blocks.
5: is not broken when the program or file it points to is renamed, moved, or deleted.
6: mindless mucking about with hard links (especially those pointing to directories) can cause filesystem difficulties.

* Eight: A soft or symbolic link is a special file type:
1: the Operating System recognises the special file type (whose data part contains the path to another file) and accesses the data in the file named in the special file rather than the data in the special file itself.
2: with its own inode. This inode is different from the object (file or program or directory) to which it points.
3: a soft link (unlike a hard link) can point to another soft link.
4: a self-referencing loop can result when a soft link, directly or indirectly, points back at itself.
5: unlike a hard link a soft link can point to directories and can cross file systems.
6: a soft link will require additional I/O for file access and additional storage for its file data.

* Nine: Soft Link Summary:
1: the source file does not have to exist.
2: source and target can be on separate file systems
3: can point to directories.
4: the soft link is broken if the program, file, or directory it points to is renamed, moved, or deleted.

---------------------------------------------

To expand on my first post in this thread: if the soft/symbolic link points to too many other soft links (many systems stop at level 8) or if the link points to itself the Operating System will throw an error to say it can not resolve the requested file.

Filename Linking is the backbone of any operating system. It should be kept as short, simple, and clean as possible. Regular maintenance is a server admin responsibility. The people at a hosting site are as critical as the equipment. I never host where I am not comfortable with the backend geeks. From your comment I think it is "a good thing" that you are changing hosts.

Syzygy

11:16 am on Jan 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



iamlost - thanks ever so much for taking the time to do that; it's very much appreciated.

Cheers,

Syzygy