From owner-freebsd-questions@FreeBSD.ORG Sun Jul 27 21:12:29 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 D82D0435 for ; Sun, 27 Jul 2014 21:12:29 +0000 (UTC) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id BFD82290C for ; Sun, 27 Jul 2014 21:12:29 +0000 (UTC) Received: from segfault-nmh-helo.tristatelogic.com (localhost [127.0.0.1]) by segfault.tristatelogic.com (Postfix) with ESMTP id 498C33AD92 for ; Sun, 27 Jul 2014 14:03:44 -0700 (PDT) From: "Ronald F. Guilmette" To: freebsd-questions@freebsd.org Subject: cpio and hard links Date: Sun, 27 Jul 2014 14:03:44 -0700 Message-ID: <13472.1406495024@server1.tristatelogic.com> 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: Sun, 27 Jul 2014 21:12:29 -0000 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? (If any such option exists, my hasty perusal of the relevant man page did not reveal it. My apologies if I simply missed it. In that case I shall certainly, happily, and humbly attempt to RTFM once again and more carefully.)