Checking media by using the ltfsck command

How to check tape media consistency and, if necessary, recover media from an inconsistent state by using the ltfsck command. The options that can be used with this command are also explained.

Enter ltfsck from the command line to mount media for use with the IBM Storage Archive.
Table 1. Command line entries for ltfsck
Operating system Command line entry
Linux®
ltfsck /dev/sg10
Or

ltfsck <drive_serial_number> (Example: ltfsck 1168001522)
The following ltfsck command options are available.
-a OR --trace
Enable function call tracing.
--capture-index
Captures indexes to the work directory.
-f OR --full-recovery
Recover extra data blocks for which metadata is excluded from the index file. The recovered data is stored in the directory _ltfs_lostandfound. This directory is located in the root directory on the tape medium. When the tape medium is mounted, it can be seen at the mount point.
-h OR --help
Display program help information.
-g<generation> OR --generation=<generation>
Specify the index of the generation to roll back. Obtain the list of acceptable indexes by entering the ltfsck command with a -l option.
-j OR --erase-history
Erase history at rollback.
When this option is specified, the ltfsck command erases all index files and appended data up to the designated "roll back to" generation. Data newer than this generation cannot be recovered. When this option is not specified, any existing generation can be recovered even following a rollback operation.
-k OR --keep-history
Keep history at rollback (default).
-l OR --list-rollback-points
List rollback points (generations). Use this command with the -v option.
When this option is selected, the resulting output is similar to the following example.
[root@localhost ashida]# ltfsck /dev/sg10 -l
LTFS16000I ltfsck starting, log level 2
LTFS16018I Listing rollback points of LTFS file system on '/dev/sg10'
LTFS16023I LTFS volume information:
LTFS16024I Volser(Barcode) :       
LTFS16025I Volume UUID     : fdaeedda-5344-4155-a03a-9ca82b2f2e15
LTFS16026I Format Time     : 2010-03-31 14:49:07.172792075 JST
LTFS16027I Block Size      : 1048576
LTFS16028I Compression     : Enabled
LTFS16029I Index Partition : ID = a, SCSI Partition = 1
LTFS16030I Data Partition  : ID = b, SCSI Partition = 0

LTFS16077I Valid indexes:
Generation: Date       Time               Zone     SelfPtr->BackPtr
                                                   (Part, Pos)->(Part, Pos)
---------------------------------------------------------------------------
         1: 2010-03-31 14:50:08.800718541 JST      (0, 5) <<Initial Index>>
         2: 2010-03-31 14:55:53.988915408 JST      (0, 9)->(0, 5)
         3: 2010-03-31 14:57:38.755561251 JST      (0, 13)->(0, 9)
         4: 2010-03-31 14:59:24.992244674 JST      (1, 5)->(0, 17)
         4: 2010-03-31 14:59:24.992244674 JST      (0, 17)->(0, 13)
For example, to roll back generation 3 (time stamp 2010-03-31 14:57:38.755561251), issue one of the following commands:
# ltfsck /dev/sg10 -g 3 -r
or
# ltfsck /dev/sg10 "2010-03-31 14:57:38.755561251" -r
-m OR --full-index-info
Display full index information (effective only for -l option).
-n OR --no-rollback
Do not roll back. Verify only the point that is specified by -g. (This option is the default.)
-o scsi_lbprotect=off
Disable logical block protection (default).
-o scsi_lbprotect=on
Enable logical block protection. (The default is disabled.)
-q OR --quiet
Suppress progress information and general messages. For more information, see Setting the log trace level.
-r OR --rollback
Roll back to the point specified by -g or -t.
-v OR --traverse=<strategy>
Set traverse mode for listing rollback points. Strategy can be forward or backward (default is backward). Used with the -l option.
-z OR --deep-recovery
Recover the cartridge that is missing the end-of-data mark.
Specify this option when the medium cannot be recovered in any other way. Data on the medium that is written before the final unmount point can still be recovered. Some blocks that are written to the medium when the drive power is lost, however, might not be recoverable.
Attention: The -z option is applicable only to tape drive firmware B170 or later. If the drive firmware is older than B170, go to the Fix Central website to get the most current version. This option retrieves index information from cartridge memory to recover as much data as possible. But if data in the cartridge memory is broken due to media wear, the medium cannot be recovered. In this case, the medium must be forcibly mounted by using the LTFS command -o force_mount_no_eod. This command opens the volume as write protected. Copy the data to another medium as soon as possible. For more information, see ltfs.