From owner-freebsd-questions@FreeBSD.ORG Thu Jul 8 14:46:36 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D93C1065670 for ; Thu, 8 Jul 2010 14:46:36 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id E6BC48FC0A for ; Thu, 8 Jul 2010 14:46:35 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o68EkXmQ075688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 8 Jul 2010 09:46:34 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.4) with ESMTP id o68EkXrL070482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 8 Jul 2010 09:46:33 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o68EkXRJ070481; Thu, 8 Jul 2010 09:46:33 -0500 (CDT) (envelope-from dan) Date: Thu, 8 Jul 2010 09:46:33 -0500 From: Dan Nelson To: Warren Block Message-ID: <20100708144633.GA87422@dan.emsphone.com> References: <86y6dmo4gh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 8.1-PRERELEASE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Thu, 08 Jul 2010 09:46:34 -0500 (CDT) X-Scanned-By: MIMEDefang 2.45 Cc: Anonymous , freebsd-questions@freebsd.org Subject: Re: livefs hard links X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:46:36 -0000 In the last episode (Jul 08), Warren Block said: > On Thu, 8 Jul 2010, Anonymous wrote: > > Warren Block writes: > >> The FreeBSD livefs ISO filesystem hides hard links, so they can't be > >> accurately copied. > > > > Use `tar cf - | tar xf -' to copy them. > > That was my first thought, too. Well, second thought, after 'rsync -aH'. > > But the mounted ISO filesystem doesn't show hard links as hard links: > > # ls -li /mnt/rescue > 416796 -r-xr-xr-x 414 root wheel 4367520 Jun 9 14:49 [ > 399564 -r-xr-xr-x 414 root wheel 4367520 Jun 9 14:49 atacontrol > 399690 -r-xr-xr-x 414 root wheel 4367520 Jun 9 14:49 atmconfig > 399816 -r-xr-xr-x 414 root wheel 4367520 Jun 9 14:49 badsect > ... It looks like they're halfway hard links :) The link count is 414 for all those files so you know they are hardlinks, but because the inode number is different, there's no way to match up which links correspond to the same file. Each of those files might be unique, just hardlinked to the same names in 413 other identical subdirectories. Unlikely, but possible :) That's probably why tar and rsync can't recreate the links on the destination. I don't think the ISO filesytem format even has the concept of inode numbers, but according to http://lists.freebsd.org/pipermail/freebsd-fs/2006-October/002338.html , mkisofs from the cdrtools port should create hardlinked files with the same starting LBA number, and assuming FreeBSD's cd9660 driver uses that value for its inode number, everything should work. Either the ISOs aren't built with mkisofs, or the driver doesn't use the LBA number for the inode number. -- Dan Nelson dnelson@allantgroup.com