Restoring an item to your AFS Home directory


The instructions on this page are intended to provide all the details you need in order to use your own computer to restore an item (file or folder) to your AFS Home directory yourself.  For example, the item might be a folder that was deleted the previous day or a day-old version of a file.

Here is a brief preview of what you will be doing as you follow the restoration instructions below:

  1. If you do not already have Expandrive, download and install it. This free program makes it easy to access, copy and paste files in your AFS Home directory using your computer’s built-in file explorer program.
  2. Briefly use a Linux or Unix command line in a terminal session to create a temporary directory that will let you access your backed up AFS files (your AFS backup volume).
  3. Use Expandrive in this temporary directory to locate each item you want to restore and copy it back into your AFS Home directory.
  4. Remove the temporary directory.
  5. Close your terminal session.

If you need additional assistance, visit or contact the NC State Help Desk at 919.515.HELP (4357).

Can an item be restored?

In determining whether you can restore an item (file or folder) to your AFS Home directory, you need to be aware of the following circumstances:

  • All AFS files are backed up only once a day, shortly after midnight.
  • A backup is kept for only about 24 hours.
  • You can restore an item only if the item is contained in the most recent backup.
  • To restore a backed up item, you must do so before the next backup occurs.
  • If you create an item after one backup is made and then delete it before the next backup, you will not be able to restore it.

Entering Unix commands

  • In the instructions below, you will need to enter only a few commands from within a terminal session on a Linux machine that has access to your AFS space.  Steps 6 and 7 will help you open a terminal session on your machine.
  • The commands are shown in bold font.
  • For accuracy, instead of typing the commands, we recommend that you copy and paste them directly from these instructions.
  • If you choose to type a command, take careful note of the spaces and punctuation in it.
  • Before you run the commands in Steps 14 and 16, you will need to replace italicized portions of them with information that you have determined in earlier steps.
  • In order to run a command, you will need to press the Enter (Return) key after entering it.

Restoration instructions

  1. If you already have Expandrive on your computer, skip to Step 6; otherwise, continue to Step 2.
  2. Go to the eos Software Available for Download page.
    If you have not already done so, you will need to log in with your Unity ID and password.
  3. Follow the general instructions in the “Before You Download” section.
  4. Download the version of Expandrive for your operating system.
  5. Follow the installation instructions provided for Expandrive.
  6. When you have finished installing Expandrive, go to the Unix or Linux Command Line page.
  7. Follow the directions for opening a terminal session on your computer.
    When you are logged in to the Linux virtual machine, you should see a command prompt similar to one of these three:
    In the steps below, you will need to type each command at that prompt. For example:
  8. Change into your AFS Home directory by copying and pasting this command:cd ~/
  9. Create a directory there named “recovered-data” to hold your restored items by copying and pasting this command:mkdir ~/recovered-data-`date +%Y-%m-%d-%H%M`This directory will be stamped with the current date and time.NOTE: The character (`) that precedes the word “date” and ends this command is a backtick, not an apostrophe.  The backtick key is on the left side of the keyboard, above the Tab key.
  10. Determine your volume name as follows:
    1. Copy and paste this command:
      fs examine ~/
    2. Look for the output line that starts with the words “Volume status.”
    3. Look at the end of that line, following the word “named,” for the string of characters that comprise your volume name.
      For example:
      Volume status for vid = 537008297 named users.volume-name
      In this example, the volume name is users.volume-name.
  11. Record your volume name. You will need to enter it in Step 14.
  12. Determine in which cell your volume lives as follows:
    1. Copy and paste this command:
      fs whichcell ~/
      The output line will be in this format:
      File /afs/ lives in cell ‘name-of-cell’
      In this line, yourunityid will be your own Unity ID, and initial will be its first letter.
    2. Look at the end of this line, following the word “cell,” for the name of that cell.
  13. Record your cell name (without the quotes).  You will need to enter it in Step 14.
  14. Create a temporary directory named “temp” (stamped with the current date and time) and simultaneously connect it to your AFS backup volume by copying and pasting this command:fs mkmount -dir temp-`date +%Y-%m-%d-%H%M` -vol volumename.backup -cell cellname

    NOTE: Before pressing the Enter/Return key, be sure to replace: 
    with the volume name and cell name that you recorded in Steps 11 and 13, respectively.Error message: A message such as:
    “Connection Timed Out” or
    “Volume not Available,”
    may indicate that your AFS backup volume is not accessible online. In that case, you will need to request a backup restore from tape, which will take a little longer. For details, see How to request a file restore from tape backup.
  15. Using Expandrive, look in this “temp” directory, find each item you want to restore, and copy it to the “recovered-data” directory you created in Step 9.
  16. After you have finished restoring all the items, remove the “temp” directory by copying and pasting this command:    fs rmmount temp-datestamp-timestampNOTE: Before pressing the Enter/Return key, be sure to replace:
    by copying and pasting the full name of the “temp” directory, including its date and time stamps, that you created in Step 14.
  17. End your terminal session by following the directions for your operating system on  the Unix or Linux Command Line page.