Using splitvg in AIX to make a copy of a volume group

Technote (FAQ)


Question

How do I use splitvg to make a copy of a volume group I can back up?

Answer

Start with a volume group mirrored across an even number of disks:

# lsvg -l zzvg
zzvg:
LV NAME            TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
zzlv               jfs        2       4       2    closed/syncd  /zzfs
loglv03            jfslog     1       2       2    open/stale    N/A

Note: the mirrored disks of each logical volume must be in the same columns, or splitvg will fail with the following error:

0516-1359 splitvg: The mirror specified to split the volume group must exists on a disk or
set of disks that contains nothing but this mirror.
0516-1355 splitvg: Unable to split the volume group.

# lslv -m zzlv
zzlv:/zzfs
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0129 hdisk16           0193 hdisk18
0002  0130 hdisk16           0194 hdisk18

# lslv -m loglv03
loglv03:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0131 hdisk16           0195 hdisk18

So in this case we have hdisk16 in the PV1 column, and hdisk18 in PV2 for both logical volumes.

Then split it off to a new volume group:

# splitvg -y newvg zzvg

# lsvg
rootvg
zzvg
newvg

# lsvg -l zzvg
zzvg:
LV NAME            TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
zzlv               jfs        2       4       2    closed/syncd  /zzfs
loglv03            jfslog     1       2       2    closed/syncd  N/A

# lsvg -l newvg
newvg:
LV NAME            TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
fszzlv             jfs        2       2       1    closed/syncd  /fs/zzfs
fsloglv03          jfslog     1       1       1    closed/syncd  N/A

Now you can mount your new mount points /fs/zzfs and back up the data.

To rejoin the vg again, which will remirror and synchronize with the new data that has been written to the original zzvg, use:

# joinvg zzvg

# lsvg -l zzvg
zzvg:
LV NAME            TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
zzlv               jfs        2       4       2    closed/syncd  /zzfs
loglv03            jfslog     1       2       2    open/stale    N/A

So they are remirrored, but not synchronized yet.

# syncvg -v zzvg

# lsvg -l zzvg
zzvg:
LV NAME            TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
zzlv               jfs        2       4       2    closed/syncd  /zzfs
loglv03            jfslog     1       2       2    closed/syncd  N/A

NOTES:

1. If you do not provide a new volume group name using the "-y" option to splitvg, the new split-off snapshot vg will be called by a generic name "vgXX", where "XX" is numerical, starting at 00.

2. Splitvg really uses recreatevg behind the scenes, which is why the new logical volume and filesystem mount point names are the same that recreatevg produces.

3. The split-off logical volume will be prefixed with "fs". Note that for a generic JFS2 logical volume, which are named "fslvXX" this can get confusing, as they will be renamed "fsfslvXX".

4. To allow the split-off filesystems to be mounted, the mount points have been prefixed with "/fs". The /etc/filesystems file will also have been updated with this mount point information:

/fs/zzfs:
        dev             = /dev/fszzlv
        vfs             = jfs
        log             = /dev/fsloglv03
        mount           = false
        check           = false
        options         = rw
        account         = false

5. While the volume group is split, it still looks like a mirrored vg. However any updates to it will result in stale logical volumes.

For example, if you mount the original filesystem and copy some data into it, the logical volume and JFSlog logical volume go stale:

# lsvg -l zzvg
zzvg:
LV NAME            TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
zzlv               jfs        2       4       2    open/stale    /zzfs
loglv03            jfslog     1       2       2    open/stale    N/A

This is because the mirror is still associated with the original volume group, even when split off to a temporary new volume group. Using splitvg -i to create an independent volume group will not have this same effect.


Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

AIX family

Software version:

5.2, 5.3, 6.1

Operating system(s):

AIX

Reference #:

T1010934

Modified date:

2012-12-03

Translate my page

Machine Translation

Content navigation