1821872 Members
3068 Online
109638 Solutions
New Discussion юеВ

Re: soft link

 
SOLVED
Go to solution
Shivkumar
Super Advisor

soft link

Hi,

Many people suggest use of soft links as a work around for saving disk space.

I want to know what are the shortcomings or risk of soft links or is it covered under best practices ?
Should we discourage the use of soft links ?

Thanks,
Shiv
6 REPLIES 6
skt_skt
Honored Contributor

Re: soft link

There is no harm in using soft links. The link file did not get backed up with some backup tools if the link is a pointer to another directory structure. It recognize this is just a link and skip it.
James R. Ferguson
Acclaimed Contributor
Solution

Re: soft link

Hi Shiv:

Soft links (or "symbolic links" as they are known) have great value. Unlike hard links, soft links can point from one file system to another. Soft links store the linkage information within their inode and are thus efficient structures.

Symbolic links can point to files, directories or even other symbolic links, Circular references can be detected since the kernel will limit the number of paths it traverses.

Symbolic links are paricularly useful when creating and using software that needs to actually point to different versions or to different locations.

For example, whether you have a Perl installation in '/usr' or in '/opt' doesn't matter to your Perl script if you create a symbolic link (e.g. '/usr/bin/perl' that points to the real binary location. That is, the 'shebang' (interpreter line) in you script can always remain "#!/usr/bin/perl".

Some of the standard system utilities can be made sensitive or insensitve to symbolic links. The '-follow' option of 'find' is one such example. The '-s' option of 'fbackup' is another example. The '-h' option of 'cpio' is yet another case. See the manpages for the aforementioned commands for the details of how the various options treat symbolic links.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: soft link

Soft links don't really save disk space but they do allow you to point to another filesystem which has free space. Link almost all UNIX feature, soft links are quite useful and there is really no downside to using them. One possible "gotcha" is that it is very easy to create a soft link that points to nothing because no checking is done when the link is created to see if the file pointed to actually exists.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: soft link

>Clay: because no checking is done when the link is created to see if the file pointed to actually exists.

You can use "ll -L" to see if the link is valid.
Michael Steele_2
Honored Contributor

Re: soft link

The only time I've seen problems with softlinks involved backup software like netbackup and omniback / data protector, or over NFS file systems related to some kind of network event, for example, in the middle of the night during network backups.
Support Fatherhood - Stop Family Law
Rasheed Tamton
Honored Contributor

Re: soft link

Hi,


The source and target for softlinks can be on seperate file systems, source does not

have to exist, it can be used on NFS env, etc. When a user removes a symbolic link,

the file to which it was pointed remains unaffected. Softlinks need additional I/O

necessary to complete file access, additional storage space taken up by softlink

file's inode data, etc. Soft link is kind of a "shortcut" (in windows term).

Softlinks do not exhibit the same file permissions as the source. It does show a new

permission bit: the 'l' bit. If we delete the source file for the softlink, then we

lose the ability to access the linked data through the softlinked file.

Needs little bit attention for maintenance of symbolic links; if the target of a

symbolic link is removed, the data vanishes and all links to it become orphans. Also,

removing a symbolic link has no effect on its source file.

There vere some known vulnerabilities reg. tmp directories and man related to symlinks.

Regards,
Rasheed Tamton.