How do I tar some files to multiple tapes, with each tape being listed in advance? This way I can have a fully-unattended archival, with no need to physically change media once a tape is full.

In my specific case,

  • Each tape is actually a /dev/sd? block device, with the archive being written to the raw disk and not having partitions or filesystems to save on space.
  • All target disks are connected to the host machine simultaneously.
  • tar is GNU version 1.34.
  • Largest single file size is smaller than the size of the smallest target.

So far, to perform this task, I've got this command: tar -c -M -f /dev/tape1 -f /dev/tape2 ... /files/to/be/archived.

Step-by-step walkthrough:

  1. tar -c is the command to create a tar archive.
  2. -M tells tar that I want to make a multi-volume archive.
  3. -f is listed multiple times with each target tape to be written to.
  4. /files/to/be/archived is what is to be archived.

Due to --tape-length not being present in the command, tar should write as much as it can on each tape, regardless of how big the tape is in relation to others. This allows for tapes of unequal sizes.

Will this work as I have explained above, or will the behavior of tar be different?

1 Answer 1


With the command listed above, /dev/tape0 and similar being substituted for the actual device names, tar completed the creation of the archive successfully.

Whether it can extract this archive back into individual files, shall be tested soon.

Edit: The archive was extracted successfully.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .