Sample Header Ad - 728x90

How do you determine the remaning capacity of a magnetic tape with mt or tar? How much space is in a block?

2 votes
1 answer
1082 views
I am currently trying to back up data onto an LTO-4 tape using mt-st and gnu tar 1.32, but I want to make sure I stop trying to copy things before the tape runs out! LTO-4 nominally has a capacity of 800G or 1.6T compressed. tapeinfo -f /dev/nst0 | grep Comp returns DataCompEnabled: yes DataCompCapable: yes DataDeCompEnabled: yes CompType: 0x1 DeCompType: 0x1 which I think means that compression is enabled ? Then again, I am adding archives to the tape with mt-st -f /dev/nst0 eod ; tar -czf /dev/nst0 directoryname, so I am also compressing that archive with gzip. In short, I don't know how to visualize how much data the archives on the tape are taking up, they are measured in blocks and I don't know how much data a block consists of. I have copied about 200G of data to the tape already and mt-st -f /dev/nst0 eod ; mt-st -f /dev/nst0 status ; echo -e "\n" ; mt-st -f /dev/nst0 tell returns: SCSI 2 tape drive: File number=1, block number=-1, partition=0. Tape block size 0 bytes. Density code 0x46 (LTO-4). Soft error count since last status=0 General status bits on (9010000): EOD ONLINE IM_REP_EN At block 18763534. But tapeinfo -f | grep MaxBlock returns MaxBlock: 16777215. So it appears I am already passed the maximum block? But mt-st -f /dev/nst0 rewind ; tar -tzvf /dev/nst0 does return a list of all of the files I copied into that archive and moves the tape to the end of data, so I shouldn't have ran out of any space. From looking at the mt manual, I cannot find a way to go to the end of the tape without first writing it. Here is the rest given by tapeinfo if that helps: Vendor ID: 'HP ' Product ID: 'Ultrium 4-SCSI ' Revision: 'U57D' Attached Changer API: No SerialNumber: 'HU1104ERC3' MinBlock: 1 MaxBlock: 16777215 SCSI ID: 0 SCSI LUN: 0 Ready: yes BufferedMode: yes Medium Type: Not Loaded Density Code: 0x46 BlockSize: 0 Block Position: 18763534 Partition 0 Remaining Kbytes: 800226 Partition 0 Size in Kbytes: 800226 ActivePartition: 0 EarlyWarningSize: 0 NumPartitions: 0 MaxPartitions: 0
Asked by T. Zack Crawford (232 rep)
Sep 6, 2020, 08:52 PM
Last activity: Sep 7, 2024, 05:54 PM