[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Commands Reference, Volume 3

mkcd Command

Purpose

Creates a multi-volume CD (or CDs) from a mksysb or savevg backup image.

Syntax

mkcd -d cd_device | -S [ -m mksysb_image | -M mksysb_target | -s savevg_image | -v savevg_volume_group ] [ -C cd_fs_dir ] [ -I cd_image_dir ] [ -V cdfs_volume_group ] [ -G ] [ -B ] [ -p pkg_source_dir ] [ -R | -S ] [ -i image.data ] [ -u bosinst.data ] [ -e ] [ -P ] [ -l package_list ] [ -b bundle_file ] [ -z custom_file ] [ -D ]

Description

The mckd command creates a system backup image (mksysb) to CD-Recordable (CD-R) from the system rootvg or from a previously created mksysb image. It also creates a volume group backup image (savevg) to CD-R from a user-specified volume group or from a previously created savevg image.

With mkcd you can create three types of CDs: personal system backup, "generic" backup, and a non-bootable volume group backup.

Personal system backup CDs can only boot and install a specific machine and is similar to using mksysb on tape.

Generic backup CDs can boot and install any RS/6000 platform (rspc, rs6k, or chrp). This backup requires all the necessary device support, including the MP kernel, to create the boot images for all three platforms. This type of backup also requires a user-supplied and previously created mksysb image.

The non-bootable volume group backup contains only the CD image of a volume group. If this backup contains rootvg backup, then you must boot from a product CD before restoring the mksysb image, or use alt_disk_install to install it. If the backup volume group is a non-rootvg volume group, then use restvg to restore the image.

Note: The functionality required to create Rock Ridge format CD images and to write the CD image to the CD-R device is not part of the mkcd command. You must supply additional code to mkcd to do these tasks. The code will be called via shell scripts and then linked to /usr/sbin/mkrr_fs (for creating the Rock Ridge format image) and /usr/sbin/burn_cd (for writing to the CD-R device). Both links are called from the mkcd command.

Some sample shell scripts are included for different vendor-specific routines. You can find these scripts in /usr/samples/oem_cdwriters.

If you do not give any file systems or directories as command parameters, mkcd creates the necessary file systems and removes them when the command finishes executing. File systems you supply are checked for adequate space and write access.

Note: If mkcd creates file systems in the backup volume group, they are excluded from the backup.

If you need to create multi-volume CDs because the volume group image does not fit on one CD, mkcd gives instructions for CD replacement and removal until all the volumes have been created.

Flags

-d cd_device Indicates the CD-R device (/dev/cd1, for instance). This flag is required unless you use the -S flag.
-m mksysb_image Specifies a previously created mksysb image. If you do not give the -m flag mkcd calls mksysb. (See the -M flag for more information about where the mksysb image is placed.)
-s savevg_image Indicates a previously created savevg image.See the Notes below.
-v savevg_volume_group Denotes the volume group to be backed up using the savevg command. See the Notes below. (See the -M flag for more information about where the savevg image is placed.)
-C cd_fs_dir Specifies the file system used to create the CD file system structure, which must have at least 640MB of available disk space.

If you do not specify the -C flag and the /mkcd/cd_fs directory exists, mkcd uses that directory. If you do not give the -C flag and the /mkcd/cd_fs directory does not exist, mkcd creates the file system /mkcd/cd_fs and removes it when the command finishes executing. The command creates the file system in the volume group indicated with the -V flag, or rootvg if that flag is not used. Each time you invoke the mkcd command, a unique subdirectory (using the process id) is created under the /mkcd/cd_fs directory, or in the directory specified with the -C flag.

-M mksysb_target States the directory or file system where the mksysb or savevg image is stored if a previously created backup is not given with the -m or -s flags. If the -M flag is not used and a mksysb or savevg image is not provided, mkcd verifies that /mkcd/mksysb_image exists. If the directory does not exist, then mkcd creates a separate file system, /mkcd/mksysb_image, where the mksysb or savevg images are temporarily stored. The command creates the file system in the volume group given with the -V flag, or in rootvg if that flag is not used.
-I cd_image_dir Specifies the directory or file system where the final CD images are stored before writing to the CD-R device. If this flag is not used, mkcd uses the /mkcd/cd_images directory if it already exists. If not, the command creates the /mkcd/cd_images file system in the volume group given with the -V flag, or in rootvg if that flag is not used.

If mkcd creates the file system, it is removed upon command completion, unless either the -R or -S flag is used. If the -R or -S flag is used, consideration must be made for adequate file system, directory, or disk space, especially when creating multi-volume CDs.

-V cdfs_volume_group Indicates the volume group used when creating the file systems needed for the mkcd command. If the -V flag is not given and a file system is needed but not there (because it was not supplied with other flags), then rootvg is the default volume group for creating the file systems. If mkcd creates the file systems in the backup volume group, those file systems are not included as part of the backup image. mkcd-created file systems are removed upon the command's completion.
-G Generates a generic bootable mksysb CD. The CD contains all three RS/6000 platform (chrp, rs6k, rspc) boot images. In conjunction with the -G flag, you must specify the -m and -p flags.
-p pkg_source_dir Names the directory or device that contains device and kernel package images. The device can only be a CD device (for example, /dev/cd0). If you use the same CD-R device that you gave with the -d flag, the product CD media must be inserted into the CD-R drive first. mkcd then prompts you to insert the writeable CD before the actual CD creation. You must use the -p flag if using the -G flag.
-B Prevents mkcd from adding boot images (non-bootable CD) to the CD. Use this flag if creating a mksysb CD that you will not boot. Before installing the non-bootable mksysb CD you must boot a same level (V.R.M.) product CD. The mkcd command defaults to creating a bootable CD for the machine type of the source system. See the Notes below.
-R Prevents mkcd from removing the final CD images. mkcd defaults by removing everything that it creates when it finishes executing. The -R flag allows multiple CD image sets to be stored, or for CD creation (burn) to occur on another system. If multiple volumes are needed, the final images are uniquely named using the process ID and volume suffixes.
-S Stops mkcd before writing to the CD-R, without removing the final CD images. The -S flag allows multiple CD sets to be created, or for CDs to be created on another system. The images remain in the directory marked by the -I flag, or in the /mkcd/cd_images directory if the -I flag is not used. If multiple volumes are required, the final images are uniquely named using the process ID and volume suffixes.
-u bosinst.data Specifies the user-supplied bosinst.data file. This data file takes precedence over the bosinst.data file in the mksysb image. If you do not give the -u flag, then mkcd restores bosinst.data from the given mksysb image, or generates a new bosinst.data file during the creation of mksysb.
-i image.data Specifies the user-supplied image.data file. This data file takes precedence over the image.data file in the mksysb image. If you do not give the -i flag, then mkcd restores the image.data from the given mksysb image, or generates a new image.data file during the creation of mksysb.
Note: The -i flag cannot be used to specify a user-supplied vgname.data file for use with a savevg image.
-e Excludes the files and/or directories from the backup image listed in the /etc/exclude.volume_group file. You cannot use this flag with the -m or -s flags.
-P Creates physical partition mapping during the mksysb or savevg creation. You cannot use this flag with the -m or -s flags. The -P flag is not recommended for generic backup CDs.
-l package_list Specifies the file containing a list of additional packages you want copied to the ./usr/lpp/inst.images directory of the CD file system. The images are copied from the location named with the -p flag. If you use the -l flag you must also use the -p flag.
-b bundle_file Gives the full pathname of the file containing a list of filesets to be installed after the mksysb is restored. This file is copied to ./usr/sys/inst.data/user_bundles/bundle_file in the CD file system and also copied to RAM in case the CD is unmounted. The file would be listed as BUNDLES=/../usr/sys/inst.data/user_bundles/bundle_file in the bosinst.data file.
-z custom_file States the full pathname of the file to be copied to the root directory of the CD file system. This file could be a customization script specified in the bosinst.data file, such as CUSTOMIZATION_FILE=filename.
For example: If the file my_script is in /tmp on the machine where mkcd is running, then enter -z/tmp/my_script and specify CUSTOMIZATION_FILE=my_script. The code copies the script to the root directory of the RAM file system before it executes.
-D Turns on the debug output information feature. The default is no debug output.
Notes:
  1. If you are creating a non-bootable CD (using the -B flag), you cannot use the -p or -l flags.
  2. If you are creating a non-bootable CD with a savevg image (using the -s or -v flags), you cannot use the -p, -l, -u, -i, -z, or -b flags.

Examples

  1. To generate a bootable system backup to the CD-R device named /dev/cd1, enter:
    mkcd -d /dev/cd1
  2. To generate a non-bootable volume group backup of the volume group myvg to /dev/cd1, enter:
    mkcd -d /dev/cd1 -v myvg
    Note: All savevg backup images are non-bootable.
  3. To generate a generic system backup with the previously created mksysb and with /mydata/mksysb and /dev/cd0 as the package source location, and to write to /dev/cd1, enter:
    mkcd -d /dev/cd1 -G -m /mydata/mksysb -p /dev/cd0
  4. To generate a non-bootable system backup, but stop mkcd before the CD is created and save the final images to the /mydata/my_cd file system, and create the other mkcd filesystems in myvg, enter:
    mkcd -B -I /mydata/my_cd -V myvg -S

Files

/usr/bin/mkcd Contains the mkcd command.

Related Information

The mksysb command and savevg command.

The /image.data file and the /bosinst.data file.

A procedure to verify the backup can be found in the article "To Verify a System Backup" 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.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]