Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Storage Foundation 5.0

Created: 12 Feb 2013 | 7 comments
xor's picture

Hi,

I need some help with VxVM volumes

I have been requested to restore some data from disks in a volume group

This was how it looked like before

v  lvol4a       -            ENABLED  ACTIVE   2537355264 ROUND   -        gen
pl lvol4a-01    lvol4a       ENABLED  ACTIVE   2537355264 CONCAT  -        RW
sd disk32-01    lvol4a-01    disk32   0        1006534400 0       xiv0_38  ENA
sd disk33-01    lvol4a-01    disk33   0        1006534400 1006534400 xiv0_39 ENA
sd disk35-01    lvol4a-01    disk35   0        524286464 2013068800 xiv0_42 ENA
pl lvol4a-02    lvol4a       ENABLED  ACTIVE   2537355264 CONCAT  -        RW
sd TMP1-01   lvol4a-02    TMP1  0        1019148544 0       xiv0_40  ENA
sd TMP2-01   lvol4a-02    TMP2  0        1308491520 1019148544 xiv0_41 ENA
sd TMP1-02   lvol4a-02    TMP1  1019148544 209715200 2327640064 xiv0_40 ENA
 

Then the volume was deleted as below

vxedit -g DISKGROUP001  -rf rm  lvol4a

And recreated with same name and plex

vxmake -g DISKGROUP001 vol lvol4a plex=lvol4a-01
 

Now it looks like this..

v  lvol4a       -            ENABLED  ACTIVE   2537355264 ROUND   -        gen
pl lvol4a-01    lvol4a       ENABLED  ACTIVE   2537355264 CONCAT  -        RW
sd disk32-01    lvol4a-01    disk32   0        1006534400 0       xiv0_38  ENA
sd disk33-01    lvol4a-01    disk33   0        1006534400 1006534400 xiv0_39 ENA
sd disk35-01    lvol4a-01    disk35   0        524286464 2013068800 xiv0_42 ENA

 Now I need to mount the data from these disks. which are siting the the VG and are not associated anywhere

disk01      auto:cdsdisk    TMP1      DISKGROUP001  online
disk02      auto:cdsdisk    TMP2      DISKGROUP001  online

 So

1> has there been any loss data as a result of deleting and recreating volume  lvol4a

2> If there is no data loss can I have the below as a spererate volume (vol_tmp) and mount the volume 2 )

 pl lvol4a-02    lvol4a       ENABLED  ACTIVE   2537355264 CONCAT  -        RW
sd TMP1-01   lvol4a-02    TMP1  0        1019148544 0       xiv0_40  ENA
sd TMP2-01   lvol4a-02    TMP2  0        1308491520 1019148544 xiv0_41 ENA
sd TMP1-02   lvol4a-02    TMP1  1019148544 209715200 2327640064 xiv0_40 ENA
 

they dont exist in the VG only below dm exists 

dm TMP1      disk01      auto     65536    1274937088 -
dm TMP2      disk02      auto     65536    1308491520 -
 

 

Discussion Filed Under:

Comments 7 CommentsJump to latest comment

Yasuhisa Ishikawa's picture

If you can recreate a volume with exactly same layout, data on the volume will not be lost.

It is same for 2nd, but it is hard to recreate subdisks, plexes from scratch.
Recovering entire voluem configuration is not so difficult. So, it is better to recover config from config backup or information stored in private region usign vxprivutil. Then detach lvol4a-02 from lvol4a, create new volume, and attach lvol4a-02 to it.

For now, I have no lab machine for Storage Foundation, and I can not provide detail steps, sorry.

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

Yasuhisa Ishikawa's picture

If you keep TMP disks connected while these operations, private region is updated with current layout, so vxprivutil can not be used in this scenario.

 

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

TonyGriffiths's picture

As Yasuhisa mentioned, the process of removing a volume does not remove the actual on-disk data. In theory if nothing has CHANGED on-disk AND you can create the volume/plex/subdisk to map the same data space, then the original data should be available.

Going back to you example, you mentioned you used the command below, which would remove volumes, plexes and subdisks

vxedit -g DISKGROUP001  -rf rm  lvol4a

Therefore you would not be able to make the volume using the command specficied (below) as the plex would nort have existed

vxmake -g DISKGROUP001 vol lvol4a plex=lvol4a-01
 

I can only assume that you used additional commands to build the volume, plex and subdisks.

Is the goal to split out the plexes manually so that you have two copies of the data in two volumes ?

