User:Rewood/Restoring files on your AFS Research Locker
Problem:
I accidently removed a file from my locker, and I need it back. How can I get a backup copy restored?
Solution:
All volumes (home directories/lockers/etc) are backed up on a regular basis. Part of the backup process is the generation of backup volumes, or online backup copies. In general, backup volumes are created every morning shortly after midnight, and they exist, unaltered, until the next time a backup volume is created. One result of this is that users may now restore their own accidentally deleted files from their backup volumes in most situations. Restoring deleted files from a backup volume can be done in most cases.
These cases will meet the following criteria:
The most recent backup volume was made at some point when the file in question existed. This means that if you delete a file that you just created, chances are, it hasn't made it to a backup yet. The user must recognize that he or she wants that file restored before the next backup volume is made (generally in the early morning hours.)
If your situation meets these criteria, then you should be able to recover your files by yourself, or with the help of a consultant or operator. If you do not meet these criteria, or you are unsuccessful, your next step of action should be to contact a consultant or operator and request a restore from the tape backup.
Please note the following when requesting a restore from tape:
Restoring files from a backup tape is a labor intensive and time consuming process. For this reason, unfortunately, in most cases we can only perform up to two restores from tape to help retrieve your lost files. So please request your restore date(s) carefully.
Backups on each day are made from a snapshot of your files as they existed on or around midnight of that day. Requesting a restore for 1/14/98 (a Wednesday), for example, will give you access to your files as they existed when you quit working on Tuesday.
Restoring files from the AFS backup volume:
Step One: Getting Started
You will need to know some things before you get started.
- The name of the file(s) you want restored - The location of the file(s) you want restored - The name of your volume
You can determine this by using the command:
fs examine lockerpath
Here is an example. In this case, we will backup the cs-media locker. It will output something like:
unity% fs examine /afs/unity/lockers/project/cs-media/ Volume status for vid = 537547352 named lck.prj.cs-media Current disk quota is 80000 Current blocks used are 30273 The partition has 4860948 blocks available out of 7947479
We're interested in the last bit of the first line. The name of this volume is lck.prj.cs-media
- Where (in which cell) your volume lives
You can determine this by using the command:
fs whichcell lockerpath
It will output something like:
unity% fs whichcell /afs/unity/lockers/project/cs-media/ File /afs/unity/lockers/project/cs-media/ lives in cell 'unity.ncsu.edu'
- A mountpoint directory
This can be anything you want; to make life easier and less confusing, this should be a directory or file that does not already exist.
Step Two: Go to your locker
Use the cd command to move to your locker.
unity% cd /afs/unity/lockers/project/cs-media/
Step Three: Mount Your Backup Volume
First, you need to tell your computer where to access your backup volume. This is done by a process called mounting. The general form of the command to mount your backup volume is:
fs mkmount -dir mountpoint directory -vol volume.backup -cell cell
The full command for a real user might look like:
unity% fs mkmount -dir backup -vol lck.prj.cs-media.backup -cell unity.ncsu.edu
Step Four: Retreive Your Files
Now that you've mounted your backup volume, use the cd command to go to that directory.
unity% cd backup
You are now in the "backup" of your locker as it was at the time the backup volume was made. Use the cd command to change to the directory in which the file you wish to restore was in. Then use the cp command to copy the file(s) back to your real locker space.
directory: cp filename ..
Repeat Step Four for each file you wish to restore. If you have problems getting to your backup volume, with errors such as "Connection Timed Out" or "Volume not Available", this may be due to the fact that your volume was moved, and no online backup is available. In this case, you will have to request a backup restore from tape, which will take a little longer.
Step Five: Go Back Home
Use the cd command to move to your locker space:
cd ..
Step Six: Unmount Your Backup Volume
The command for unmounting a volume is very similar to the command to mount it:
fs rmmount -dir mountpoint directory
To remove our example backup directory, it would look like:
unity% fs rmmount -dir backup
You're done!
--ITD