PREV UP NEXT The Ftape Installation and Usage Guide - Testing ftape


7.3: Performing sample backups

Now it is time to get a floppy tape cartridge and to insert it into your floppy tape drive. Wait for the drive to stop making noise (most tape drives start calibrating the head when a new tape is loaded). Now try if the drive is recognised:

ftmt -f /dev/qft0 status

This will try to open the device (see Output of the status command to view sample output from this command(1)). Because initially the variable ft_tracing is set to some value greater than zero (see Configure ftape), some debugging output (produced by the kernel function `printk') is generated on the console(2). Please don't worry too much if the messages your driver produces are a bit different from the sample output provided in this documentation. In general, you can ignore the debugging messages the driver produces as long as it works otherwise, i.e. is able to read and write data to and from your tape drive. Some of the messages you may be confronted with are mentioned in subsections at the end of this chapter (see ftape Debugging Messages).

Now it is the time to actually write some data to the tape. But before you try to do this you should retension the tape cartridge. This is necessary because tape cartridges are very sensitive to stretch (see MTRETEN) and because of the following (taken from the Seagate TST3200 Installation manual):

Retention tape cartridges that have not been used for more than a month before restoring or backing up data. This retentioning removes unwanted tight spots that develop naturally on reeled media.

Please type in the following commands at the shell prompt:

ftmt -f /dev/nqft0 reten

As a result, the tape cartridge will be wound to EOT (End Of Tape) and back to BOT (Begin Of Tape). It can take several minutes until the tape operation has completed.

Having performed these preliminary steps please change to the top directory of the ftape sources, e.g.

cd /usr/src/ftape-4.04

(or where ever you have unpacked the sources). Make a small sample backup of the `./ftape/zftape/' subdirectory, using the tar program:

tar -cvf /dev/nqft0 ./ftape/zftape/   

Keep in mind that you should not remove the cartridge before rewinding it. Please send a `rewind' command to the cartridge now:

ftmt -f /dev/nqft0 rewind   # rewind and update the header segments

Now it is safe to remove the cartridge. Please do that, please remove the tape cartridge from the tape drive --- reinsert it afterwards and try to read the data back:

tar -dvf /dev/nqft0   # compare the backup with the files on the hard disk

tar shouldn't report any differences between the data stored on the tape and the files in the `./ftape/zftape/' directory.

Using the auto rewinding devices you can omit the `mt rewind' step:

ftmt -f /dev/nqft0 eom               # skip to end of data
tar -cvf /dev/qft0 ./ftape/zftape   # perform the backup and rewind

The example above will first skip to the end of the already recorded media and then make a backup of the `./ftape/zftape/' directory. It then will rewind the tape and update the header segments.

Note: The mt program must always use the non-rewinding devices for tape motion commands. The reason for this is simple: when the mt commands finishes, it closes the tape device, which causes a rewind of the tape when it is used with the auto-rewinding devices --- hereby annihilating the results of the tape motion command.

You can use tar with the `--verify' option which will backspace to the beginning of the tape volume and start verifying it:

ftmt -f /dev/nqft0 eom                # go to end of data
tar -cvf /dev/nqft0 --verify contrib  # make the backup and verify
ftmt -f /dev/nqft0 rewind             # rewind and update header segments

Having been able to perform all of the tests above you can be pretty sure that the ftape driver works correctly for you.

Note: you can't simply use cat or the shell redirect `>' to write data to the tape when using zftape. This probably is one of the most striking differences between ftape2 and zftape. For zftape, every read and write access must be a multiple of a fixed block size which defaults to 10kb (the default block size used by tar). See Tape blocks.

However, it is possible to switch to `variable block size' mode when using zftape utilising `ftmt -f /dev/qft0 setblk 0' (see MTSETBLK). The above explanations mean that the example below will not work:

cat MCONFIG > /dev/nqft0        # try to dump `MCONFIG' to tape
echo "Hello World" > /dev/qft0  # this will fail, too

whereas the following will work:

ftmt -f /dev/qft0 setblk 0      # switch to variable block size mode
cat MCONFIG > /dev/nqft0        # dump `MCONFIG' to tape
echo "Hello World" > /dev/qft0  # create a second volume and rewind

Please keep in mind that changing the block size has the side effect to lock the module in memory (see Autoloading). You'll have to reset the block size to 10k with `ftmt -f /dev/qft0 setblk 10240' or issue a reset command `ftmt -f /dev/qft0 reset' (see MTRESET) to be able to unload the modules.

The remainder of the section gives some basic examples dealing with tape file marks. Please note that some commands you send to the drive do not result in immediate tape motion but simply change the value of an internal variable of ftape. Don't be alarmed if e.g. `mt -f /dev/nqft0 fsf' seems not to have any affect at all. It has the effect to increment the internal variable that holds the number of the tape volume the tape drive will use when trying to read data from the tape.

When testing the file mark support of ftape please note that the following two examples have exactly the same effect:

  1. ftmt -f /dev/nqft0 rewind  # rewind to BOT
    ftmt -f /dev/nqft0 fsf     # skip to the second volume
    tar -tvf /dev/nqft0        # list the contents of it
    tar -tvf /dev/nqft0        # this will simply skip the file mark
    tar -tvf /dev/nqft0        # list the contents of the third volume
    
  2. ftmt -f /dev/nqft0 rewind  # rewind to BOT
    ftmt -f /dev/nqft0 fsf     # skip to the second volume
    tar -tvf /dev/nqft0        # list the contents of it
    ftmt -f /dev/nqft0 fsf     # skip to the third volume
    tar -tvf /dev/nqft0        # list the contents of the third volume
    

This is not a bug of ftape, but a feature of tar which is explained in another section of this manual. See File marks and tar.

Note that `ftmt -f /dev/nqft0 bsf 1' always stays within the same volume:

ftmt -f /dev/nqft0 rewind  # rewind to BOT
ftmt -f /dev/nqft0 fsf 2   # go to the beginning of the third volume
tar -tvf /dev/nqft0        # list the contents of the third volume
ftmt -f /dev/nqft0 bsf 1   # go to the beginning of the current volume
tar -tvf /dev/nqft0        # again, list the contents of the third volume
ftmt -f /dev/nqft0 bsf 2   # this backspaces to the second volume!
tar -tvf /dev/nqft0        # list the second volume

Please refer to the section dealing with the ioctl interface to ftape which also contains small examples on how to use the mt program to perform tape operations (see Ioctls).

Now that you have finished testing the driver, don't forget to reset the permissions for the tape device back to reasonable values. To inhibit access by all users except root, do the following (see man 1 chmod):

su
chmod go-rw /dev/qft0 
chmod go-rw /dev/nqft0
exit


(1) If you get `This is a floppy tape drive, drive type = xyz, drive name unknown.' not stating the name of your floppy tape drive, then this simply means that the ftape driver doesn't know the name of your tape drive. There is nothing to worry about as long as you are able to use your tape drive.

(2) Note that newer kernels allow redirection of the kernel messages to a specific virtual console. So if you don't like the messages to appear on every console you've opened, then refer to you kernel log daemon documentation how to do this.


ftape logo Use these buttons to jump to the top menu

TOP (previous node) TOP (parent node) TOP (next node) TOP (this node)