Creating a Veritas Volume Manager volume from a plex

While cleaning up my Veritas VxVM notes this week, I came across one of my cheat sheets for creating volumes from plexes. This can be useful when you want to perform an offline backup of the data on an alternate server, or when you want to grab a spare copy of data prior to performing a major change. To create a new volume from a plex, you will first want to stash a copy of the vxprint output somewhere:

$ /usr/sbin/vxprint -hmQq > $HOME/vxprint.restore

Once you make a backup, you will want to run the human consumable form of vxprint to see which devices are available:

$ /usr/sbin/vxprint -hft

Disk group: oradg

DG NAME         NCONFIG      NLOG     MINORS   GROUP-I
ST NAME         STATE        DM_CNT   SPARE_CNT         APPVOL_CNT
DM NAME         DEVICE       TYPE     PRIVLEN  PUBLEN   STATE
RV NAME         RLINK_CNT    KSTATE   STATE    PRIMARY  DATAVOLS  SRL
RL NAME         RVG          KSTATE   STATE    REM_HOST REM_DG    REM_RLNK
CO NAME         CACHEVOL     KSTATE   STATE
VT NAME         NVOLUME      KSTATE   STATE
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO

dg oradg        default      default  10000    1127240283.19.winnie

dm c1t1d0       c1t1d0s2     auto     2048     35521408 -
dm c1t2d0       c1t2d0s2     auto     2048     35521408 -
dm c1t3d0       c1t3d0s2     auto     2048     35521408 -
dm c1t4d0       c1t4d0s2     auto     2048     35365968 -
dm c1t5d0       c1t5d0s2     auto     2048     35521408 -
dm c1t6d0       c1t6d0s2     auto     2048     35521408 -

v  oravol01     -            ENABLED  ACTIVE   20971520 SELECT    -        fsgen
pl oravol01-01  oravol01     ENABLED  ACTIVE   20971776 STRIPE    3/128    RW
sd c1t1d0-01    oravol01-01  c1t1d0   0        6990592  0/0       c1t1d0   ENA
sd c1t2d0-01    oravol01-01  c1t2d0   0        6990592  1/0       c1t2d0   ENA
sd c1t3d0-01    oravol01-01  c1t3d0   0        6990592  2/0       c1t3d0   ENA
pl oravol01-02  oravol01     ENABLED  ACTIVE   20971776 STRIPE    3/128    RW
sd c1t4d0-01    oravol01-02  c1t4d0   0        6990592  0/0       c1t4d0   ENA
sd c1t5d0-01    oravol01-02  c1t5d0   0        6990592  1/0       c1t5d0   ENA
sd c1t6d0-01    oravol01-02  c1t6d0   0        6990592  2/0       c1t6d0   ENA

After you locate the plex you want to turn intoa volume, you will need to disassociate it from the volume with the vxplex utility:

$ vxplex dis oravol01-02

Once the plex has been disassociated, you can then turn it into a volume with the vxmake utility:

$ vxmake -U gen vol oravol02 plex=oravol01-02

After the volume is created, you can start it and mount it just like all of the other volumes on your server:

$ vxvol start oravol02

$ mount -F vxfs /dev/vx/dsk/oradg/oravol02 /mnt

$ ls -la /mnt

total 8388690
drwxr-xr-x   3 root     root        8192 Oct 30 21:01 .
drwxr-xr-x  37 root     root        1024 Oct 27 12:27 ..
drwxr-xr-x   2 root     root          96 Oct 27 12:25 lost+found
-rw------T   1 root     root     1073741824 Oct 30 20:59 oradata01.dbf
-rw------T   1 root     root     1073741824 Oct 30 21:00 oradata02.dbf
-rw------T   1 root     root     1073741824 Oct 30 21:01 oradata03.dbf
-rw------T   1 root     root     1073741824 Oct 30 21:03 oradata04.dbf

This is a nifty feature, and now that Veritas Volume Manager and File System are free (thanks for the link CW!), you can test it out in your favorite lab!

Leave a Reply

Your email address will not be published. Required fields are marked *