[ Previous | Next | Table of Contents | Index | 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 -r directory | -d cd_device | -E proto | -j proto | -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 ] [ -L ][ -b bundle_file ] [ -z custom_file ] [ -D ]

Description

The mckd command creates a system backup image (mksysb) to CD-Recordable (CD-R) or DVD-Recordable (DVD-R, DVD-RAM) 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. Only chrp machines can boot from DVDs.

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.

See the -L flag for details about creating DVD-sized images. What applies to CDs also applies to DVDs, except where noted.

Note: The functionality required to create Rock Ridge format CD images and to write the CD image to the CD-R, DVD-R or DVD-RAM 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, DVD-R or DVD-RAM device (/dev/cd1, for instance). This flag is required unless you use the -S flag.
-r directory Indicates existing directory structure to burn onto a CD or DVD. This makes a CD image that is a copy of the given directory structure.
-E proto Used to specify the DOS partition proto file. This flag is used in conjunction with the -j flag to build an El Torito formatted CD to be used on the IA64 platform.
-j proto Create a Rockridge file system image and just backup the files listed. A separate directory structure will be created to look like the file system described in the proto file, so space will be required. See the -r flag if just a Rockridge file system is required.
-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 645MB of available disk space (up to 4.38 GB for DVD sized images). The CD image will only consume as much room as necessary to contain all the data on the CD.

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.

Note: If performing DVD sized backups, the filesystems need to be large file enabled. This also requires setting the file ulimit size to unlimited.

-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.

Note: If performing DVD sized backups, the filesystems need to be large file enabled. This also requires setting the file ulimit size to unlimited.

-I cd_image_dir Specifies the directory or file system where the final CD images are stored before writing to the CD-R, DVD-R or DVD-RAM 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. The CD image will only consume as much room as necessary to contain all the data on the CD.Note: If performing DVD sized backups, the filesystems need to be large file enabled. This also requires setting the file ulimit size to unlimited.

-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, DVD-R or DVD-RAM 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, DVD-R or DVD-RAM 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.
-L Creates final CD images that are DVD sized (up to 4.38 GB).
-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 system backup to the DVD-R or DVD-RAM device named /dev/cd1, enter:

    mkcd -d /dev/cd1 -L
    
  3. 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.
  4. 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
    
  5. 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
    
  6. To create a CD or DVD that duplicates an existing directory structure
    /mycd/a
    /mycd/b/d
    /mycd/c/f/g
    

    use the following command:

    mkcd -r /mycd -d /dev/cd1
    

    After mounting with mount -o ro /dev/cd1 /mnt, cd to /mnt; a find . -print command displays:

    ./a
    ./b
    ./b/d
    ./c
    ./c/f
    ./c/f/g
    

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 "Verifying a System Backup" in the AIX 5L Version 5.1 Installation Guide.

For more information about CD-R drives (including DVD-R and DVD-RAM drives) and CD-R creation software, and for information on using mkcd to backup IA64 systems, refer to the following README file: /usr/lpp/bos.sysmgt/README.oem_cdwriters


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]