Bug 253613 - cpio: Fails to read table of contents from tape that spans multiple medium
cpio: Fails to read table of contents from tape that spans multiple medium
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: cpio (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Ondrej Vasik
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-20 17:21 EDT by David Milburn
Modified: 2010-10-22 13:58 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-28 01:29:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
untested patch (422 bytes, text/x-diff)
2007-09-07 06:24 EDT, Radek Brich
no flags Details

  None (edit)
Description David Milburn 2007-08-20 17:21:02 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7

Description of problem:
Cannot use cpio to read backup sets that span multiple tapes.

Version-Release number of selected component (if applicable):
cpio-2.5-4.RHEL3

How reproducible:
Always


Steps to Reproduce:
1. Insert media in tape drive
2. mt -f /dev/nst0 rewind
3. mt -f /dev/nst0 setblk 0
4. mt -f /dev/nst0 defblksize 0
5. /bin/cpio -ocvC 32768 --force-local -M Tape_Change_Request < /tmp/longlist -F /dev/nst0
6. First tape hits end of media and is ejected, insert second tape
7. mt -f /dev/nst0 rewind
8. mt -f /dev/nst0 setblk 0
9. mt -f /dev/nst0 defblksize 0
10. Complete backup, eject second tape.
11. Put first media back in tape drive to read table of contents
12. /bin/cpio -tC 32768 -M Tape_Change_Request -F /dev/nst0

Failure when you reach the end of the first tape when reading table of contents:
/bin/cpio: read error: Input/output error



Actual Results:
Reproduced on this hardware

SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U (rev 01)
Host: scsi0 Channel: 00 Id: 05 Lun: 00
  Vendor: COMPAQ   Model: SuperDLT1        Rev: 4B4B
  Type:   Sequential-Access                ANSI SCSI revision: 02

Turning debugging on in st.c driver shows the following:

========Backup hits the end of first tape===================
st0: Error: 8000002, cmd: a 0 0 80 0 0 Len: 32768
Info fld=0x0, EOM Current st09:00: sense key None
Additional sense indicates End-of-partition/medium detected
st0: Async write error (write) 7fffffff.
st0: Unloading tape.
============================================================

At this point cpio has not written a filemark at the end of the tape.

========Read hits the end of the first tape================
st0: Error: 8000002, cmd: 8 0 0 80 0 0 Len: 32768
Info fld=0x8000, Current st09:00: sense key Blank Check
Additional sense indicates End-of-data detected
st0: Sense: f0  0  8  0  0 80  0 16
===========================================================

At this point st hits end of data instead of filemark, cpio fails with I/O error.

/bin/cpio: read error: Input/output error


Expected Results:
Expect cpio to read a backup set that spans multiple tapes.

Additional info:
This has also been reproduced with this hardware:

SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 07)
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: HP       Model: Ultrium 2-SCSI   Rev: F43W
  Type:   Sequential-Access                ANSI SCSI revision: 03

========Backup hits the end of first tape===================
kernel: st0: Error: 28000002, cmd: a 0 0 80 0 0 Len: 32768
kernel: Info fld=0x8000, Deferred st09:00: sense key Medium Error
kernel: Additional sense indicates Write error
kernel: st0: Async write error (write) 28000002.
kernel: st0: Unloading tape.
============================================================

At this point cpio has not written a filemark at the end of the tape.

========Read hits the end of the first tape================
kernel: st0: Error: 28000002, cmd: 8 0 0 80 0 0 Len: 32768
kernel: Info fld=0x175, Current st09:00: sense key Medium Error
kernel: Additional sense indicates Recorded entity not found
kernel: st0: Sense: f0  0  3  0  0  1 75  e
========Read hits the end of first tape===================

/bin/cpio: read error: Input/output error
Comment 6 Radek Brich 2007-09-07 06:24:36 EDT
Created attachment 189681 [details]
untested patch

updated source package can be downloaded here:
http://rbrich.fedorapeople.org/cpio-2.5-5.1.RHEL3.src.rpm

Note You need to log in before you can comment on or make changes to this bug.