HPlogo HP-UX Reference > D

drd-clone(1M)

HP-UX 11i Version 2: December 2007 Update
» 

Technical documentation

 » Table of Contents

 » Index

NAME

drd-clone: drd — clone mode clones the root volume group

SYNOPSIS

drd clone [-?] [-p] [-q]... [-v]... -t target_device_file [-x option=value] [-x -?] [-X option_file]

DESCRIPTION

The drd clone command creates a copy of the LVM volume group or VxVM disk group containing the root file system (/). In particular, it creates a new group, creates a volume in the new group for each volume in the root group, configures swap and dump volumes, and copies the contents of each file system in the root group to the corresponding file system in the new group.

Options

drd clone recognizes the following options:

-?

Displays the usage message.

-p

Sets preview mode. See also -x preview, in the Extended -x Options section below.

-q

Decreases the verbosity level by one each time it is specified. For the interaction with -x verbosity, see the Extended -x Options section below.

-t device_special_file

Specifies the block device special file of a single physical disk on which the cloned system image is to be written. The block device special file must exist on the system and be writeable. All data previously on the disk will be unavailable after a clone operation. See also -x overwrite, in the Extended -x Options section below.

-v

Increases the verbosity level by one each time it is specified. For the interaction with -x verbosity, see the Extended -x Options section below.

-x -?

Displays the list of possible -x (extended) options.

-x option=value

Sets the extended option to a value. See the Extended -x Options section below.

-X option_file

Gets the extended options from a file. See drd(1M) for an explanation of the format and an example of an option file.

Extended -x Options

drd clone recognizes the following -x (extended) options. If a default value exists, it is shown in bold.

-x ignore_unmounted_fs=false

Usage: Basic

Controls whether a clone fails when an unmounted file system in the root volume group is detected.

-x logfile=/var/opt/drd/drd.log

Usage: Basic

This is the path to the log file for this command. Each time DRD is run, this file will grow larger. This can be changed, for example, to a month-specific location for easier archiving, off-host backup, and rotation.

-x log_verbosity=4

Usage: Basic

Specifies the level of message verbosity in the log file. (See also -x verbosity.) Legal values are:

0

Saves only ERROR messages and the starting/ending BANNER messages.

1

Adds WARNING messages.

2

Adds NOTE messages.

3

Adds INFO messages (informational messages preceded by the * character).

4

Adds verbose INFO messages.

5

Adds very-verbose INFO messages.

-x mirror_disk=mirrordisk

Usage: Basic

The block device special file of the mirror disk of the target. The device special file mirrordisk, should refer to an entire disk, not to a partition. This option requires that LVM mirroring be installed. The block device file specified will be used to mirror each logical volume in the target of the clone operation.

-x overwrite=false

Usage: Basic

Controls whether or not a disk containing boot, LVM, or VxVM records can be overwritten. Note that DRD will not overwrite a disk associated with an active LVM volume group or VxVM disk group, regardless of the setting of the overwrite option. If a previously created clone is mounted, use the drd umount command to unmount it before attempting to create a new clone on the disk.

true

Allow a disk to be overwritten, even if it contains boot, LVM, or VxVM records.

false

Prevent a disk that contains boot, LVM, or VxVM records from being overwritten.

-x preview=false

Usage: Basic

If true, run this command in preview mode only (that is, complete the analysis phase and exit; do not commit changes to disk). Setting this option to true has the same effect as specifying -p on the command line.

-x verbosity=3

Usage: Basic

Specifies the level of standard error verboseness. Legal values are:

0

Display only ERROR messages and the starting/ending BANNER messages.

1

Adds WARNING messages.

2

Adds NOTE messages.

3

Adds INFO messages (informational messages preceded by the * character).

4

Adds verbose INFO messages.

5

Adds very-verbose INFO messages.

See also the -v and -q options in the Options section above. The -v option increases the verbosity by 1 (for example, from 3 to 4) and the -q option decreases the verbosity by 1. The -v and -q options can be given more than once. Multiples can be merged, as in -qq.

For example, if both -x verbosity=5 and -qqq are included on the command line, the effective verbosity is 2. The minimum combined verbosity level is 0.

For example, if both -x verbosity=1 and -vv are included on the command line, the effective verbosity is 3. The maximum combined verbosity level is 5.

The Source

The source for the drd clone command — the group that is copied — is the group containing the root file system (/).

