Wednesday, April 21, 2010

Solaris : Veritas Volume Manager : Root Mirroring




Recommendations:
1. The disk which holds the Solaris Operating System and the disk where the
operating system is to be mirrored could be with same geometry.
2. Copy the /etc/system file and /etc/vfstab file as a precaution before
initiating the changes.


Condition:

1. The disk (which has the operating system) and the disk going to have the
mirror should be brought under the control of volume manager only with
Sliced layout.
2. Here the disk had been brought under the volume manager control as mentioned
above under the disk group named “ rootdg”
3. We have to bring the disk (which has the operating system) under the control
of volume manager through Encapsulation. This is done to preserve the data,
contained in the disk.


Output: Before bringing the disk under the volume manager control:



bash-3.00# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:none - - online invalid
c1t1d0s2 auto:none online invalid
c2t3d0s2 auto:simple - - online invalid
c2t5d0s2 auto:cdsdisk oradg1 oradg online
c2t9d0s2 auto:cdsdisk oradg2 oradg online
c2t10d0s2 auto:cdsdisk oradg3 oradg online
c2t12d0s2 auto:cdsdisk oradg4 oradg online



Steps followed:

# cp /etc/system /etc/system.orig.bkp
# cp /etc/vfstab /etc/vfstab.orig.bkp
# vxdiskadm

Choose the option: 2
Used to bring the disk under volume manager control through encapsulation. This utility will guide us, while bringing the disk under volume control bring it with Sliced layout, under the group “rootdg”.

Initially the disk group named “rootdg” will not exist. Create the same at time of initiating the disk.

Once the disk ( OS disk ) is brought under the control of volume manager, it requires to restart the system twice.

Once the system is restarted, we can observe the changes to the file /etc/system and /etc/vfstab.


Output : /etc/vfstab (After restarting the system twice)

bash-3.00# cat /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/vx/dsk/bootdg/swapvol - - swap - no nologging
/dev/vx/dsk/bootdg/rootvol /dev/vx/rdsk/bootdg/rootvol / ufs 1 no nologging
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -
#/dev/dsk/c1t1d0s3 /dev/rdsk/c1t1d0s3 /mnt/veritas ufs - yes -
#NOTE: volume rootvol (/) encapsulated partition c1t0d0s0
#NOTE: volume swapvol (swap) encapsulated partition c1t0d0s1

Note:
1. rootvol and swapvol should exist in the disk group that is chosen to be boot disk group.(Also, with name rootvol and swapvol, volumes can be created on other disk groups.) Only the rootvol and swapvol in bootdg can be used to boot the system.

2. bootdg is an alias for the disk group that contains the volumes that are used to boot the system.

3. Volume manager sets bootdg to the appropriate disk group, if it takes the control of the root disk.
Otherwise, bootdg is set to nodg (no disk group).

We can observe the changes by executing
# vxprint –vt


We have to bring the next disk under the volume manager control as above with sliced layout either by using
# vxdiskadm utility

or by executing

# vxdisksetup –i c1t1d0 format=sliced



Note:
Here system has to be restarted twice.


Output: After bringing both the disk under the disk group (rootdg) with sliced layout.

bash-3.00# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:sliced rootdg01 rootdg online
c1t1d0s2 auto:sliced rootdg02 rootdg online
c2t3d0s2 auto:simple - - online invalid
c2t5d0s2 auto:cdsdisk oradg1 oradg online
c2t9d0s2 auto:cdsdisk oradg2 oradg online
c2t10d0s2 auto:cdsdisk oradg3 oradg online
c2t12d0s2 auto:cdsdisk oradg4 oradg online



# vxmake –g rootdg mirror rootvol
will mirror the root.
The sync status can be observed in another terminal by executing
# vxtask list


This takes some time sync.

or

# vxmirror –g rootdg –a
This command, mirrors all existing volumes for the specified disk group.


Note:
# vxmirror
1. Provides a mechanism to mirror all non-mirrored volumes, that are located on
a specified disk, to mirror all currently non-mirrored volumes in the
specified disk group.
2. To change or display the current defaults for mirroring
3. All volumes that have only a single plex (mirror copy), are mirrored by
adding additional plex.
4. Volumes containing sub-disks that reside on MORE THAN ONE DISK ARE NOT
MIRRORED by this vxmirror command.



Similarly to mirror the swap,
# vxmake –g rootdg mirror swapvol



Outputs: After mirroring the root
bash-3.00# df -h

Filesystem size used avail capacity Mounted on
/dev/vx/dsk/bootdg/rootvol
5.8G 5.3G 465M 93% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 2.0G 1.6M 2.0G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
5.8G 5.3G 465M 93% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
5.8G 5.3G 465M 93% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
swap 2.0G 120K 2.0G 1% /tmp
swap 2.0G 40K 2.0G 1% /var/run
swap 2.0G 0K 2.0G 0% /dev/vx/dmp
swap 2.0G 0K 2.0G 0% /dev/vx/rdmp




bash-3.00# vxprint -s
Disk group: rootdg

TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
sd rootdg01-B0 swapvol-01 ENABLED 1 0 - - Block0
sd rootdg01-01 swapvol-01 ENABLED 4097330 1 - - -
sd rootdg01-02 rootvol-01 ENABLED 12288402 0 - - -
sd rootdg02-01 rootvol-02 ENABLED 12288402 0 - - -
sd rootdg02-02 swapvol-02 ENABLED 4097331 0 - -



bash-3.00# vxprint -p
Disk group: rootdg

TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
pl rootvol-01 rootvol ENABLED 12288402 - ACTIVE - -
pl rootvol-02 rootvol ENABLED 12288402 - ACTIVE - -
pl swapvol-01 swapvol ENABLED 4097331 - ACTIVE - -
pl swapvol-02 swapvol ENABLED 4097331 - ACTIVE - -



bash-3.00# vxprint -v
Disk group: rootdg

TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
v rootvol root ENABLED 12288402 - ACTIVE - -
v swapvol swap ENABLED 4097331 - ACTIVE -



Note:
The image published here in this page - Sun E4500

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Pls post the VXVM basic admins documents

    ReplyDelete
  3. Hai can u post veritas encapsulation steps in intel machine.I tried but filed to create mirror see my below o/p


    # vxencap -c -f sliced -g rootdg d0=c0d0
    VxVM vxencap ERROR V-5-2-4159
    Disk c0d0 is a root disk;
    Disk cannot be encapsulated.


    -----------my o/s is solaris 10 x86-64 bit veritas verison is 4.1

    ReplyDelete