cheers

tony

Yasuhisa Ishikawa's picture

POC here. I tried with SFHA 6.0.1 on RHEL 5. manual creation of each object is too hard to regular operation. You should do it only if you have accidentaly remove the volume, and there are no other recovery option.
If you are just planning to create replica, you should choose other options VxVM provide for such purpose like Flashsnap.

[root@sfha1 ~]# vxprint -g datadg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg datadg       datadg       -        -        -        -        -       -

dm sdb          sdb          -        8314624  -        -        -       -
dm sdc          sdc          -        8314624  -        -        -       -
dm sdd          sdd          -        8314624  -        -        -       -
dm sde          sde          -        8314624  -        -        -       -

v  vol0         fsgen        ENABLED  16627712 -        ACTIVE   -       -
pl vol0-01      vol0         ENABLED  16627712 -        ACTIVE   -       -
sd sdb-01       vol0-01      ENABLED  8314624  0        -        -       -
sd sdd-01       vol0-01      ENABLED  8313088  8314624  -        -       -
pl vol0-02      vol0         ENABLED  16627712 -        ACTIVE   -       -
sd sdc-01       vol0-02      ENABLED  8314624  0        -        -       -
sd sde-01       vol0-02      ENABLED  8313088  8314624  -        -       -
[root@sfha1 ~]# df -h /misc
Filesystem            Size  Used Avail Use% Mounted on
/dev/vx/dsk/datadg/vol0
                      8.0G   21M  7.5G   1% /misc
[root@sfha1 ~]# touch /misc/foo
[root@sfha1 ~]# touch /misc/bar
[root@sfha1 ~]# ls -l /misc
total 0
-rw-r--r-- 1 root root  0 Feb 13 17:45 bar
-rw-r--r-- 1 root root  0 Feb 13 17:45 foo
drwxr-xr-x 2 root root 96 Feb 13 17:44 lost+found
[root@sfha1 ~]# umount /misc
[root@sfha1 ~]# vxedit -g datadg -fr rm vol0
[root@sfha1 ~]# vxprint -g datadg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg datadg       datadg       -        -        -        -        -       -

dm sdb          sdb          -        8314624  -        -        -       -
dm sdc          sdc          -        8314624  -        -        -       -
dm sdd          sdd          -        8314624  -        -        -       -
dm sde          sde          -        8314624  -        -        -       -
[root@sfha1 ~]#
[root@sfha1 ~]# vxassist -g datadg make vol0 maxsize layout=concat sdb sdd
[root@sfha1 ~]# vxprint
Disk group: datadg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg datadg       datadg       -        -        -        -        -       -

dm sdb          sdb          -        8314624  -        -        -       -
dm sdc          sdc          -        8314624  -        -        -       -
dm sdd          sdd          -        8314624  -        -        -       -
dm sde          sde          -        8314624  -        -        -       -

v  vol0         fsgen        ENABLED  16627712 -        ACTIVE   -       -
pl vol0-01      vol0         ENABLED  16627712 -        ACTIVE   -       -
sd sdb-01       vol0-01      ENABLED  8314624  0        -        -       -
sd sdd-01       vol0-01      ENABLED  8313088  8314624  -        -       -
[root@sfha1 ~]# mount -t vxfs /dev/vx/dsk/datadg/vol0 /misc
[root@sfha1 ~]# ls -l /misc
total 0
-rw-r--r-- 1 root root  0 Feb 13 17:45 bar
-rw-r--r-- 1 root root  0 Feb 13 17:45 foo
drwxr-xr-x 2 root root 96 Feb 13 17:44 lost+found
[root@sfha1 ~]# umount /misc
[root@sfha1 ~]# vxassist -g datadg make vol1 maxsize layout=concat sdc sde
[root@sfha1 ~]# vxprint
Disk group: datadg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg datadg       datadg       -        -        -        -        -       -

dm sdb          sdb          -        8314624  -        -        -       -
dm sdc          sdc          -        8314624  -        -        -       -
dm sdd          sdd          -        8314624  -        -        -       -
dm sde          sde          -        8314624  -        -        -       -

v  vol0         fsgen        ENABLED  16627712 -        ACTIVE   -       -
pl vol0-01      vol0         ENABLED  16627712 -        ACTIVE   -       -
sd sdb-01       vol0-01      ENABLED  8314624  0        -        -       -
sd sdd-01       vol0-01      ENABLED  8313088  8314624  -        -       -

