LinearTapeFileSystem / ltfs

Reference implementation of the LTFS format Spec for stand alone tape drive
BSD 3-Clause "New" or "Revised" License
256 stars 77 forks source link

Can't do mkltfs on HP StorageWorks Trivium 3000 #336

Closed D13410N3 closed 2 years ago

D13410N3 commented 2 years ago

Hello.

I've compiled LTFS using manual in README on my Debian 11 Bullseye (Linux 5.13.19-2-pve #1 SMP PVE 5.13.19-4 (Mon, 29 Nov 2021 12:10:09 +0100) x86_64 GNU/Linux)

The device is HP StorageWorks Ultrium 3000 SAS, cartridges are Sony LTX1500G

ltfs -o device_list shows connected hardware:

885 LTFS14058I LTFS Format Specification version 2.4.0.
885 LTFS14104I Launched by "ltfs -o device_list".
885 LTFS14105I This binary is built for Linux (x86_64).
885 LTFS14106I GCC version is 10.2.1 20210110.
885 LTFS17087I Kernel version: Linux version 5.13.19-2-pve (build@proxmox) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP PVE 5.13.19-4 (Mon, 29 Nov 2021 12:10:09 +0100) i386.
885 LTFS17089I Distribution: PRETTY_NAME="Debian GNU/Linux 11 (bullseye)".
885 LTFS17085I Plugin: Loading "sg" tape backend.
Tape Device list:.
Device Name = /dev/sg1 (0.0.0.0), Vendor ID = HP      , Product ID = Ultrium 5-SCSI  , Serial Number = HUJ011CW59, Product Name =[Ultrium 5-SCSI].

But when I try to do mkltfs, I'm getting the following error:

LTFS15000I Starting mkltfs, LTFS version 2.5.0.0 (Prelim), log level 2.
LTFS15041I Launched by "mkltfs -d /dev/sg1".
LTFS15042I This binary is built for Linux (x86_64).
LTFS15043I GCC version is 10.2.1 20210110.
LTFS17087I Kernel version: Linux version 5.13.19-2-pve (build@proxmox) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP PVE 5.13.19-4 (Mon, 29 Nov 2021 12:10:09 +0100) i386.
LTFS17089I Distribution: PRETTY_NAME="Debian GNU/Linux 11 (bullseye)".
LTFS15003I Formatting device '/dev/sg1'.
LTFS15004I LTFS volume blocksize: 524288.
LTFS15005I Index partition placement policy: None.

LTFS11337I Update index-dirty flag (1) - NO_BARCODE (0x0x56531f111be0).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg1).
LTFS30250I Opened the SCSI tape device 0.0.0.0 (/dev/sg1).
LTFS30207I Vendor ID is HP      .
LTFS30208I Product ID is Ultrium 5-SCSI  .
LTFS30214I Firmware revision is Z6MW.
LTFS30215I Drive serial is HUJ011CW59.
LTFS30285I The reserved buffer size of /dev/sg1 is 524288.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
LTFS11332I Load successful.
LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS15049I Checking the medium (mount).
LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
LTFS30205I LOCATE (0x92) returns -20802.
LTFS30263I LOCATE returns End-of-Data (EOD) not found (-20802) /dev/sg1.
LTFS12037E Cannot seek: backend call failed (-20802).
LTFS11006E Cannot read volume: failed to load the tape.
LTFS30205I MODESELECT (0x55) returns -20500.
LTFS30263I MODESELECT returns Invalid Field in Parameter List (-20500) /dev/sg1.
LTFS15023I Formatting failed.

Maybe you have any ideas what's the problem? The cartridges & streamer are absolutely new

piste-jp commented 2 years ago

Hmm, it's interesting... Is this tape really brand new?

The mkltfs checks the tape was already formatted or not before formatting it. Normally, the mkltfs checks there are two partitions format and then tries to mount the tape for checking. There are two funny points in this case.

  1. The mkltfs didn't detect non-partitioned tape at all. Is this tape really brand new?
  2. The mkltfs tried to seek to the end of data but the drive returned an error End-of-Data (EOD) not found. This is clearly drive fault if this tape really brand new. It shall find a EOD at the beginning of the tape.

You can use --force option to skip the LTFS format check if it is sure you can erase everything of this tape.

D13410N3 commented 2 years ago

Replaced /dev/sg* with device serial number and it could do mkltfs with --force. Thanks!

But now when I try to mount tape I'm getting another error:

root@adguard-office:~# ltfs -o devname=HUJ011CW59 /ltfs
20043 LTFS14000I LTFS starting, LTFS version 2.5.0.0 (Prelim), log level 2.
20043 LTFS14058I LTFS Format Specification version 2.4.0.
20043 LTFS14104I Launched by "ltfs -o devname=HUJ011CW59 /ltfs".
20043 LTFS14105I This binary is built for Linux (x86_64).
20043 LTFS14106I GCC version is 10.2.1 20210110.
20043 LTFS17087I Kernel version: Linux version 5.13.19-2-pve (build@proxmox) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP PVE 5.13.19-4 (Mon, 29 Nov 2021 12:10:09 +0100) i386.
20043 LTFS17089I Distribution: PRETTY_NAME="Debian GNU/Linux 11 (bullseye)".
20043 LTFS14063I Sync type is "time", Sync time is 300 sec.
20043 LTFS17085I Plugin: Loading "sg" tape backend.
20043 LTFS17085I Plugin: Loading "unified" iosched backend.
20043 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
20043 LTFS30209I Opening a device through sg-ibmtape driver (HUJ011CW59).
20043 LTFS30288I Opening a tape device for drive serial HUJ011CW59.
20043 LTFS30250I Opened the SCSI tape device 0.0.0.0 (/dev/sg1).
20043 LTFS30207I Vendor ID is HP      .
20043 LTFS30208I Product ID is Ultrium 5-SCSI  .
20043 LTFS30214I Firmware revision is Z6MW.
20043 LTFS30215I Drive serial is HUJ011CW59.
20043 LTFS30290I Changer /dev/sg1 isn't reserved from any nodes.
20043 LTFS30285I The reserved buffer size of HUJ011CW59 is 524288.
20043 LTFS30294I Setting up timeout values from RSOC.
20043 LTFS17160I Maximum device block size is 1048576.
20043 LTFS11330I Loading cartridge.
20043 LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
20043 LTFS11332I Load successful.
20043 LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
20043 LTFS17157I Changing the drive setting to write-anywhere mode.
20043 LTFS11005I Mounting the volume from device.
20043 LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
20043 LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
20043 LTFS30205I MODESENSE (0x5a) returns -20501.
20043 LTFS30263I MODESENSE returns Invalid Field in CDB (-20501) /dev/sg1.
20043 LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
20043 LTFS39805W The timeout table is not configured: SCSI OP code 0x4d. Use the default timeout.
20043 LTFS11026I Performing a full medium consistency check.
20043 LTFS30216W Length mismatch is detected. (Act = 524288, resid = 0, resid_sense = 523294).
20043 LTFS30216W Length mismatch is detected. (Act = 524288, resid = 0, resid_sense = 523294).
20043 LTFS12049E Cannot read: backend call failed (-21716).
20043 LTFS17039E XML parser: failed to read a block from the medium (-21716).
20043 LTFS17037E XML parser: failed to read from XML stream.
20043 LTFS17273E XML parser: Detected an I/O error on reading an index from the tape (-21716).
20043 LTFS17016E Cannot parse index direct from medium (-21716).
20043 LTFS11194W Cannot read index: failed to read and parse XML data (-21716).
20043 LTFS30216W Length mismatch is detected. (Act = 524288, resid = 0, resid_sense = 523405).
20043 LTFS30216W Length mismatch is detected. (Act = 524288, resid = 0, resid_sense = 523405).
20043 LTFS12049E Cannot read: backend call failed (-21716).
20043 LTFS17039E XML parser: failed to read a block from the medium (-21716).
20043 LTFS17037E XML parser: failed to read from XML stream.
20043 LTFS17273E XML parser: Detected an I/O error on reading an index from the tape (-21716).
20043 LTFS17016E Cannot parse index direct from medium (-21716).
20043 LTFS11194W Cannot read index: failed to read and parse XML data (-21716).
20043 LTFS11253E No index found in the medium.
20043 LTFS11027E Cannot mount volume: medium consistency check failed.
20043 LTFS14013E Cannot mount the volume from device.
20043 LTFS30205I MODESELECT (0x55) returns -20500.
20043 LTFS30263I MODESELECT returns Invalid Field in Parameter List (-20500) /dev/sg1.
piste-jp commented 2 years ago

I believe it is a known HBA issue. Need to recompile with --enable-buggy-ifs.

See #157 and https://github.com/LinearTapeFileSystem/ltfs/wiki/HBA-info#note-for-buggy-hbas.

D13410N3 commented 2 years ago

Recompiled. Thanks for your answer, it really helped!

root@office:/opt/ltfs# df -h | grep ltfs
ltfs:HUJ011CW59       1.4T     0  1.4T   0% /ltfs