Recreates a volume group that already exists on a specified set of disks. Imports and varies on the volume group.
recreatevg [ -y VGname ] [ -p ] [ -f ] [ -Y Lv_Prefix | -l LvNameFile ] [ -L Label_Prefix ] [ -n ] [-V MajorNumber ] [ -d ] PVname...
The recreatevg command recreates a volume group on a set of disks that are duplicated from another set of disks belonging to a specific volume group. This command overcomes the problem of duplicated Logical Volume Manager (LVM) data structures and identifiers caused by a disk duplication process. This command allocates new physical volume identifiers (PVID) for the member disks, as the PVIDs are also duplicated by the disk duplication. Similarly, duplicated logical volume members are given new names with the user-specified prefixes.
Notes:
- The recreatevg command removes all logical volumes that fully or partially exist on the physical volumes that are not specified on the command line. Mirrored logical volumes can be an exception (see the -f flag).
- The recreatevg command gives a warning if the log logical volume for a file system does not exists on the disks specified on the command line.
- The recreatevg command fails if the input list does not match the list compiled from the Volume Group Descriptor Area (VGDA).
- The set of disks in the list must have consistent VGDA data. The recreatevg command does not fix VGDA problems.
- When recreating a concurrent-capable volume group, the volume group will not be varied on when the recreatevg command completes. The new volume group must be varied on manually.
Item | Description |
---|---|
-d | Changes the PVID of the cloned disk and stores it in volume group of the descriptor area. You must use the -d flag with -y or -p flags. |
-f | Recreates a volume group (VG) from a subset of disks. Only
those disks and the logical volumes (LVs) that reside entirely on
this subset of disks will be present in the recreated VG. All other
disks and LVs from the original VG will be deleted in the recreated
VG. For mirrored LVs, only LV mirror copies with physical partitions allocated on the deleted disks will be removed. Therefore, a mirrored LV can be recreated with fewer mirror copies, but only when at least one of those copies resides entirely on the subset of disks. |
-l LvNameFile | Changes logical volume names to the name specified by LvNameFile. Entries must be in the format LV:NEWLV1. All logical volumes that are not included in LvNameFile are recreated with default system generated names. NEWLV1 name may be the same as LV name in the LvNameFile stanza (LV:NEWLV1) to leave the logical volume with the same name. |
-L Label_Prefix | Changes the labels of logical volumes on the VG being recreated to this prefix. You must modify the /etc/filesystems stanza manually if a simple modification of the mount point is not enough to define the stanza uniquely. Specifying / (slash) as the Label_Prefix, will leave the label in the logical volume unchanged. |
-n | Specifies that after recreatevg the volume group is imported but varied off. Default is imported and vary on. |
-p | Disables the automatic generation of the new PVIDs. If the -p flag is used, you must ensure that there are no duplicated PVIDs on the system. All the disks that are hardware mirrored must have their PVIDs changed to a unique value. |
-V MajorNumber | Allows the major number of the volume group to be specified rather than having the major number generated automatically. |
-y VGname | Allows the volume group name to be specified rather than having the name generated automatically. Volume group names must be unique system wide and can range from 1 to 15 characters. The name cannot begin with a prefix already defined in the PdDv class in the Device Configuration database for other devices. The new volume group name is sent to standard output. |
-Y Lv_Prefix | Causes the logical volumes on the volume group being recreated to be renamed with this prefix. The total length of the prefix and the logical volume name must be less than or equal to 15 characters. If the length exceeds 15 characters, the logical volume is renamed with a default name. The name cannot begin with a prefix already defined in the PdDv class of the Device Configuration Database, nor be a name already used by another device. Specifying NA as the Lv_Prefix, will leave all the logical volume names unchanged. |
Access Control: You must have root authority to run this command.
recreatevg hdisk1 hdisk2 hdisk3
The
volume group on hdisk1, hdisk2, and hdisk3 is recreated with an automatically
generated name, which is displayed.recreatevg -y testvg hdisk1
recreatevg -Y newlv hdisk14
Item | Description |
---|---|
/usr/sbin | Directory where the recreatevg command resides. |