v  vol1         fsgen        ENABLED  16627712 -        ACTIVE   -       -
pl vol1-01      vol1         ENABLED  16627712 -        ACTIVE   -       -
sd sdc-01       vol1-01      ENABLED  8314624  0        -        -       -
sd sde-01       vol1-01      ENABLED  8313088  8314624  -        -       -
[root@sfha1 ~]# mount -t vxfs /dev/vx/dsk/datadg/vol1 /misc
[root@sfha1 ~]# ls -l /misc
total 0
-rw-r--r-- 1 root root  0 Feb 13 17:45 bar
-rw-r--r-- 1 root root  0 Feb 13 17:45 foo
drwxr-xr-x 2 root root 96 Feb 13 17:44 lost+found
[root@sfha1 ~]# umount /misc
[root@sfha1 ~]#



[root@sfha1 ~]# vxprint -ht
Disk group: datadg

DG NAME         NCONFIG      NLOG     MINORS   GROUP-ID
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         RVG          KSTATE   STATE    NVOLUME
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
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
SR NAME         KSTATE

dg datadg       default      default  15000    1360744993.17.sfha1

dm sdb          sdb          auto     65536    8314624  -
dm sdc          sdc          auto     65536    8314624  -
dm sdd          sdd          auto     65536    8314624  -
dm sde          sde          auto     65536    8314624  -

v  vol0         -            ENABLED  ACTIVE   16627712 SELECT    -        fsgen
pl vol0-01      vol0         ENABLED  ACTIVE   16627712 CONCAT    -        RW
sd sdb-01       vol0-01      sdb      0        8314624  0         sdb      ENA
sd sdd-01       vol0-01      sdd      0        8313088  8314624   sdd      ENA
pl vol0-02      vol0         ENABLED  ACTIVE   16627712 CONCAT    -        RW
sd sdc-01       vol0-02      sdc      0        8314624  0         sdc      ENA
sd sde-01       vol0-02      sde      0        8313088  8314624   sde      ENA
[root@sfha1 ~]#
[root@sfha1 ~]# vxmake -g datadg sd sdb-01 len=8314624 offset=0 sdb
[root@sfha1 ~]# vxmake -g datadg sd sdd-01 len=8313088 offset=0 sdd
[root@sfha1 ~]# vxmake -g datadg plex vol0-01 layout=concat
[root@sfha1 ~]# vxsd -g datadg assoc vol0-01 sdb-01
[root@sfha1 ~]# vxsd -g datadg assoc vol0-01 sdd-01
[root@sfha1 ~]# vxmake -g datadg vol vol0 len=16627712
[root@sfha1 ~]# vxplex -g datadg att vol0 vol0-01
[root@sfha1 ~]# vxprint -hqt
Disk group: datadg

dg datadg       default      default  15000    1360744993.17.sfha1

dm sdb          sdb          auto     65536    8314624  -
dm sdc          sdc          auto     65536    8314624  -
dm sdd          sdd          auto     65536    8314624  -
dm sde          sde          auto     65536    8314624  -

v  vol0         -            DISABLED EMPTY    16627712 ROUND     -        gen
pl vol0-01      vol0         DISABLED EMPTY    16627712 CONCAT    -        RW
sd sdb-01       vol0-01      sdb      0        8314624  0         sdb      ENA
sd sdd-01       vol0-01      sdd      0        8313088  8314624   sdd      ENA
[root@sfha1 ~]# vxvol -g datadg init clean vol0
[root@sfha1 ~]# vxvol -g datadg start vol0
[root@sfha1 ~]# mount -t vxfs /dev/vx/dsk/datadg/vol0 /misc
[root@sfha1 ~]# ls -l /misc
total 0
-rw-r--r-- 1 root root  0 Feb 13 17:45 bar
-rw-r--r-- 1 root root  0 Feb 13 17:45 foo
drwxr-xr-x 2 root root 96 Feb 13 17:44 lost+found
[root@sfha1 ~]# umount /misc
[root@sfha1 ~]#
[root@sfha1 ~]# vxmake -g datadg sd sdc-01 len=8314624 offset=0 sdc
[root@sfha1 ~]# vxmake -g datadg sd sde-01 len=8313088 offset=0 sde
[root@sfha1 ~]# vxmake -g datadg plex vol1-01 layout=concat
[root@sfha1 ~]# vxsd -g datadg assoc vol1-01 sdc-01
[root@sfha1 ~]# vxsd -g datadg assoc vol1-01 sde-01
[root@sfha1 ~]# vxmake -g datadg vol vol1 len=16627712
[root@sfha1 ~]# vxplex -g datadg att vol1 vol1-01
[root@sfha1 ~]# vxprint -hqt
Disk group: datadg

