La commande 'alt_disk_copy' est utilisée pour cloner le système 'rootvg' sur un ou plusieurs disques libres.

Cela a pour effet de faire un miroir complet à la date de la commande, utilisable comme un autre disque bootable AIX.

L'avantage de cette solution est qu'il permet de conserver une copie rapidement de tout le système et de repartir dessus sans avoir à attendre une restauration Mksysb.

Egalement possible avec cette commande, la mise à jour directe du système sur le clone, sans gêner la production, permettant ensuite un reboot rapide et un minimum de perte de productivité.

Enfin, la commande possède une options permettant de demander la transformation des systèmes de fichiers JFS en JFS2 durant la copie.

Un exemple de sauvegarde sur un disques 'hdisk1', sans modification de la bootlist :

/usr/sbin/alt_disk_copy -d hdisk1 -P'all' -z 'c' -z 'N' -z 'g' -z 'X' -z '' -z '' -z 'Y' -B

Le groupe de volume contenant ce clone se nomme 'altinst_rootvg'.

 

lorsque l'on reboot sur cette image, l'ancien OS se trouve dans le VG nommé 'old_rootvg'.

 

 

alt_disk_copy Command

Purpose

       Clones (makes a copy of) the currently running system to an alternate disk.

Syntax

       To copy rootvg to Alternate Disk:

       alt_disk_copy -d targetdisks... [-i image.data] [-s script [-b bundlename] [-I installpflags] [-l imageslocation] [-f fixbundle] [-F fixes] [-e excludelist]

       [-w filesets] [-n] [-P phaseoption] [-c console] [ -x first boot script ] [-R resolveconf] [-DBOVgrTS] [ -u ]

Description

       The alt_disk_copy command allows users to copy the current rootvg to an alternate disk and to update the operating system to the next maintenance or

       technology level, without taking the machine down for an extended period of time and mitigating outage risk. This can be done by creating a copy of the

       current rootvg on an alternate disk and simultaneously applying software updates. If needed, the bootlist command can be run after the new disk has been

       booted, and the bootlist can be changed to boot back to the older maintenance or technology level of the operating system.

       Cloning the running rootvg, allows the user to create a backup copy of the root volume group. This copy can be used as a back up in case the rootvg failed, or

       it can be modified by installing additional updates. One scenario might be to clone a 5300-00 system, and then install updates to bring the cloned rootvg to

       5300-01. This would update the system while it was still running. Rebooting from the new rootvg would bring the level of the running system to 5300-01. If

       there was a problem with this level, changing the bootlist back to the 5300-00 disk and rebooting would bring the system back to 5300-00. Other scenarios

       would include cloning the rootvg and applying individual fixes, rebooting the system and testing those fixes, and rebooting back to the original rootvg if

       there was a problem.

       At the end of the install, a volume group, altinst_rootvg, is left on the target disks in the varied off state as a place holder. If varied on, it indicates

       that it owns no logical volumes; however, the volume group does contain logical volumes, but they have been removed from the ODM because their names now

       conflict with the names of the logical volumes on the running system. Do not vary on the altinst_rootvg volume group; instead, leave the definition there as a

       placeholder.

       After rebooting from the new alternate disk, the former rootvg volume group shows up in a lspv listing as old_rootvg, and it includes all disks in the

       original rootvg. This former rootvg volume group is set to not vary-on at reboot, and it should only be removed with the alt_rootvg_op -X old_rootvg or

       alt_disk_install -X old_rootvg commands.

       If a return to the original rootvg is necessary, the bootlist command is used to change the bootlist to reboot from the original rootvg.

       Notes:

       1    Alternate disk operations create volume groups, logical volumes, special device files, and file systems using the alt prefix. If alt_disk_copy is

            utilized on a system, the administrator should avoid having or creating volume groups, logical volumes, special device files, or file systems with the

            alt, prefixalternate disk operations might inadvertently remove, alter, or damage these items.

       2    NIM alternate disk migration (upgrading version or release levels) is supported with the nimadm command. Please see the nimadm documentation for more

            details.

       3    The current LVM limit for logical volume names is 15 characters. Because the alternate disk installation commands prepend the 4-character alt_ prefix,

            the limit for the original logical volume names in the rootvg to be copied or installed is 11 characters. If an original logical volume name exceeds 11

            characters, it can be shortened by using a customized image.data (see the -i flag).

       4    When cloning the rootvg volume group, a new boot image is created with the bosboot command. If the /dev/ipldevice is removed or altered then the bosboot

            command will fail.

       5    Do not use direct LVM commands (such as exportvg, importvg, varyoffvg, or chlv) on alternate rootvg volume groups.

       6    This function is also available with the Network Installation Management (NIM). See the NIM Guide for more information.

       7    The alt_disk_copy command only backs up mounted file systems. Mount all file systems that you want to back up. The mksysb command backs up mounted

            journaled file systems (JFS) and enhanced journaled file systems (JFS2) in the rootvg. For more information about backing up file systems, see the mount

            command.

       8    If you are using the alt_disk_copy command to upgrade a system and the current level of the rootvg is prior to 6100-08 SP2 or 7100-02 SP2, install the

            bos.alt_disk_install.rte fileset at the level you are doing the upgrade to, on the original rootvg, before the alt_disk_copy operation. If you do not

            install the bos.alt_disk_install.rte fileset, error messages are displayed while creating the boot image in the alternate rootvg.

Flags

       Item

            Description

       -b bundlename

            Path name of optional file with a list of packages or filesets that are installed after a rootvg clone. The -l flag must be used with this option.

       -B

            Would specify not running bootlist after the mksysb or clone. If set, then the -r flag cannot be used.

       -c Console

            The device name to be used as the alternate rootvg's system console. This option is only valid with the -O flag.

       -d targetdisks

            Specifies a space-delimited list of the name or names of the target disks where the alternate rootvg will be created. However, when specifying multiple

            disks, the list must be enclosed in quotes (" "). These disks must not currently contain any volume group definition. The lspv command should show these

            disks as belonging to volume group None.

       -D

            Turns on debug (sets -x output).

       -e excludelist

            Optional exclude.list to use when cloning rootvg. The rules for exclusion follow the pattern-matching rules of the grep command. The excludelist must be

            a full path name.

            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 scratch directory, edit the exclude

            file to read as follows:

                     /scratch/

            For example, to exclude the contents of the /tmp directory, and avoid excluding any other directories that have /tmp in the path name, edit the exclude

            file to read as follows:

                     ^./tmp/

            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 the caret character (^) as the first character in the search string, followed by the 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

            the caret character followed by the dot character (^.) to indicate that the search should start at the beginning of the line, and use the dollar sign

            character ($) to indicate that the search should end at the end of the line.

       -f fixbundle

            Optional file with a list of APARs to install after a clone of rootvg. The -l flag must be used with this option.

       -F fixes

            Optional list of APARs (for example, IX123456) to install after a clone of rootvg. The -l flag must be used with this option.

       -g

            Skips disk bootability checks.

       -i image.data

            Optional image.data file to use instead of the default image.data file created from rootvg. The image.data file name must be a full path name (such as

            /tmp/my_image.data).

       -I installpflags

            The flags to use when updating or installing new filesets into the cloned altinst_rootvg. The default flag is -acgX. The -l flag must be used with this

            option.

       -l imageslocation

            Location of installp images or updates to apply after a clone of rootvg. This can be a directory full path name or device name (such as /dev/rmt0).

       -n

            Remain NIM client. The /.rhosts and /etc/niminfo files are copied to the file system of the alternate rootvg.

       -O

            Performs a device reset on the target altinst_rootvg. This causes the alternate disk install to not retain any user-defined device configurations. This

            flag is useful if the target disk or disks become the rootvg of a different system (such as in the case of logical partitioning or system disk swap).

       -P phases

            The phase or phases to execute during this invocation of alt_disk_copy. Valid values are: 1, 2, 3, 12, 23, or all (default).

              12

                   Performs phases 1 and 2.

              23

                   Performs phases 2 and 3.

              all

                   Performs all three phases.

       -r

            Specifies to reboot from the alternate disk when the alt_disk_copy command finishes.

       -R resolvconf

            The resolv.conf file to replace the existing one after the rootvg has been cloned. You must specify a full path name.

       -s script

            Optional customization script to run at the end of the mksysb install or the rootvg clone. This file must be executable. This script is called on the

            running system before the /alt_inst file systems are unmounted, so files can be copied from the running system to the /alt_inst file systems before the

            reboot.

       -S

            Indicates that you want to skip space-checking on target disks before you start performing the cloning or installation operations.

            Important : JFS2 file systems contain more metadata than JFS file systems. When you use the -S flag in conjunction with the -T flag, it skips space-

            checking. In this situation, it does not verify that there is enough space in the newly created JFS2 file system to store the contents of the file system

            plus the additional metadata.

       -T

            Indicates that you want to convert JFS file systems to JFS2 file systems during the process of recreating the rootvg volume group on target disks.

       -u

            Copies file systems that belong to a workload partition (WPAR) in the defined state in the alternate system.

            Note: To be included in the alternate disk, all file systems that belong to a WPAR in the defined state need to be in the rootvg volume group.

       -V

            Turn on verbose output. This shows the files that are being backed up for rootvg clones.

       -w filesets

            List of filesets to install after cloning a rootvg. The -l flag must be used with this option.

       -x script

            Optional customization script to run during the initial boot of the alternate rootvg, after all file systems are mounted.

Exit Status

       Item

            Description

       0

            All alt_disk_copy related operations completed successfully.

       >0

            An error occurred.

Examples

       1    To clone the running 5300-00 rootvg to hdisk3, then apply updates from /updates to bring the cloned rootvg to a 5300-01 level:

                 alt_disk_copy -d hdisk3 -F 5300-01_AIX_ML -l /updates

            The bootlist would then be set to boot from hdisk3 at the next reboot.

       2    To clone the running rootvg to hdisk3 and hdisk4, and execute update_all on all updates from /updates:

                 alt_disk_copy -d "hdisk3 hdisk4" -b update_all -l /updates

            The bootlist would then be set to boot from hdisk3 at the next reboot.

       3    To clone the running rootvg to hdisk1 and stop after phase 1:

                alt_disk_copy -d hdisk1 -P1

            Attention : Do not change the bootlist to use the cloned rootvg.

       4    To execute phases 2 and 3 on an existing alternate rootvg and reboot the system on successful completion:

               alt_disk_copy -d hdisk1 -P23 -r

       5    To clone the running system to hdisk1 and hdisk2, and to convert the file systems from JFS file systems to JFS2 file systems, run the following command:

            alt_disk_copy -B -T -d "hdisk1 hdisk2"

Location

       /usr/sbin/alt_disk_copy

Files

       Item

            Description

       /usr/sbin/alt_disk_copy

            Contains the alt_disk_copy command.  xxxx

 

icon phone
Téléphone/Whatsapp : +33 (0)6 83 84 85 74
icon phone