Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

restore problem

Status
Not open for further replies.

Midrange

Vendor
Aug 28, 2002
135
SG
Hi there just new with AIX, I have backup my filesystem /u01 using the command: find /u01 -print| backup -ivqf /dev/rmt0 (im on root directory)

I want to restore only the directory /u01/dir1 to a newly created directory under /u01/dir10.

How can i restore it. I can restore the dir dir1 but on the same directory also (dir1)..

thanks
 
I don't think you can do this because the backup you have created is a backup by filename with absolute path.
If you had created the backup using relative path then you can restore using relative path, if you had created the backup using tar then you could have restored using pax to change the path.

Your options are to recreate the backup using a different method or restore using one of the 2 following techniques.

If dir1 is just a directory within a filesystem rather than a filesystem then you could try the overmount method:
1) create an LV of a size sufficient to hold your data.
2) create a jfs on this LV with the name /u01/dir1
3) mount /u01/dir1 (this overmounts the existing directory with your new filesystem).
4) do the restore to /u01/dir1
5) umount /u01/dir1
6) rename the /u01/dir1 filesystem to another name and mount it under that new name. ie, you could rename it to /u01/dir10 or rename it to a temporary name and then copy the data from it to /u01/dir10 and delete the temporary filesystem.

If /u01/dir1 was already a filesystem then:
1) rename it to something else ie /u01/temp
2) create another /u01/dir1 filesystem and mount it
3) do the restore then umount the filesystem
4) rename /u01/dir1 to /u01/dir10
5) rename /u01/temp to /u01/dir1
6) mount /u01/dir1 & /u01/dir10
 
How about temporarily renaming the current dir1 directory, say dir1.original, doing the restore, then renaming the new dir1 to dir10, then rename the dir1.original back to dir1.
 
Thanks to both of you..

What do you recommend now when i do a backup. How can i execute the relative path backup command?

thanks..
 
The method you used in your original post was absolute backup. To backup using the relative context use:

find . -print | backup -iepvqf /dev/rmt0

Absolute pathnames - files are restored to the exact directory as specified on the archive.

Relative pathnames - files are restored relative to the current directory.
 
AIXSPadmin,

Do i need to change directory to the directory i need to backup or i can also run it under root .

tnx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top