Restoring Files From Aix mksysb Backup

March 31st, 2009

You may be aware that the mksysb command creates the bootable image of all the mounted files systems on rootvg, at the time of creation of mksysb image. Here I am going to discuss how to restore data from mksysb backup image. I’ll discuss how to restore single file, multiple files and directories from mksysb backup image.

Those interested in knowing more about mksysb backup image contents can read my earlier article What is mksysb And What Are Its Components. For those who want to read all of my aix backup articles can follow backup link in categories list shown on this page. Just to be brief, backup resides in the fourth file image on the tape. First three are BOS boot image, mkinsttape image and dummy TOC.

Restoring Data From The mksysb Image

Restoring A Single File From mksysb Image

Let’s say you want to restore a file /etc/rc from mksysb image from tape /dev/rmt1. Now you have to follow the following procedure:

  1. Rewind the tape back to starting position.
  2. Skip the first 3 parts of mksysb image.
  3. Extract the file from the 4th part of the mksysb image.

Rewind The tape: tctl -f /dev/rmt1 rewind

Restore the file: restore -x -d -q -s4 -f /dev/rmt1.1 ./etc/rc

-s4 Signifies that we seek 4th image on the tape, where the backup resides.

Use rmt1.1, means no rewind on close and no retension on open.

Note the ./etc/rc, the “.” is a must, because all paths are absolute and not relative.

If the backup was taken with -i flag, you can use the following command:

restore -x -d -v -q -f /dev/rmt1 /etc/rc

You have to use -d flag.

If the mksysb backup was taken with file system backup, you can use the following command:

restore -x -v -q -f /dev/rmt1 /etc/rc

Restoring A Directory File From mksysb Image

Let’s say you want to restore a full directory /var/adm from the mksysb archive on /dev/rmt1. Here you have to specify the directory name instead of a single file:

Rewind The tape: tctl -f /dev/rmt1 rewind

Restore the file: restore -x -d -s4 -f /dev/rmt1.1 ./var/adm

Similarly if the backup was taken with -i option then it will be:

restore -x -d -v -q -f /dev/rmt1 /var/adm

If the backup was taken with filesystem backup option then it will be:

restore -x -v -q -f /dev/rmt1 /var/adm

Tags: , , , , , ,
Posted in Backups | No Comments »

Comments

Leave a Reply

 Comment Form 

 



More articles from the category: Backups


The dd Command FAQs

Whosoever has worked in Unix environment must be aware of dd command. The specialty of dd command lies in fact that it can copy a file, convert character mapping of files and do various other operations. In this article I am going to introduce various uses of dd command in the form of FAQs…

Solving Incorrect Block Size Problem In Backup Tapes

Its common phenomena to take Unix tape backups on one system and restore on another. Moving tapes to another site for safety sake is also called offsite backup. The problem often occurs while restoring tape data on another server. The tape backup access is very much dependent upon the block size used on the Unix server. For example on one unix server the block size can be 2048 Bytes and on another it may be 1024 Bytes….

Restoring Files From Aix mksysb Backup

You may be aware that the mksysb command creates the bootable image of all the mounted files systems on rootvg, at the time of creation of mksysb image. Here I am going to discuss how to restore data from mksysb backup image. I’ll discuss how to restore single file, multiple files and directories from mksysb backup image….

How To Use mksysb Command

Here I am going to discuss what you can do with the mksysb command. But before proceeding further let’s have a look on important command line options. Consult mksysb man page from IBM for more information….

Some Interesting Facts About mksysb

While I was writing about mksysb notes from IBM manuals, I came to know of some interesting facts about mksysb command in the man pages. Not everyone is interested in navigating through man pages or so. Here, I’m presenting the facts in my own language…

All You Wanted To Know About AIX Tape Device Backups-II

Welcome to the second article of the series about rmt devices in AIX. In first article I discussed about the common but confusing terminology used for tape devices. I hope you found the article All You Wanted To Know About AIX Tape Device Backups-I, interesting and useful. In this second article I am gonna explain the other naming conventions for rmt tape devices…

All You Wanted To Know About AIX Tape Device Backups-I

The tape devices in AIX are designated as rmt devices. The rmt are specifically used for backups. During the study of AIX tape backups, lots of confusion arises in the terminology. Before discussing in detail about rmt tape types I would like to discuss these six confusing terms used in context to tape backups and restores…

What is mksysb And What Are Its Components

mksysb is a command to create backup of rootvg on AIX systems. It creates bootable image of all the filesystems mounted at the time of taking mksysb backup. And backup created …