(revisited) hard or soft links

From: Dermot Paikkos (dermot@sciencephoto.com)
Date: Fri Apr 23 2004 - 11:10:09 EDT


I have had a lot of replies, thanx to; Lawrie Smith, Phil Thomas,
Jason Orendorf, William Bochnik, Dan Riley, Bard Tesaker, David
Smith, Martin Anderson, Bob Harris, Alan Rollow, Dan Byrd, Dr Thomas
Blinn and BL Venkatesh.

A number of things come out of this. If you read the man pages you'll
see that hard links can not cross filesystem. In `ls -l` the 2nd
column show the number of links a file has to it. All directories
have at least two links, one being . and .. While soft link can be
identified by the l in the first character in the long listing, a
hard link does not show itself in this way;
-rw-r--r-- 2 root system 9295 Apr 23 12:46 mylink

Many people suggested find . -links +1 or find . -type f -links +1. I
tried these but always got a list of all files with one link or more.
+2 seems work as expected.

Alas I can find an easy way to find what files are actual hard links
(and to what) which is what I have been asked for. The reason for
this, as some asked, is because my backup software - Bakbone''s
Netvault - is reporting that a full backup is 500+GB and I only have
252GB available and it is not three quaters full yet.

I tried a small backup and restore of /usr/share. du -k showed 85325
(83MB). On tape the backup set was reported as 93MB. I restored the
files to a different location. du -k shows the restored files as
102268 (99MB). ls -l and du -a all report the restored files as being
of equal size to the original. So I am gaining size but I can't see
where. I thought that this may have been due to the backup backing up
data twice thought hard or soft links but I know the software does
not follow soft links.

Thanx for the help. If anyone has any ideas please let me know.
Dp.

------- Original message follows -------
Hi Managers,

My backup is reported backing up twice the amount of data that I
actually have on my files system and I am in the process of debugging
the problem with their tech-support. I have been asked to "confirm if
I have any hard links on my system".

I am not sure how I can search for this. I know the lstat function
will report on links but I am not sure if it will tell me if a link
is
hard or soft.

Any advice?
Dp.

------- End of Origial message -------
~~
Dermot Paikkos * dermot@sciencephoto.com
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:57 EDT