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
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;
 	/*
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to