Linux Tape Backup With mt And tar Command Howto

‮th‬tps://www.lautturi.com
Linux Tape Backup With mt And tar Command Howto

The mt and tar commands are commonly used on Linux systems to perform tape backups. Here are the general steps you can follow to use these commands for tape backups:

  1. Insert the tape into the tape drive:

  2. First, you will need to insert the tape into the tape drive. Make sure the tape is properly positioned in the drive and that the drive is ready to accept the tape.

  3. Create a new tape archive:

  4. To create a new tape archive, you can use the mt command with the rewind option to rewind the tape to the beginning, and the tar command with the cf option to create a new tape archive. For example:

mt -f /dev/st0 rewind
tar -cf /dev/st0 /path/to/files
  1. This will create a new tape archive on the tape and add the files located in /path/to/files to the archive.

  2. Append to an existing tape archive:

  3. To append to an existing tape archive, you can use the mt command with the fsf option to move the tape forward to the end of the archive, and the tar command with the rf option to append to the archive. For example:

mt -f /dev/st0 fsf
tar -rf /dev/st0 /path/to/files
  1. This will append the files located in /path/to/files to the existing tape archive.

  2. List the contents of a tape archive:

  3. To list the contents of a tape archive, you can use the mt command with the rewind option to rewind the tape to the beginning, and the tar command with the tf option to list the contents of the archive.

Created Time:2017-10-30 10:17:39  Author:lautturi