From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dermot Paikkos Newsgroups: gmane.os.tru64.managers Subject: (revisited) hard or soft links Date: Fri, 23 Apr 2004 16:10:09 +0100 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <40893FE1.10175.148CB5AB@localhost> Reply-To: dermot@sciencephoto.com NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1082733088 11467 80.91.224.253 (23 Apr 2004 15:11:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Apr 2004 15:11:28 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Fri Apr 23 17:11:15 2004 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1BH2Ke-0005MK-00 for ; Fri, 23 Apr 2004 17:11:13 +0200 Original-Received: (qmail 14112 invoked by uid 5); 23 Apr 2004 15:11:02 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 14097 invoked by uid 49501); 23 Apr 2004 15:11:02 -0000 Original-Received: from dermot@sciencephoto.com by sws1 by uid 49491 with qmail-scanner-1.21 (clamdscan: 0.70-rc. iscan: v3.1/v5.600-1011/847/50540. spamassassin: 2.63. Clear:RC:0(160.91.86.17):SA:0(-4.9/5.0):. Processed in 0.779724 secs); 23 Apr 2004 15:11:02 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (160.91.86.17) by 0 with SMTP; 23 Apr 2004 15:11:01 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0HWM008X0Q69M6@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 23 Apr 2004 11:11:00 -0400 (EDT) Original-Received: from VIRUSCAN-DAEMON.emroute2.cind.ornl.gov by emroute2.cind.ornl.gov (PMDF V6.2-X27 #30899) id <0HWM00002Q5QGH@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 23 Apr 2004 11:10:40 -0400 (EDT) Original-Received: from helios.sciencephoto.co.uk (helios.sciencephoto.co.uk [194.200.237.129]) by emroute2.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0HWM00FKNQ5P4T@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 23 Apr 2004 11:10:38 -0400 (EDT) Original-Received: from [194.200.237.140] (helo=dione) by helios.sciencephoto.co.uk with esmtp (Exim 3.16 #3) id 1BH2K4-0004sr-00 for tru64-unix-managers@ornl.gov; Fri, 23 Apr 2004 16:10:36 +0100 Original-To: tru64-unix-managers@ornl.gov X-Mailer: Pegasus Mail for Windows (v4.12a) Content-description: Mail message body Priority: normal Xref: main.gmane.org gmane.os.tru64.managers:6854 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:6854 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