I am using the tar command to backup data to tape. How do I verify that tape backup is in a good condition?
The GNU/tar command has -w or --verify option. This option attempt to verify the archive after writing it to tape, use the command as follows to backup data and attempt to verify the archive after writing:
Verify TAR backup with -w and –verify options on GNU/Linux
Type the following command as follows to backup /home/ to /dev/st0 and attempt to verify the archive after writing it to /dev/st0 tape device:
# tar -cvpWlf /dev/st0 /home
Where,
- c : Create a new archive of /home
- v : Verbose output
- p : Ignore umask when extracting files i.e. preserve permissions on files
- W : Attempt to verify the archive after writing it
- l : Stay in local file system when creating an archive
- f : Specify /dev/st0 as tape device (file)
- /dev/st0 : Tape device name
- /home : Directory to backup
Examples: Tape backup/verify/restore procedures on Unix
First, load your tape cartridge into the tape drive. Log onto server. Backup /home/ to the tape device called /dev/rmt/tps3d4.8500c:
# cd /home/
# tar cvbf 64 /dev/rmt/tps3d4.8500c .
After the backup is complete:
- Eject the tape
- Label the tape with the date, the data stored, and the tar command used tar cvbf 64
- Write-protect the tape
- Put tape back in the drive and list contents to verify tape can be read:
# tar tvbf 64 /dev/rmt/tps3d4.8500c
To do restoring a tape backup, run:
# tar xvbf 64 /dev/rmt/tps3d4.8500c