dg datadg       default      default  15000    1360744993.17.sfha1

dm sdb          sdb          auto     65536    8314624  -
dm sdc          sdc          auto     65536    8314624  -
dm sdd          sdd          auto     65536    8314624  -
dm sde          sde          auto     65536    8314624  -

v  vol0         -            ENABLED  ACTIVE   16627712 ROUND     -        gen
pl vol0-01      vol0         ENABLED  ACTIVE   16627712 CONCAT    -        RW
sd sdb-01       vol0-01      sdb      0        8314624  0         sdb      ENA
sd sdd-01       vol0-01      sdd      0        8313088  8314624   sdd      ENA

v  vol1         -            DISABLED EMPTY    16627712 ROUND     -        gen
pl vol1-01      vol1         DISABLED EMPTY    16627712 CONCAT    -        RW
sd sdc-01       vol1-01      sdc      0        8314624  0         sdc      ENA
sd sde-01       vol1-01      sde      0        8313088  8314624   sde      ENA
[root@sfha1 ~]#
[root@sfha1 ~]# vxvol -g datadg init clean vol1
[root@sfha1 ~]# vxvol -g datadg start vol1
[root@sfha1 ~]# mount -t vxfs /dev/vx/dsk/datadg/vol1 /misc
[root@sfha1 ~]# ls -l /misc
total 0
-rw-r--r-- 1 root root  0 Feb 13 17:45 bar
-rw-r--r-- 1 root root  0 Feb 13 17:45 foo
drwxr-xr-x 2 root root 96 Feb 13 17:44 lost+found
[root@sfha1 ~]# umount /misc

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

xor's picture

Actual I want to create these plex subdisk which have been deleted by while deleting vol lvol4a  above

pl lvol4a-02    lvol4a       ENABLED  ACTIVE   2537355264 CONCAT  -        RW
sd TMP1-01   lvol4a-02    TMP1  0        1019148544 0       xiv0_40  ENA
sd TMP2-01   lvol4a-02    TMP2  0        1308491520 1019148544 xiv0_41 ENA
sd TMP1-02   lvol4a-02    TMP1  1019148544 209715200 2327640064 xiv0_40 ENA
 

As you can see that the plex (lvol4a-2) and associated subdisks were not created when the vol lvol4a was created again

So the objective is to re-create them from the below disks which are the only objects present in the

VG at the moment as the plex and subdisks were deleted

dm TMP1      disk01      auto     65536    1274937088 -
dm TMP2      disk02      auto     65536    1308491520 -
So what command I need to create lvol4a-2 (plex), subdisk's TMP1-01, TMP2-01, TMP1-02 into any new volume say vol_new.

Then I should be able to mount the volume (vol_new) device as vxfs filesystem and need the data all intact

xor's picture

So the objective is data on these disks are needed and the file/dir need to be availble. So need the volume and associated devices created so that I can mount as vxfs filesystem and make data available

dm TMP1      disk01      auto     65536    1274937088 -
dm TMP2      disk02      auto     65536    1308491520 -
 

 

mikebounds's picture

Commands would be:

 

vxmake -g datadg sd TMP1-01 len=1019148544 offset=0 TMP1
vxmake -g datadg sd TMP2-01 len=1308491520 offset=0 TMP2
vxmake -g datadg sd TMP1-02 len=209715200 offset=1019148544 TMP1
vxmake -g datadg plex vol_new-01 layout=concat
vxsd -g datadg assoc vol_new-01 TMP1-01
vxsd -g datadg assoc vol_new-01 TMP2-01
vxsd -g datadg assoc vol_new-01 TMP1-02
vxmake -g datadg vol vol_new len=2537355264
vxplex -g datadg att vol_new vol_new-01
vxvol -g datadg init clean vol_new
vxvol -g datadg start vol_new
The order of the vxsd commands are important as this affects the offsets in the plex.  I have used plex name vol_new-01 as this is the convention used for plexes, but you can call it lvol4a-2 if you want, if for example you are planning to join it back to volume lvol4a at some point.
 
As these commands create the plex where it was originally, the data should remain intact so you can then mount as normal.  
 
Mike

 

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below