May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

AIX cloning using mksysb Command

O'Reilly - Safari Books Online - 0596102461 - Backup & Recovery

IBM was the first Unix vendor to deliver a true bare-metal recovery tool. The mksysb command makes a complete "bootable" backup of the root volume group (rootvg) only. This allows you to perform a bare-metal recovery of an AIX host's operating system. You can even back up using mksysb to a bootable tape, CD/DVD, or a Network Install Manager (NIM) server.

Unix Backup & Recovery mentioned using Sysback to make volume group backups. The Sysback utility has been incorporated into some commercial products from IBM and other vendors with the release of AIX 5.X. This book's primary focus is on free methods to back up and restore, so we will not be covering Sysback.

13.1. IBM's mksysb and savevg Utilities

The basis for a bare-metal recovery of an AIX system is the mksysb utility, which is included in AIX. It backs up all the files in the root volume group. mksysb backs up the rootvg, including:

Top Visited
Past week
Past month


Old News ;-)

IBM AIX 5.1 cloning via mksysb

AIX 5.1 cloning via mksysb
This is useful only between (nearly) identical systems.
  1. Use mksysb to create a bootable image of the source system, e.g to tape.
  2. Ensure the latest firmware level on the target machine, depending on the chosen methods one may perform firmware upgrades along with some of the following tasks.
  3. Connect Terminal/Keyboard.
  4. If not yet in SMS mode, reset or power down/up, and during boot press key "1" (serial console) or "F1" (graphic console).
  5. Use SMS menus to select boot from tape.
  6. Proceed as suggested. Note, however, that the target system is identical copy of the "source" system, it has, e.g., the same IP host name and address. Hence it must be avoided to have both online at the same time.
  7. After installation is complete, check/set the proper bootlist
    bootlist -m normal -o 
    bootlist -m normal -o hdisk0 hdisk1 # e.g. for a mirrored system

Re [SAGE] AIX Restore from mksysb has missing device special files

Ng Pheng Siong wrote:
>I had occasion to restore an AIX machine from a mksysb tape made on the
>same machine.

>The restoration appears fine, but the device special files for filesystems
>on other than the first hard disk are missing, so the system is unable to
>mount them. (I'm assuming the data is intact there. ;-)

>Googling, I find references to commands like getlvodm, synclvodm, importvg,
>etc. Are these the magic knobs?

The correct way to access the data is to use importvg. You will need to
do this once for each volume group on the "old" system (not including the
root volume group rootvg, the mksysb restore created that).

You might have had 1 volume group with all 3 other disks or up to 3 separate
volume groups with one disk each. If there are multiple disks in a volume
group AIX will figure it out for you!

You only need to specify one disk name from the volume group and AIX should
find the other members of the group, check they are all there, get them,
figure out all the filesystems in the volume group and create entries in
/etc/filesystems for you.

To see what disks you have and what volume groups AIX knows they are in
so far use 'lspv'. Does it look something like this:

hdisk0 000179124a09c405 rootvg
hdisk1 00017912034d4408 None
hdisk2 00017912034d8491 None
hdisk3 00017912034db248 None

Before you try this ... is this a standalone system? Are any other machines
cabled to these disks? My experience does NOT include concurrent access VGs.

To access the volume group that lived on hdisk1 you could run:

importvg -y myvg01 hdisk1

The name of the volume group will be 'myvg01'. If the volume group was
just on that 1 disk lspv would show:

hdisk0 000179124a09c405 rootvg
hdisk1 00017912034d4408 myvg01
hdisk2 00017912034d8491 None
hdisk3 00017912034db248 None

If that VG was made up of all 3 disks you would be done and would see:

hdisk0 000179124a09c405 rootvg
hdisk1 00017912034d4408 myvg01
hdisk2 00017912034d8491 myvg01
hdisk3 00017912034db248 myvg01

Kevin Ruderman
Information Technology Boston University

On Thu, Jul 03, 2003 at 02:39:51PM -0400, Kevin Ruderman wrote:
> Ng Pheng Siong wrote:
> >The restoration appears fine, but the device special files for filesystems
> >on other than the first hard disk are missing, so the system is unable to
> >mount them. (I'm assuming the data is intact there. ;-)
> The correct way to access the data is to use importvg. You will need to
> do this once for each volume group on the "old" system (not including the
> root volume group rootvg, the mksysb restore created that).
> [ Very comprehensive explanation. ]

Thank you, Kevin.

> importvg -y myvg01 hdisk1

Did that for hdisk[123], fsck'ed then mounted the newly identified
entries in /etc/filesystems. All is well again.

Much appreciated. Cheers.

Ng Pheng Siong <[email protected]>

System Backups with mksysb by Mark D. Roth <[email protected]>

Commands Reference, Volume 3

mksysb Command


Creates an installable image of the root volume group either in a file or onto a bootable tape.


mksysb [ -b Number ] [ -e ] [ -p ] [ -v ] [ -X ] [ -i | -m ] Device | File


The mksysb command creates a backup of the operating system (that is, the root volume group). You can use this backup to reinstall a system to its original state after it has been corrupted. If you create the backup on tape, the tape is bootable and includes the installation programs needed to install from the backup.

The file-system image is in backup-file format. The tape format includes a boot image, a bosinstall image, and an empty table of contents followed by the system backup (root volume group) image. The root volume group image is in backup-file format, starting with the data files and then any optional map files.

One of the data files mksysb uses is the / file. If a / file doesn't exist, /var/adm/ras/ is copied to / (root). In AIX Version 4.3.3 and later versions, mksysb always updates the target_disk_data stanzas in to match the disks currently in the root volume group of the system where the mksysb command is running.

If you are using a customized / file and do not want the target_disk_data stanzas updated, you must create the file /save_bosinst.data_file. The mksysb command does not update / if the /save_bosinst.data_file exists.

  1. The image the mksysb command creates does not include data on raw devices or in user-defined paging spaces.
  2. If you are using a system with a remote-mounted /usr file system, you cannot reinstall your system from a backup image.
  3. The mksysb command may not restore all device configurations for special features, such as /dev/netbios and some device drivers not shipped with the product.
  4. Some rspc systems do not support booting from tape. When you make a bootable mksysb image on an rspc system that does not support booting from tape, the mksysb command issues a warning indicating that the tape will not be bootable. You can install a mksysb image from a system that does not support booting from tape by booting from a CD and entering maintenance mode. In maintenance mode you will be able to install the system backup from tape.

To create a backup of the operating system to CD, please refer to the mkcd command.


-b Number Specifies the number of 512-byte blocks to write in a single output operation. When the backup command writes to tape devices, the default is 100 for backups by name.

The write size is the number of blocks multiplied by the block size. The default write size for the backup command writing to tape devices is 51200 (100 * 512) for backups by name. The write size must be an even multiple of the tape's physical block size.

-e Excludes files listed in the /etc/exclude.rootvg file from being backed up. The rules for exclusion follow the pattern matching rules of the grep command.
Note: If you want to exclude certain files from the backup, create the /etc/exclude.rootvg file, with an ASCII editor, and enter the patterns of file names that you do not want included in your system backup image. The patterns in this file are input to the pattern matching conventions of the grep command to determine which files will be excluded from the backup. If you want to exclude files listed in the /etc/exclude.rootvg file, select the Exclude Files field and press the Tab key once to change the default value to yes.

For example, to exclude all the contents of the directory called scratch, edit the exclude file to read as follows:


For example, to exclude the contents of the directory called /tmp, and avoid excluding any other directories that have /tmp in the pathname, edit the exclude file to read as follows:


All files are backed up relative to . (current working directory). To exclude any file or directory for which it is important to have the search match the string at the beginning of the line, use ^ (caret character) as the first character in the search string, followed by . (dot character), followed by the filename or directory to be excluded.

If the filename or directory being excluded is a substring of another filename or directory, use ^. (caret character followed by dot character) to indicate that the search should begin at the beginning of the line and/or use $ (dollar sign character) to indicate that the search should end at the end of the line.

-i Calls the mkszfile command, which generates the / file. The / file contains information on volume groups, logical volumes, file systems, paging space, and physical volumes. This information is included in the backup for future use by the installation process.
Note: Before running the mkszfile command, ensure that enough space is available in the /tmp file to store a boot image. This space is needed during both backup and installation. To determine the amount of space needed in the /tmp file, issue the following command:
bosboot -q -a -d device

If you use the -X flag with the mksysb command, you do not need to run the bosboot command to determine the amount of space needed in the /tmp file.

-m Calls the mkszfile command, with the -m flag to generate map files.
-p Disables software packing of the files as they are backed up. Some tape drives use their own packing or compression algorithms. This flag only applies to AIX Version 4.2 or later.
-v Verbose mode. Lists files as they are backed up. This flag only applies to AIX Version 4.2 or later.
-X Specifies to automatically expand the /tmp file system if necessary. The /tmp file system may need to be extended to make room for the boot image when creating a bootable backup to tape. This flag only applies to AIX Version 4.2 or later.


Device | File Specifies the name of the device or file.


  1. To generate a system backup and create an / file (generated by the mkszfile command) to a tape device named /dev/rmt0, enter:
    mksysb -i /dev/rmt0
  2. To generate a system backup and create an / file with map files (generated by the mkszfile command) to a tape device named /dev/rmt1, enter:
    mksysb -m /dev/rmt1
  3. To generate a system backup with a new / file, but exclude the files in directory /home/user1/tmp, create the file /etc/exclude.rootvg containing the line /home/user1/tmp/, and enter:
    mksysb -i -e /dev/rmt1
    This command will backup the /home/user1/tmp directory but not the files it contains.
  4. To generate a system backup file named /mksysb_images/node1 and a new / file for that image, enter:
    mksysb -i /userimage/node1
    Note: This file will not be bootable and can only be installed using Network Installation Management (NIM).


/usr/bin/mksysb Contains the mksysb command.

Related Information

The backup command, bosboot command, mkcd command, mkszfile command.

The / file.

A procedure to verify the mksysb backup can be found in the article "To Verify a Backup Tape" in the AIX Installation Guide.

A procedure to install from a system backup can be found in the article "Installing BOS from a System Backup" in the AIX Installation Guide.



Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy


War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes


Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law


Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Haterís Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D

Copyright © 1996-2021 by Softpanorama Society. was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site


The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: March 12, 2019