How To Use mksysb Command

March 30th, 2009

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.

-a         Specifying this option won’t backup extended attributes and NFS4 ACLs.
-b         How many number of 512-byte blocks to write in a single output operation.
-e         Excludes files listed in /etc/exclude.rootvg file from backup.
-F         If you want to use previously created mksysb image to create backup tape.  Backup tape is made bootable if possible. It’s a must with a tape backup.
-i          Specifying this option calls mkszfile to generate /image.data file. The file /image.data will have information of VG, LV, FS, PV and Paging space.
-m        Specifying this option calls mkszfile with -m flag to generate map files. No use of -i is needed with this option.
-p         This instructs to not to use any kind of compression algorithms.
-t argument
The option specifies the path where the image will be created from mksysb file specified by -F flag. If you don’t specify then /tmp is used.
-v         Verbose mode. All files being backed up will be listed.
-V        It verifies a tape backup. File header of each file on backup tape is verified.
-X        Auto expand /tmp file system if needed.

1. Generating system backup and creating /image.data file on tape drive /dev/rmt0

mksysb  -i /dev/rmt0

2. Generating system backup and creating /image.data file on tape drive /dev/rmt0 with map files:

mksysb  -m /dev/rmt0

3. Generating system backup and creating /image.data file on tape drive /dev/rmt0 and producing verbose output . Also exclude /home/user1/my_dir.

mksysb  -i  -e  -v  /dev/rmt0

Also create a file /etc/exclude.rootvg and enter file name as: /home/user1/my_dir/
Note the ending slash.

4. Generating system backup and creating /image.data file in file /my_backups/backup_image

mksysb  -i /my_backups/backup_image

5. Generating system backup and verifying backup image.

mksysb  -i /dev/rmt0 -V

How To Schedule mksysb
Let’s say we choose to schedule daily mksysb schedule. Say you want to take mksysb backup daily at 04:20 Hours. You need to follow the following steps:

  1. Create a file named anything like mksysb_sched in your home directory. So the file will be something like: /home/user1/mksysb_sched.
  2. Give it permissions like 755 as follows:  chmod 755 mksysb_sched
  3. Run the command:    crontab -e
  4. Make entry: 20   04  *   *  *   /home/user1/mksysb_sched

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 …