From owner-freebsd-questions@FreeBSD.ORG Sat Aug 9 16:17:48 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3FEBD78 for ; Sat, 9 Aug 2014 16:17:48 +0000 (UTC) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id 3181F2B9F for ; Sat, 9 Aug 2014 16:17:47 +0000 (UTC) X-Virus-Scanned: by clamd daemon 0.98.1 for FreeBSD at relay2.tomsk.ru Received: from admin.sibptus.tomsk.ru (account sudakov@sibptus.tomsk.ru [212.73.125.240] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPSA id 36269614 for freebsd-questions@freebsd.org; Sat, 09 Aug 2014 23:17:45 +0700 Received: from admin.sibptus.tomsk.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.tomsk.ru (8.14.7/8.14.7) with ESMTP id s79GHjHg066326 for ; Sat, 9 Aug 2014 23:17:45 +0700 (NOVT) (envelope-from vas@mpeks.tomsk.su) Received: (from sudakov@localhost) by admin.sibptus.tomsk.ru (8.14.7/8.14.7/Submit) id s79GHjLh066325 for freebsd-questions@freebsd.org; Sat, 9 Aug 2014 23:17:45 +0700 (NOVT) (envelope-from vas@mpeks.tomsk.su) X-Authentication-Warning: admin.sibptus.tomsk.ru: sudakov set sender to vas@mpeks.tomsk.su using -f Date: Sat, 9 Aug 2014 23:17:45 +0700 From: Victor Sudakov To: freebsd-questions@freebsd.org Subject: Re: cpio and hard links Message-ID: <20140809161745.GB65785@admin.sibptus.tomsk.ru> References: <13472.1406495024@server1.tristatelogic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13472.1406495024@server1.tristatelogic.com> Organization: AO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 16:17:48 -0000 Ronald F. Guilmette wrote: > > > Given a directory "tmp" which contains two files, "foo" and "bar", > both of which are merely hard links to one another, the following > command will, apparently, produce an archive of the directory in > question which contains only a single instance of the actual file > contents: > > tar cvf tmp.tar tmp > > The resulting tmp.tar file can later be unpacked, using tar, resulting > in a directory structure which exactly mirrors the original "tmp" > directory, including preservation of the hard link(s). > > I note however that, given the same original directory structure, the > following command generates an archive file containing two complete > instances of the file data: > > find tmp -depth -print | cpio -ovm > tmp.cpio > > For the the cpio program that is part of FreeBSD, is there any option > which would have the effect of causing cpio to only archive a single > instance of the data associated with each unique inode... as tar apparently > does, by default? Try 'cpio -H ustar'. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN sip:sudakov@sibptus.tomsk.ru