Restoring backed up Mallard grades


What data has been backed up?

The following files are backed up for each course XXX:

Where and how are the grades backed up?

The grades are backed up as tar (tape archive) files on 4mm magnetic tape. A table of contents is provided on the tape cover. The files for each class are tarred and preserved as a single file on the tape. Note that the filenames as preserved start with XXX, the course name. This is because the tarfiles were created from the $MALLARD_HOME/course subdirectory, and therefore all of the filenames are relative to that directory.

The files are listed on the tape cover by file number. You will need to know the number of the file in order to restore its contents.

How do I get the grades back off the tape?

  1. Make sure you are a user who has access to read and write from the tape device.

  2. Change directories into some temporary directory on your machine with a lot of space available. Generally this will be one of either /tmp or /scratch. To view the amount of space available in the directory, type df -k.

  3. Put the tape into a 4mm tape drive on your machine.

  4. Type mt rewind to be sure that the tape is rewound to the very beginning.

  5. Type mt status to check the status of the tape. You should see something like the following:
    Archive Python 4mm Helical Scan tape drive:
    sense key(0x0)= No Additional Sense   residual= 0   retries= 0
    file no= 0   block no= 0
          
    The file no= 0 means you are positioned at file 0. You may type mt status at any time to check the position of the tape.

  6. If you need a file other than the one at which the tape is currently positioned, you will need to advance or rewind the tape. To advance the tape, type mt fsf X, where X is the number of files you need to advance by. If you are at file 5, and need file 8, you would type mt fsf 3. Similarly, to rewind the tape by X files, type mt bsf X. Always type mt status to be sure the tape is positioned at the file you need before proceeding.

  7. To list all of the files in the tar file on tape that you're positioned at (just to check what's in there, if you feel the need) type tar -tf /dev/rmt/0n.

    The options to tar (-tf) stand for:

    • t: Table of contents.
    • f: File. This means you'll specify a tar file to list the contents of. The filename is explained below.

  8. To extract all of the files in the tar file on tape that you're positioned at into your current working directory (the big beefy directory mentioned above), type tar -xvf /dev/rmt/0n.

    The options to tar (-xvf) stand for:

    • x: Extract. This one you need.
    • v: Verbose. This is optional, it makes the command list each file as it extracts it. It can slow things down, but it's useful for large files - without it it is hard to tell how far you've gotten, or if the process has just hung.
    • f: File. This means you'll specify a tar file to extract from. The filename we use is /dev/rmt/0n. This means "the first tape device, non-rewinding." Your system may have a slightly different name for it, check if this command gives you any trouble. The n is important - it means that the tape will not automatically rewind to the beginning when the files are extracted.

    Now you have all the grades in your big beefy temporary directory. You will see a single subdirectory for each class you've restored. This is because the tarfiles were created in the $MALLARD_HOME/course subdirectory and so all the filenames are relative to that directory.

  9. Re-tar the files so that they may be moved to their eventual location within the Mallard area on the production machine. To do this, type tar -cvf XXX.tar XXX.

    The options to tar (-xvf) stand for:

    • c: Create. This means you are creating a tarfile. The name of the file to create is the first argument after the "dash letter" arguments.
    • v: Verbose. This is optional, it makes the command list each file as it includes it in the tarfile.
    • f: File. This is the file (or list of files) you will be tarring up. We are tarring up an entire directory, so there is one argument - the name of that directory file.

  10. Ftp the files to the production machine. You should be the mallard user on the production machine (log in as mallard at the ftp prompt).

  11. Move the tarfile into the $MALLARD_HOME/course directory on the production machine. You have to extract the files in this directory if you want them to be placed in the right positions, because the original tarfile was created from this directory.

  12. Extract the files from the tarfile you ftp'ed over. To do this, type tar -xvf XXX.tar.
    Note that this will overwrite any existing grades for the course!!!!

  13. Take the tape out of the tape drive when you are finished. To do this, type mt rewoff. This will rewind the tape before ejecting it.

Questions? Comments? General harrassment? Mail it to maiko@wocket.csl.uiuc.edu.