vxcp_lvmroot(1M) VxVM 3.5 vxcp_lvmroot(1M)
1 Dec 2002
NAME [Toc] [Back]
vxcp_lvmroot - copy LVM root disk onto new VERITAS Volume Manager root
disk
SYNOPSIS [Toc] [Back]
/etc/vx/bin/vxcp_lvmroot [-m mirror_root_da_name]
[-R percent] [-v] [-b] [-D] new_root_da_name
/etc/vx/bin/vxcp_lvmroot [-m mirror_root_da_name]
[-p Pool_1,Pool_2,Pool_3,Pool_4,...]
[-v] [-b] [-D] new_root_da_name
DESCRIPTION [Toc] [Back]
The vxcp_lvmroot command copies (or "clones") the volumes associated
with an LVM root volume group to volumes of equal size (unless the -R
option is specified) on a VxVM root disk group.
VxVM rootability means that VxVM controls the disk containing the root
file system. The vxcp_lvmroot command provides a means of achieving
VxVM rootability when upgrading from a prior release of HP-UX without
having to use Ignite_UX to perform a cold install.
In the first form of the command shown in the SYNOPSIS, the single
specified disk is initialized as a VxVM disk, and the volumes in a
single physical volume LVM root volume group are copied to that disk.
The second form of the vxcp_lvmroot command copies a multiple disk LVM
root volume group. This form of the command also supports striped
volumes. The -p option is used to specify a list of additional disks
that are required to copy a multiple disk LVM root volume group.
Before commencing copying, vxcp_lvmroot determines the number of disks
that are required. If insufficient disks are specified, vxcp_lvmroot
displays how many disks are needed, and then exits with an error.
vxcp_lvmroot performs the following additional checks on the specified
disks:
+ The total size used by the LVM volumes is computed for each
physical volume (that is, each physical source disk).
+ The size of each specified disk is determined and required VxVM
overhead space is subtracted from it. The size of each source
disk that is to be copied is compared with that of the target
disk assigned to the copy.
+ Each specified disk is checked to make sure it is not in use as
an LVM, VxVM, or raw disk with mounted file systems.
Once all the checks are satisfied, the new disks are given VxVM disk
media (DM) names. The root disks (that is, the disk or disks
containing the root file system), are given names of the form
- 1 - Formatted: January 24, 2005
vxcp_lvmroot(1M) VxVM 3.5 vxcp_lvmroot(1M)
1 Dec 2002
rootdisk##, and other disks are named rootaux##. Here ## is a number
starting at 01 that creates a unique disk name.
If VxVM has not yet been enabled using vxinstall, vxcp_lvmroot enables
it before initializing the new disks for VxVM use.
Volumes named rootvol, swapvol and dumpvol are generated to correspond
to the root, swap and dump (if any) volumes. The names of other
volumes on the new root disk are generated by concatenating the name
of the mount point below / with vol (for example, usrvol would be the
volume that corresponds to /usr).
When the VxVM root disk volumes have been made, the data from each LVM
volume is copied to the equivalent VxVM volume. For volumes
containing file systems, the copy is performed using the cpio command.
For volumes that do not contain file systems, the data is copied using
the dd command. An exception to this rule is the swap volume, which
has 256KB of random data written to it to make it consistent. Note:
To distinguish this action from copying, it is termed "cloning" in the
verbose message output.
To minimize disk arm movement, volume copies are performed serially in
the foreground. To ensure that no data corruption has occurred during
copying, the fsck command is run on each freshly populated file
system.
After all of the volumes have been copied, the vxbootsetup command is
run on the new root disk to set it up as a bootable VxVM disk under
HP-UX. Once this is complete, the root and stand file systems on the
new disk are temporarily mounted, and the following files updated to
reflect the new environment:
+ /etc/fstab on the new root file system is updated to reflect the
paths to the block device nodes that correspond to the VxVM
volumes. The old information about mounting LVM volumes is
preserved at the end of the file in comment lines.
+ The device nodes from /dev/vx on the original LVM root disk are
regenerated on the new root file system. This is necessary
because not all of the volumes on the new root disk had been
created when the root volume was copied.
+ /stand/bootconf is regenerated in the new stand file system. The
contents of this file define the path of the block device node
corresponding to the new root disk, for example:
l /dev/dsk/c1t5d0
- 2 - Formatted: January 24, 2005
vxcp_lvmroot(1M) VxVM 3.5 vxcp_lvmroot(1M)
1 Dec 2002
+ /stand/rootconf is regenerated to reflect the starting position
and length of the new VxVM root volume. This file is required
during expert recovery using HP-UX Maintenance Mode Boot (MMB)
mode.
+ The startup script files /sbin/pre_init_rc and /sbin/ioinitrc are
checked to determine if they invoke the appropriate commands that
allow VxVM rootability to function. If there is no reference to
these commands, the scripts are edited to enable this
functionality. Copies of the original files are saved as
/sbin/pre_init_rc.orig and /sbin/ioinitrc.orig.
After successfully configuring the new VxVM root disk configuration,
vxcp_lvmroot runs the setboot command to specify the disk,
new_root_da_name, as the primary boot device in NVRAM before exiting.
OPTIONS [Toc] [Back]
-b Invokes the setboot(1M) command to change the primary and
alternate boot device settings. The primary boot device is
set to the newly cloned VxVM root device. If the -m option
is also specified, the alternate boot device is set to the
root mirror. If the -m option is not specified, the
alternate boot device is set to the LVM root from which the
VxVM root was cloned. If the -v is also specified,
information on the settings for the primary and alternate
boot devices is displayed.
-D Uses the vxdump(1M) and vxrestore(1M) commands to copy VxFS
file systems, and the dump(1M) and restore(1M) commands to
copy HFS file systems.
The default method of copying file systems is to use the
find(1M) and cpio(1M) commands. However, if one or more of
the file systems to be copied contain files with "holes"
(that is, files that appear to be very large, but which are
sparse and contain very little storage), this may exceed the
capability of the target file system to copy the files using
find and cpio. One symptom of this condition is to receive
a "file system full" indication on the target file system
while copying. (Whereas the find and cpio commands assume
that a file's size correctly represents the storage
required, the vxdump, vxrestore, dump and restore commands
copy a sparse file as it appears in the source file system.)
If a "file system full" condition is indicated for one of
the target file systems, start vxcp_lvmroot again with the
-D option specified.
- 3 - Formatted: January 24, 2005
vxcp_lvmroot(1M) VxVM 3.5 vxcp_lvmroot(1M)
1 Dec 2002
Note: the vxdump, vxrestore, dump and restore commands are
not well suited for running from a shell script. If you
interrupt the script (for example, by pressing Ctrl-C),
these commands prompt you to ask whether you really want to
continue or abort. The output from the dump commands is
verbose and so is redirected to a file. As this redirection
would hide any continue/abort prompt, and make the program
appear to hang, the interrupt signal is temporarily disabled
while the copy is in progress (a message to this effect is
displayed if the -v option is specified).
-m mirror_root_da_name
Creates a mirrored root disk using the specified device name
(disk access name) of a physical disk. This disk must have
the same attributes as the disk specified by
new_root_da_name.
-p Pool_1,Pool_2,Pool_3,Pool_4,...
Specifies a list of disks that are to be used to satisfy
requirements for extra disks when copying multiple disk LVM
root volume groups. Disks specified in this pool are used
for copying contiguous volumes that do not reside on the
root disk, as well as for copying stripe columns when
striped volumes exist in the LVM root volume group. If the
-m option is specified, any mirrors of the volumes are
directed to disks from this pool.
The disks are specified as a comma-separated list of device
names (disk access names). These disks are checked for
existence, correct size, and availability for use.
-R percent
Reduces the space requirements of the target disk by the
specified percentage.
If the target disk has less space than the original LVM root
disk, it is not possible to create VxVM volumes with the
same size as the original LVM volumes. This option takes
advantage of the fact that most file systems are nowhere
near full. Each file system on the source disk is checked
for space usage and the target volume size is reduced by the
specified percentage if the resulting file system would not
be more than 80% full.
Note: Only volumes containing file systems are reduced in
size.
The minimum and maximum values for the percentage size
reduction, percent, that may be specified are 10 and 60
respectively.
- 4 - Formatted: January 24, 2005
vxcp_lvmroot(1M) VxVM 3.5 vxcp_lvmroot(1M)
1 Dec 2002
-v Outputs verbose messages including a timestamp that
indicates major operations being performed. Since copying
the data on a root disk can take a considerable amount of
time, this gives an indication of the progress being made.
ARGUMENTS [Toc] [Back]
new_root_da_name
Specifies the device name (disk access name) of the physical disk
that is to become the VxVM root disk.
EXAMPLES [Toc] [Back]
This example shows the vxcp_lvmroot command invoked in its simpliest
form:
/etc/vx/bin/vxcp_lvmroot c5t1d0
The next example also creates a root mirror on disk c6t1d0:
/etc/vx/bin/vxcp_lvmroot -m c6t1d0 c5t1d0
The -R option may be used to reduce the size of volumes containing
file systems on the target disk by a specified percentage. The next
example specified a size reduction of 30%. The -v option is also
specified to provide a verbose listing of the changes made to the file
system sizes (edited here for clarity):
# /etc/vx/bin/vxcp_lvmroot -v -b -R 30 c5t1d0
vxcp_lvmroot 17:31:
Gathering information on the current VxVM root configuration
vxcp_lvmroot 17:31:
Checking specified disk(s) for usability
vxcp_lvmroot 17:31:
Preparing disk c5t1d0 as a VxVM disk
vxcp_lvmroot 17:31:
Adding disk c5t1d0 to rootdg as DM rootdisk01
vxcp_lvmroot 17:31:
Copying /dev/vg01/lvol1 (hfs) to /dev/vx/dsk/rootdg/standvol
vxcp_lvmroot 17:31:
standvol size of 323 MB, reduced from lvol1 size of 512
vxcp_lvmroot 17:31:
Cloning /dev/vg01/lvol2 (swap) to /dev/vx/dsk/rootdg/swapvol
vxcp_lvmroot 17:32:
Copying /dev/vg01/lvol3 (vxfs) to /dev/vx/dsk/rootdg/rootvol
vxcp_lvmroot 17:32:
rootvol size of 352 MB, reduced from lvol3 size of 512
vxcp_lvmroot 17:34:
Copying /dev/vg01/lvol4 (vxfs) to /dev/vx/dsk/rootdg/homevol
vxcp_lvmroot 17:34:
homevol size of 347 MB, reduced from lvol4 size of 512
- 5 - Formatted: January 24, 2005
vxcp_lvmroot(1M) VxVM 3.5 vxcp_lvmroot(1M)
1 Dec 2002
vxcp_lvmroot 17:34:
Copying /dev/vg01/lvol5 (vxfs) to /dev/vx/dsk/rootdg/optvol
vxcp_lvmroot 17:34:
optvol size of 1391 MB, reduced from lvol5 size of 2048
vxcp_lvmroot 17:39:
Copying /dev/vg01/lvol6 (vxfs) to /dev/vx/dsk/rootdg/tmpvol
vxcp_lvmroot 17:39:
tmpvol size of 173 MB, reduced from lvol6 size of 256
vxcp_lvmroot 17:39:
Copying /dev/vg01/lvol7 (vxfs) to /dev/vx/dsk/rootdg/usrvol
vxcp_lvmroot 17:58:
Copying /dev/vg01/lvol8 (vxfs) to /dev/vx/dsk/rootdg/varvol
vxcp_lvmroot 17:58:
varvol size of 2788 MB, reduced from lvol8 size of 4096
vxcp_lvmroot 18:02:
Setting up disk c5t1d0 as a boot disk
vxcp_lvmroot 18:03:
Installing fstab and fixing dev nodes on new root FS
vxcp_lvmroot 18:03: Current setboot values:
vxcp_lvmroot 18:03: Primary: 0/4/0/0.13.0
vxcp_lvmroot 18:03: Alternate: 0/0/6/0/0.0.0
vxcp_lvmroot 18:03:
Making c5t1d0 (0/4/0/0.1.0) the primary boot disk
vxcp_lvmroot 18:03:
Making c5t13d0 (0/4/0/0.13.0) the alternate boot disk
vxcp_lvmroot 18:03:
Disk c5t1d0 is now a VxVM rootable boot disk
The following example shows how to specify a disk pool to copy volumes
from an LVM root disk that contains multiple disk contiguous volumes,
including striped volumes, across 4 column stripes:
vxcp_lvmroot -v -p c5t5d0,c5t8d0,c5t9d0 c5t4d0
The next example demonstrates how to copy and mirror an LVM root disk
that has 4 column stripes:
vxcp_lvmroot -v -p c5t5d0,c5t8d0,c5t9d0,ct11d0,c5t12d0,c5t13d0 \
-m c5t10d0 c5t4d0
NOTES [Toc] [Back]
The use of the -v (verbose) option is encouraged. Copying the data
from the LVM root volume group to VxVM volumes is a lengthy operation.
The -v option indicates progress of the operation as each volume is
being copied. If the -v option is not specified, the vxcp_lvmroot
command is silent for the duration of the volume copy operation, which
usually takes more than 30 minutes.
- 6 - Formatted: January 24, 2005
vxcp_lvmroot(1M) VxVM 3.5 vxcp_lvmroot(1M)
1 Dec 2002
If the vxcp_lvmroot command aborts for any reason, or if you interrupt
the command during execution (unless this is inhibited by the -D
option), an attempt is made to clean up the VxVM objects that had been
generated up to the time of the abort or interruption. All volumes
that had already been copied, or that were in the process of being
copied when the interruption occurred, are removed. All Data Media
(DM) objects that were created are also removed. If a volume or a DM
object cannot be removed, an explanatory message is displayed.
SEE ALSO [Toc] [Back]
cpio(1), dd(1), dump(1M), fsck(1M), restore(1M), setboot(1M),
vxbootsetup(1M), vxdump(1M), vxrestore(1M)
- 7 - Formatted: January 24, 2005 [ Back ] |