uncommented IBM_PROLOG_BEGIN_TAG uncommented This is an automatically generated prolog. uncommented uncommented bos720 src/bos/usr/sbin/mkcd/mkcd.README.txt.S 1.3.4.4 uncommented uncommented Licensed Materials - Property of IBM uncommented uncommented Restricted Materials of IBM uncommented uncommented COPYRIGHT International Business Machines Corp. 1999,2011 uncommented All Rights Reserved uncommented uncommented US Government Users Restricted Rights - Use, duplication or uncommented disclosure restricted by GSA ADP Schedule Contract with IBM Corp. uncommented uncommented IBM_PROLOG_END_TAG Mksysb on CD and DVD: Important Details, Tutorials _________________________________________________________________ Introduction: The mkcd/mkdvd command allows customers to create bootable backup images of their systems on writable CD/DVD's. This README file is meant as an overview and contains the latest information for the mkcd command. You are strongly encouraged to read this entire document, even if you just want to make a simple backup of your own system and never believe that you will need to reinstall it to any other machine (this could happen). You should also read the "Backing Up Your System" section in Installation Guide and the mkcd/mkdvd man page. Note: If you have the CD automount daemon enabled, please be aware that it will be temporarily suspended during the mkcd operation when burning a CD/DVD and reactivated after completion. Topics Covered: * What you'll need - other than your machine. * Creating UDF formatted backups * Firmware - Older systems not booting from UDF media. * mksysb command supports UDF capable media * Extra file system space - borrow some from a buddy today * System considerations * Booting and Installing - Original system only vs. Multiple systems * Saving a non-rootvg volume group * Interfaces - SMIT * Multi-volume support * Problems populating the cdfs using the cdfs.optional.list proto file * Customizing your CD - adding additional packages, customization scripts, bundles, customized bosinst.data and image.data files * alt_disk_install - Will it install from a mksysb CD? Yes! * Go straight to Rock Ridge/UDF * Burning CDs and DVDs * Error message 0512-332 * Use -a flag to create backups compatible with earlier AIX levels * ISO9660 backup to DVD error "Cannot send SCSI cmd via ioctl" * Creating boot-only media * Backing up multiple directories * Boot image created from mksysb file What you'll need - other than your machine You'll need a recordable CD drive (CD-R or CD-RW) or DVD drive (DVD-RAM). Note: We currently test using 5X speed DVD-RAM media in IBM DVD-RAM drives. Additionally, the IBM DVD-RAM drives only support writing to DVD-RAM media (cannot write to DVD-R/RW, DVD+R/RW or CD media). Software - What we tested and where you can get it For ISO9660 creation, we used: * cdrtools.base - This is automatically installed as part of the base AIX operating system. If for some reason it is not on your system, you can install it from your AIX 7.1 product media. To see whether or not it is installed, just type the following command: $ lslpp -L cdrtools.base cdrtools.base 1.9.0.8 C F CD/DVD recorder If you had the cdrecord and mkisofs rpm images installed, the installation of cdrtools.base will remove the rpm packaged software. Note: If you plan to do backups larger than 2 GB on ISO9660 DVD, you will need to compile to allow for large files (for example: -D_LARGE_FILES). For UDF creation, we are using IBM DVD-RAM drive, DVD-RAM media and the UDF file system code that ships with AIX 7.1. Once you decide what hardware and software you want to use and obtain it, you may need to create the appropriate links to the sample scripts that have been written that will work with the mkcd command. By default, links were created when your system was installed to point to the GNU software. If you want to use some other software, you will need to create the links. For example, if you want to use YoungMinds software, then you will need to create the following links: ln -fs /usr/samples/oem_cdwriters/mkrr_fs_youngminds /usr/sbin/mkrr_fs ln -fs /usr/samples/oem_cdwriters/burn_cd_youngminds /usr/sbin/burn_cd The scripts we created to call the commands to create the file systems and burn the CD's can be changed if there is a parameter that you want to change, like write speed, but we found we got the best results with the settings in the scripts. Also, some of the sample parameters are extremely important to allow booting. If you are going to use UDF, you do not need to change any links. Creating UDF formatted backups Use mkcd/mkdvd to create backups on DVD-RAM media using the Universal Disk Format (UDF). For UDF DVD backups, specify the -U flag otherwise an ISO9660 formatted DVD backup will be created. UDF backups was introduced in AIX 5.2.0 and is not supported in earlier versions of AIX. UDF also uses less disk space for creating the backup because it writes the backup directly to the DVD. The backup file will still have to be created on the system, unless it is user specified, and then it will be copied directly to the media. The space is saved because there doesn't have to be a CD/DVD image created prior to writing to the media. We will discuss this in detail later on. In this document, the term CD also implies DVD except where noted. mksysb command supports UDF capable media The ability for the mksysb command to create UDF backups directly was added in AIX 5.3.0.11 (TL 11). Using the mksysb command does not require any of the extra file system space that the mkcd command requires. This has been tested using DVD-RAM and RDX (removable hard disk cartridge) media. Firmware - Older systems not booting from UDF media. If the system does not boot from UDF media, it may need a firmware update. To download the latest firmware, access the technical support microcode website at: http://www14.software.ibm.com/webapp/set2/firmware/gjsn Extra file system space Unfortunately, you'll need extra file system space to create the CD's, and ISO9660 DVDs. Unlike tapes and UDF DVDs, where files can be written directly to the media, an ISO9660 CD/DVD image must be created in the file system first, before copying it to CD. The easiest way around this, if you have space on your system, is to just allow mkcd to create the temporary file systems it needs, and it will remove them after it has finished using them. It will also exclude them from the backup, so you won't end up with mkcd files in your mksysb image. You can check your space in rootvg with "lsvg rootvg" and verify that you have enough. The space requirements for the temporary file systems will vary depending on the amount of data to be backed up, but will not exceed the size of the media to be backed up to (about 1.3 GB for CD and 8.8 GB for ISO9660 DVD total) plus space will be required if backup requires multiple volumes and you are saving the multiple volume images after burning them, plus space to hold you mksysb image if you haven't already created it. That's why it's a good idea to create your mksysb ahead of time to a file so you'll know the size, and if it will fit on one CD. If you don't have that much space in rootvg, you can use another volume group (-V option from mkcd). The addition of the -L option is what lets the file systems go beyond 1.3 GB so that a backup can be made for DVD media. Note: More space will be required if the backup is multiple volumes and you are saving the multiple volume images after burning them. In the end you are responsible for making sure the space requirements are met in order to create a backup of your system. The mkcd command will create the following file systems if they are not already present, or if alternate file systems or directories have not been given: /mkcd/mksysb_image /mkcd/cd_fs * /mkcd/cd_images * * Won't be created for UDF formatted DVDs. Note: mkcd will not cumulate the total size of the cd images, mksysb image, and any extra install packages if alternate filesystems are specified and the same directory is used for all three temporary filesystems. Therefore you must make sure to have enough space available when specifying to do everything in the same directory. The space used in these file systems will only be temporary (unless the -R or -S flag is specified to save the images). If the mkcd command creates the file systems, it will remove them. Each file system or directory could require up to 645 megabytes (4.09 GB for DVD). The /mkcd/cd_fs directory will need up to 645 megabytes (4.09 GB for DVD) of free space. The /mkcd/mksysb_images directory's space requirement will depend on the size of the data on the system you are backing up. The mkcd process will attempt to calculate this space and verify that adequate space is available before starting the mksysb image. The /mkcd/cd_image directory could need up to 645 megabytes (4.09 GB for DVD) of free space. If the -R or -S flags are used to specify not removing the images, then more space will need to be provided. System considerations 1. The mkcd command is designed for 670 MB capacity CD media or 4.7 GB capacity per side DVD media. It can write to smaller media, but only if the data to backup will not exceed a single volume. For example, if you have 2.6 GB media, then you should not attempt to back up 3 GB of data because it will not fit, but mkcd will not prompt for another volume until the backup reaches greater than 4 GB. It does not give any errors when writing more than what will fit on the media. So, it will appear that it wrote the 3 GB onto the 2.6 media, but it will then be corrupt. 2. If you specify or create file systems for mkcd to use as temporary space, those file systems must be "large file enabled" file system. If this is not done, the backup will fail if it is greater than 2 GB. The "large file enabled" attribute can only be set at creation time of the file system. If mkcd is allowed to create its own temporary file systems, it will create them "large file enabled". Booting and Installing: - The original system only vs. Multiple Systems Original System Only: If "Enable System Backups to install any system" was changed to 'no' when you installed AIX 5.3 on you system, then unless the hardware is identical between the system backed up and any additional systems you are trying to install, you will need to boot from the product CD, choose option 'Start Maintenance Mode for System Recovery', and then select 'Install from a System Backup', to install your backup CD. To check if you have installed all devices/kernels installed, type the following command: ALL_DEVICES_KERNELS = If you see the above variable set to no, then you will only be able to boot the original system or systems with identical hardware. If the variable is blank or yes, then you are enabled and will be able to use your backup to boot and install any 5.3 supported system with one possible exception. When a bootable backup is created, the boot image reflects the currently running kernel. If the current kernel is the 64-bit kernel, the backup's boot image is also 64-bit, and it only boots 64-bit system. If the current kernel is a 32-bit kernel, the backup's boot image is 32-bit, and it can boot both 32-bit and 64-bit systems. Why have we changed to use the current kernel? The 32-bit systems cannot boot using a 64-bit kernel. Additionally, there are some configurations that require the system to boot from the 64-bit kernel in order to install. To ensure that the backup will at least work on the system it came from, we create the boot image to reflect the kernel running at backup time. Why did we choose to install all the device and kernel support on every system? The main purpose of installing all the devices and kernels on a system at BOS install time is to allow them to be updated along with all the other software on your system. The problems we have run into with cloning (booting from product CD, installing from a mksysb, and then installing additional device support from the product CD) is that the levels of kernels or devices do not match the level of the mksysb, especially if the mksysb had additional updates on top of a recommended maintenance level. If all the devices and kernels are there each time you perform an update, then the system should be at a consistent level. Multiple Systems: You have installed a system and set the "Enable System Backups to install any system" option in the "More options" menu to "Yes" (this is the default) during Base Operating System Install. If you're a customer that has a lot of systems that you want to all look the same, set up a machine the way you want it to look (IE, install additional software or data), then create a mksysb CD. Now you can boot and install any IBM system you have capable of running AIX 5.3. When BOS install runs, it checks to see if it is installing to the original system or to a new system (cloning). If it is cloning, it will NOT recover the device support of the original system. So, you won't end up with conflicting hostnames, tcpip information, etc. This is also done by default now in 5.3. The RECOVER_DEVICES field in the bosinst.data file is set to "Default", which means that it only recover devices if installing to the same system (same CPU). You can override this, for the case of upgrading a system by setting RECOVER_DEVICES to Yes. See Customizing your CD for more information on configuring a more personalized mksysb. Saving a non-rootvg volume group The mkcd command can also be used to back up a user (non-rootvg) volume group to CD. The mkcd command has the ability to create a user volume group (savevg) CD. This CD has a copy of a non-rootvg volume group on it, and is useful for backing up volume groups that contain user data. The mkcd command only supports saving one volume group to a CD at a time. The volume group is saved as /usr/sys/inst.images/savevg_image on the CD. The SMIT interfaces can be used to save a user volume group to CD and to remake a user volume group from a CD backup. If using the SMIT interface, the fastpath, smitty vgbackup, takes you to the 'Back Up a Volume Group' menu, from which you have the choice to back up to tape/file or CD/DVD. The fastpath, smitty savevgcd, takes you directly to 'Back Up a Volume Group to CD'. If using the command line interface, you must use the -s or -v flags to specify an existing savevg image, or the name of the volume group to be backed up, respectively. Interfaces - SMIT Why create a mksysb on CD/DVD? There are a variety of reasons that you may want to create a mksysb on CD. The most obvious reason would be as a backup of your machine in case you have a disk failure, or some other problem that would require you to reinstall a backup (replacing/upgrading a system, cloning to other systems, etc). For this purpose, you would create a mksysb on CD. One thing to note is that the mkcd command will not be executed until the last panel that says "Selecting next will create the CD images and write the CD". So, don't worry about hitting next and back before this panel. You can familiarize yourself with it until you feel comfortable and then start the process. The time it takes will vary on the amount of data you are backing up. Another easy way to use mkcd is with "smitty mkcd" or "smitty mkdvd" depending on the media you are using. There is an easy to use, taskguide for mkcd, because we know that this maybe a new process to you and not very intuitive. To start the taskguide directly, type mkcdtg. To get to the SMIT menus, use the "smitty mkcd" for CD's, and "smitty mkdvd" for DVD's. Multi-volume support The multi-volume support is built into the mkcd command. Basically the same process will take place for each CD, except a boot image will only be created for the first CD. Multi-volume support is available for mksysb and savevg CDs. Problems populating the cdfs using the cdfs.optional.list proto file Due to hardware device changes that happen between releases with the same version number, some device related filesets in the cdfs.optional.list proto file may not be on your product media. The solution to this is to remove the lines containing the missing filesets from the file: /usr/lpp/bosinst/cdfs.optional.list Note: Make sure you back this file up first! Also, you must be root to do this. Also note that if things do show up as missing, then if the backup is used to install a system that has those particular devices that require the missing drivers, then the device software would need to be installed separately. Customizing your CD - adding additional packages, customization scripts, bundles, customized bosinst.data and image.data files There are a variety of options available for customizing your mksysb CD. Adding additional install packages to the CD If you would like to add additional install packages to the media that will install after the restore of the mksysb, you can do that. You'll also need to create a install bundle or a script to get them installed. Remember if you want your CD/DVD to be able to boot and install any and all systems, you will need to have all devices/kernels installed on your system. To check if this was originally done during install time, run the following command. If you get: ALL_DEVICES_KERNELS = no then you will have to add all devices and kernels in order to install multiple system hardware configurations. Note: When bootable media is created, the boot image reflects the currently running kernel. If the current kernel is the 64-bit kernel, the media's boot image is also 64-bit, and it only boots 64-bit system. If the current kernel is a 32-bit kernel, the media's boot image is 32-bit, and it can boot both 32-bit and 64-bit systems. Why have we changed to use the current kernel? The 32-bit systems cannot boot using a 64-bit kernel. Additionally, there are some configurations that require the system to boot from the 64-bit kernel in order to install. To ensure that the backup will at least work on the system it came from, we create the boot image to reflect the kernel running at backup time. If you don't want all devices and kernels installed, then you will have to boot from product CD, to install your backup CD/DVD. Creating a bundle You provide the pathname of the file where the bundle is on your system, and also provide a bosinst.data file with the name of the bundle, so installp will be called with the file after the restore of the mksysb. mkcd will copy your bundle file to the CD file system, so that's where the bosinst.data file should list the file. If you already have a mksysb image created, restore the bosinst.data file from it and edit it. Example, I already have a mksysb of my system (/big_fs/julie_mksysb), and I created a bundle file, /tmp/mybundle, with one line "I:bos.games" (the I: prefix specifies that this is an installp image), so I would do the following: cd /tmp restore -xvqf/big_fs/julie_mksysb ./bosinst.data vi /tmp/bosinst.data change "BUNDLES=" to BUNDLES=/../usr/sys/inst.data/user_bundles/mybundle Give the /tmp/bosinst.data file and /tmp/mybundle files to the mkcd command, or use smitty and Install bundle file [/tmp/mybundle] User supplied bosinst.data file [/tmp/bosinst.data] Now after my mksysb is restored, the fileset bos.games will be installed. Of course, I would also have had to use the a stacklist and included bos.games so it would be on the CD. Running a script at install time Getting a script file to run after the restore of the mksysb is a lot like creating a bundle, except you don't have to provide images (unless that's how you want to install any additional filesets). The difference is that the script is kept in the root file system of the CD, so you don't have to give a long pathname in the bosinst.data file. You must provide a bosinst.data and a script: cd /tmp restore -xvqf/big_fs/julie_mksysb ./bosinst.data vi /tmp/bosinst.data change "CUSTOMIZATION_FILE=" CUSTOMIZATION_FILE=my_script Customization script [/tmp/my_script] User supplied bosinst.data file [/tmp/bosinst.data] Note: Running interactive shell scripts (prompting the user for data/answers) during a base operating system (BOS) install is NOT recommended. Customizing the bosinst.data file See above for information about how to restore the bosinst.data file from an existing mksysb image. If you are creating a mksysb CD and don't have a bosinst.data file, use the one from /var/adm/ras/bosinst.data. Copy it to /tmp and edit the variables to to your desired values. If you don't need a customized bosinst.data file, the mksysb command will either use an existing one in /, or it will copy it from /var/adm/ras/bosinst.data to /. It will then update the /bosinst.data file with existing information on target disks. Please see the mksysb man page for more information. Customizing the image.data file The image.data file is not a file that we usually change. It contains the logical volume and file system information that is used when rootvg is created at install time. If you change any values, the mksysb may not be able to restore due to lack of space or a file system that didn't get created. If you already have a mksysb image, you can restore the image.data file and customize it: cd /tmp restore -xvqf/big_fs/julie_mksysb ./image.data If you are going to create a backup CD/DVD, you can create an image.data ahead of time with the mkszfile command. Call mkszfile and an image.data file will be created in /image.data. alt_disk_install - Will it install from a mksysb CD? Yes! alt_disk_install will now allow /dev/cd0 to be given as the device (instead of just tape like before) * Device or image name [/dev/cd0] Go straight to Rock Ridge/UDF If you have an existing directory structure that you would like to burn onto a CD or DVD, you can use the -r flag to specify the root of that directory structure. This will skip all the steps of building the file system and copying a mksysb, and all the other gyrations that mkcd normally goes through, and simply make a CD image that is a copy of the given directory structure. NOTE: There is also a performance decrease when using mkcd -r with UDF and a large number of files. For example, the command: mkcd -d /dev/cd1 -r /usr/local/man will burn a copy of everything contained in /usr/local/man onto a CD in /dev/cd1. The root level of the CD will be a copy of files and directories found in /usr/local/man. Also, the command: mkcd -S -r /my/backup/directory -L will create a DVD sized image file (but not burn it) containing everything in /my/backup/directory. The image will be left in /mkcd/cd_images. To specify your own directory to leave the image in, use this command: mkcd -S -r /my/backup/directory -I /my/image/directory -L To burn the DVD, and leave the image file in the directory, use this command: mkcd -d /dev/cd1 -r /my/backup/directory -I /my/image/directory -R -L Note: For ISO9660, no single file in the directory may exceed 2 GB (UDF doesn't have this limitation). An advantage to using the "straight to Rock Ridge" option is that no disk space is required to build the file system for the CD image, since mkcd uses your directory structure. The only disk space that is required is the space to store the CD image created by the mkcd command. For UDF you would not need any extra space. Lastly, the data within the directory structure may not exceed what can fit on one volume. An error message will display if the amount of data is greater than what a single volume can hold. Burning CDs and DVDs To burn an existing image to media using an AIX system, use the burn_cd command: For CD: /usr/sbin/burn_cd /dev/cd0 For DVD: /usr/sbin/burn_cd -d /dev/cd0 Note: An iso image maybe transferred to a non-AIX system for burning to CD or DVD. Additionally, for UDF DVD, burning cannot be put off or transferred to another system since no images are created that could be used for burning at a later date. Error message 0512-332 The error message: 0512-332 mkcd: Device /dev/cdx does not appear to be ready. For information about possible causes, see /usr/lpp/bos.sysmgt/mkcd.README.txt Continuing... Possible causes for this message: 1. There is no media in the drive. 2. The drive does not support AIX detecting whether it has media in it. 3. The drive does not support burning to media type in the drive. 4. The burn_cd command may fail. The mkcd command previously would have exited in the beginning under this condition, but now it will continue because some drives cannot be seen to have media in them. When mkcd is ready to do the actual burn to the media if there is media in the drive that it could not detect, it will proceed to write to the media. If no media is in the drive, there will be another prompt to put media in. Note: Yamaha CRW3200SX is one device we have seen that AIX could not detect media being present. The burn_cd command may fail the first attempt to write to DVD-RAM: burn_cd -d /dev/cd0 Error message: /usr/bin/readcd: Invalid argument. Cannot send SCSI cmd via ioctl. Suggested fix: Add the following line to the burn_cd script: >$MSGBUF 2>&1 <$DEVICE right before calling the readcd command. Use -a flag to create backups compatible with earlier AIX levels In AIX 5.3 the capability of storing named extended attributes was added in the JFS2 filesystem. Prior versions of AIX are not able to read backups of these filesystems. By default, mksysb, savevg, mkcd and mkdvd create backups that include these attributes. Therefore, to create backups that will be compatible to prior versions of AIX, include -a flag when using mksysb, savevg, mkcd or mkdvd. ISO9660 backup to DVD error "Cannot send SCSI cmd via ioctl" The latest IBM DVD drives require cdrecord 1.9-8 to successfully write ISO9660 backups to media. This is part of the cdrtools.base fileset installed on your system. Creating boot-only media There maybe circumstances where boot only media is needed for instance to perform maintenance or to install using non-bootable media. This boot media needs to match the level of system that maintenance is being performed on or the non-bootable install media being used. Therefore it is preferrable that the boot-only media have been created on the same system that maintenance is to be performed or that the non-bootable backup came from. Additionally, installp failure messages may appear toward the end of the install because installp is attempting to find additional software to install, but no additional software is on the boot-only media. These messages can be ignored. Execute the following to create boot-only media: 1. Create file /etc/exclude.rootvg using some editor (vi) and put the following line in it: ^./ 2. Execute the following command: # mkcd -e -d /dev/cdx # Where cdx is an attached cdwriter OR # mkcd -e -S # Will create a CD image which can be # transferred to a system with a cdwriter Note: The final mkcd command in the previous example makes an image that could be transferred to another system (AIX or non-AIX) for burning. Note: When bootable media is created, the boot image reflects the currently running kernel. If the current kernel is the 64-bit kernel, the media's boot image is also 64-bit, and it only boots 64-bit system. If the current kernel is a 32-bit kernel, the media's boot image is 32-bit, and it can boot both 32-bit and 64-bit systems. Why have we changed to use the current kernel? The 32-bit systems cannot boot using a 64-bit kernel. Additionally, there are some configurations that require the system to boot from the 64-bit kernel in order to install. To ensure that the backup will at least work on the system it came from, we create the boot image to reflect the kernel running at backup time. Backing up multiple directories To back up multiple directories, link the desired directories into a common directory and then give mkcd the common directory. For example, to backup /home/user1 and /home/user2, execute the following: # mkdir /home/tempdir # ln -s /home/user1 /home/tempdir/user1 # ln -s /home/user2 /home/tempdir/user2 # mkcd -r /home/tempdir -d /dev/cdx Note: Before executing the above, /usr/samples/oem_cdrwriters/mkrr_fs_gnu must be modified. This file should be linked to /usr/sbin/mkrr_fs unless some other vendors CD/DVD burning application is being used. The change involves having its mkisofs call modified to include the -f flag: $MKISOFS_PATH/mkisofs -f $UFLAG -r -o $OUTPUT_FILE $FS_NODE 2>$MSGBUF Boot image created from mksysb file Earlier releases of AIX created the boot image from the current system. Now, when using mkcd with the -m flag to specify an existing mksysb image, mkcd will create a boot image from the mksysb image file. This is done because the mksysb image's operating system level may not match the operating system level of the system the mksysb image resides on which could have resulted in backup media that is not installable. Additionally, this may increase the amount of time it takes for mkcd to execute depending on the size of mksysb image file. --- END OF DOCUMENT ---