La commande 'recreatevg' est bien utile pour ouvrir un groupe de volume contenant des LV et FS déja connus du système.

En effet, cette commande permet de rajouter des extensions ou préfixes sur le nom des LVs et FS, de manière à pouvoir accéder au groupe de volume, même si celui-ci contient un clone ou une copie d'objets déja ouverts sur le système actuel.

Par exemple, après avoir fait une Flash-copy d'un disque contenant un VG, vous pouvez vérifier la copie en utilisant la commande 'recreatevg'

La syntaxe de base est la suivante en V5.3 :

Usage: recreatevg [ -y VGname ] [ -p ] [ -f ] [ -Y lv_prefix | -l LvNameFile ] [ -L label_prefix ] [ -n ] PVname...
Recreates a volume group that is already existing on the specified set of disks.

Il suffit de donner un nom de VG, n'importe lequel tant qu'il n'existe pas sur le système actuel, un préfixe pour le LV( avec NEW,  le lv01 deviendra NEWlv01) et un préfixe pour le nom de FS( /database peut devenir /NEWdatabase)

Ainsi, vous aurez /database et /NEWdatabase montés au même moment et vous pourrez comparer les fichiers.

 

DOCUMENTATION IBM VVV

recreatevg Command

Purpose

Recreates a volume group that already exists on a specified set of disks. Imports and varies on the volume group.

Syntax

recreatevg [ -y VGname ] [ -p ] [ -f ] [ -Y Lv_Prefix | -l LvNameFile ] [ -L Label_Prefix ] [ -n ] PVname...

Description

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:
1    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).
2    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.
3    The recreatevg command fails if the input list does not match the list compiled from the Volume Group Descriptor Area (VGDA).
4    The set of disks in the list must have consistent VGDA data. The recreatevg command does not fix VGDA problems.
5    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.

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.
-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.

Security

Access Control: You must have root authority to run this command.

Examples
1    To recreate a volume group that contains three physical volumes, type:

recreatevg hdisk1 hdisk2 hdisk3

The volume group on hdisk1, hdisk2, and hdisk3 is recreated with an automatically generated name, which is displayed.
2    To recreate a volume group on hdisk1 with the new name testvg, type:

recreatevg -y testvg hdisk1
3    To recreate a volume group on hdisk14, recreate all logical volumes in that volume group, and rename them with the prefix newlv, type:

recreatevg -Y newlv hdisk14

Files

/usr/sbin
Directory where the recreatevg command resides.

Related Information

The chvg command, chlv command.

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