From owner-freebsd-stable@FreeBSD.ORG Mon Jun 18 00:11:05 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C802016A468 for ; Mon, 18 Jun 2007 00:11:05 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 7F56513C480 for ; Mon, 18 Jun 2007 00:11:05 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.222] (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id l5I0B1H7006495; Sun, 17 Jun 2007 17:11:04 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <4675CD95.9040004@freebsd.org> Date: Sun, 17 Jun 2007 17:11:01 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robin Gruyters References: <20070601114047.z6qgi686os4ogw4o@server.yirdis.nl> <46658EEB.5000008@freebsd.org> <20070606084406.8v6nkbtv9csgs880@server.yirdis.nl> <200706061715.06603.doconnor@gsoft.com.au> <20070606095820.83tast6s0804osos@server.yirdis.nl> <46679117.5060909@freebsd.org> <20070607153845.24h3nl968skg4scc@server.yirdis.nl> In-Reply-To: <20070607153845.24h3nl968skg4scc@server.yirdis.nl> Content-Type: multipart/mixed; boundary="------------050302020900060504030805" Cc: freebsd-stable@freebsd.org Subject: Listing tar archives from tape (was Re: Unrecognized archive format with RELENG_6_2 and RELENG_6) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2007 00:11:05 -0000 This is a multi-part message in MIME format. --------------050302020900060504030805 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit >> After that I try to read/list the tar from tape with tar -t: >> $ sudo tar -tf /dev/sa0 >> archive.dmp >> tar: Unrecognized archive format: Inappropriate file type or format >> >> But when I extract the archive from tape, it works perfectly: >> $ sudo tar -xvf /dev/sa0 Please try the most recent -STABLE version of libarchive and bsdtar, with the attached patch. This simply disables the skip optimization when reading archives from character or block devices. Tim Kientzle --------------050302020900060504030805 Content-Type: text/x-patch; name="libarchive_tape_drive_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libarchive_tape_drive_fix.patch" Index: archive_read_open_filename.c =================================================================== --- archive_read_open_filename.c (revision 124) +++ archive_read_open_filename.c (working copy) @@ -165,6 +165,15 @@ struct read_file_data *mine = (struct read_file_data *)client_data; off_t old_offset, new_offset; + /* + * Workaround for broken tape interfaces that don't support + * seek(), but return success if you ask them to seek(). This + * also, of course, slows down archive scanning significantly + * on devices that can seek. Yuck. + */ + if (S_ISCHR(mine->st_mode) || S_ISBLK(mine->st_mode)) + return (0); + /* Reduce request to the next smallest multiple of block_size */ request = (request / mine->block_size) * mine->block_size; /* --------------050302020900060504030805--