How to put data on a tape.
There are tape drives on several hosts that everyone can use for storing large amounts of data. See this document for a list of tapedrives, their capacities and locations.
When should you consider putting data on tape?
If you have large datasets that don't change or change infrequently, and that you don't need to access for months, you should consider moving them off the fileserver and onto tape. For example, a good candidate for tape storage is a set of giant binary datafiles of observations that you've finished analyzing, but which you want to keep around just in case. Another good example is a paper that you wrote a year or two ago, with all its figures.It's good to move such things off the fileserver and onto tape because the fileserver has limited storage, and it's optimized for protecting frequently changing data against disk crashes. If the same data sits on the fileserver for months without changing it's a waste of resources and can impact on other users.
How to put data onto a tape.
First you'll need a suitable tape for the drive you are going to use. Try to choose a tapedrive who's capacity matches your needs in terms of size. There is no point putting a single 10Mb dataset on a 40Gb tape.
- Put the tape in tapehost's tapedrive.
- Log on to tapehost, maybe remotely.
- Choose which files you want to move onto the tape. In the
following code, I'll move all the files in
~/scratchand~/fchannel, plus my mailbox~/mail. - Use
duto make sure you can fit all your data on one tape.tapehost$ cd ~ tapehost$ du -sk scratch fchannel mail 48 scratch 320 fchannel 10224 mail 10592 totalThe output ofduis in kilobytes. Divide by 1024 to get MB. Here's anawkscript that does the conversion to MB (cut and paste it to your shell to use it).tapehost$ du -sk scratch fchannel mail | awk '{printf("%d\t%s\n", $1/1024, $2)}' 0 scratch 0 fchannel 9 mail 10 total tapehost$Make sure the total is not larger than the tape! - Use
gtarto copy the files onto the tape.gtarstands for tape archive. The gtar optionscpfmean-
ccreate a tape archive -
ppreserve file attributes like owner and timestamp -
fput the archive in file/dev/tape, i.e. the tape drive.tapehost$ cd ~ tapehost$ gtar -cpf /dev/tape scratch fchannel INBOX
Here /dev/tape refers to the actual tape device. Refer to the list of tape drives here to select the right device. The actual tape drives are also labelled with the appropriate device name. (eg /dev/rmt/0)
-
- Wait until
gtarfinishes and the light on the tape drive stops flashing. A 1 GB archive might take ten minutes or so. Then eject the tape. - Important Label your tape!
How to get data off a tape.
- Put the tape in the drive, log on to tapehost.
- Make a temporary directory and
cdinto it. This is really important if you want to avoid the possibility of overwriting existing files.tapehost$ cd ~ tapehost$ mkdir tmp tapehost$ cd tmp - Make sure the tape is rewound by running
tapehost$ /bin/mt -f /dev/tape rewind - List the table of contents of the archive by running
tapehost$ gtar -tvf /dev/tape - Extract everything from the tape by running
tapehost$ gtar -xvf /dev/tapeor extract specific files by runningtapehost$ gtar -xvf /dev/tape filename1 path/filename2where the filename arguments appear exactly as listed in the archive table of contents.
For help with any of the above please contact the helpdesk.