Choosing a Target Disk

The target disk must be specified as a block device file. An appropriate target disk should be writeable by the system, not currently in use by other applications, and large enough to hold a copy of each logical volume in the root group.

The physical disk need not be as large as the disk allocated for the root group as long as there is sufficient space for a copy of each volume in the root group. However, the disk will need to be bigger than the used space in each volume, since each volume will be created with the number of physical extents currently allocated to the corresponding root volume.

The HP System Management Homepage (see hpsmh(1M)) or System Administration Manager (see sam(1M)) can be used to investigate the disks on the system and their current usage.

Alternatively, the following command-line utilities may be useful in determining an appropriate target disk:

  • The command ioscan -fknC disk can be used to determine the physical disks on the system. See ioscan(1M).

  • Commands from various volume managers and applications can be used to determine the current usage of disks on the system. For example, vgdisplay -v displays the disks currently in use by the LVM volume manager, usually labeled with the identifier PV Name. See vgdisplay(1M). Similarly, the command vxdisk -o alldgs list can be used to display information about all disks managed by VxVM. See vxdisk(1M).

  • The command swapinfo can be used to display information about the disks that are currently used for swap. See swapinfo(1M).

Depending on the applications in use on the system, further checks may be needed to ensure that disks are not in use. For example, any "raw" disks in use by databases may need to be identified.

Note: It is the administrator's responsibility to determine which disks are not currently in use and may therefore be used for a clone of the root group.

The drd clone command itself will perform the following checks:

  • If the disk is currently in use by the LVM volume manager, it will be rejected by drd clone.

  • If the disk is currently in use by the VxVM volume manager, it will only be accepted as a drd clone target if the disk is an inactive image managed by DRD and the extended option -x overwrite=true is specified.

  • If the disk is not currently in use by LVM or VxVM, but contains LVM, VxVM, or boot records, it will only be accepted as a drd clone target if -x overwrite=true is specified.

For further information on choosing a target disk for a clone operation, see the Dynamic Root Disk Administrator's Guide (see the SEE ALSO section).

The Target Volume Manager

The target volume manager must be the same as the source volume manager.

  • If the source group is an LVM volume group of the form vgnn, the clone is imported with the volume group name drdnn and booted with the original volume name vgnn. For example, if vg00 is cloned, the clone is imported as drd00 and booted as vg00.

  • If the source group is an LVM volume group not of the form vgnn, the clone is imported with a volume group name formed by prefixing the source group with drd_.

  • If the source group is a VxVM volume group not beginning with drd_, the clone is imported and booted with a volume group name formed by prefixing the source group with drd_.

  • If the source group is a VxVM volume group beginning with drd_, the clone is imported and booted with a volume group name formed by removing the prefix drd_.

The DRD Log

The DRD log resides at /var/opt/drd/drd.log. During any DRD operation, the DRD log is written to the booted system. In addition, since the log is part of the /var file system, it is copied by the drd clone command to the target of the drd clone operation. Since the file systems on the clone are unmounted before the log has been completely written, the DRD log file on the target of a drd clone operation will be truncated. The messages following the truncated clone log will be those from the first drd operation run on the clone after it is booted.

RETURN VALUE

drd clone returns one of the following values:

0

Success.

1

Error.

2

Warning.

EXAMPLES

To display usage for the drd clone command:

drd clone -?

To clone the root LVM volume group or VxVM disk group to a physical device:

  • For 11i v2:

  • drd clone -t /dev/dsk/c1t1d0

  • For 11i v3:

    drd clone -t /dev/disk/disk1

To preview the clone of the root LVM volume group or VxVM disk group to a physical device:

  • For 11i v2:

  • drd clone -p -t /dev/dsk/c1t15d0

  • For 11i v3:

    drd clone -p -t /dev/disk/disk7

To display all drd clone extended options:

drd clone -x -?

AUTHOR

drd was developed by HP.

FILES

/var/opt/drd/drd.log

Log file.

SEE ALSO

drd(1M), drd-activate(1M), drd-deactivate(1M), drd-mount(1M), drd-runcmd(1M), drd-umount(1M), ioscan(1M), swapinfo(1M), vgdisplay(1M), vxdisk(1M)

Dynamic Root Disk Administrator's Guide, available on the HP Technical Documentation web site at http://docs/hp.com/en/DRD.