Archive for the ‘Veritas’ Category

Using vxmend to change plex status. from recover to Active

Friday, March 19th, 2010

Status=recover…… How to get it to active again ??

#vxmend –o force off plexname
Status=offline

#vxmend on plexname
Status=disabled / stale

#vxmend –g oracledg fix clean plexname
Status=disabled / clean

#vxvol start volname
Status=enabled / active

#fsck mountpoint
Verify status each time with #vxprint –rth

Adding Net-appliances disk to veritas

Friday, March 19th, 2010

1. Configure LUNS ont the Netapplicances device

2. Make sure solaris can see the disk
# format
3. Make sure veritas can see the disks
# vxdctl enable

4. When these type of disk is new for veritas

# vxddladm addjbod vid=NETAPP
# vxddladm listjbod
# vxdiskadm
18 allow multipathing
yes to continue
5 allow multipathing on all disks
all
yes
q
q need to do this …now he execute the correct commands.

# vxdisk list

Load balancing to active/active disk arrays.

Friday, March 19th, 2010

Solaris sees two paths to the same disk ( c2t8d0 and c3t8d0 )

To see both disk paths in solaris

# ls -las /dev/dsk/*t8do

Veritas creates only one metanode per LUN, this means that a disk with multipathing is seen as a single disk by the vxvm software.
To see the disk unique identifier (=serial number)

# /etc/vx/diag.d/vxdmpinq /dev/rdsk/c1t0d0s2

List the disks seen by veritas

# vxdisk list

To enable or disable paths use

# vxdiskadm

option 17. prevent multipathing

option 18. Allow multipathing

To list all controllers

# vxdmpadm listctlr all

To list the paths that are excluded

# vxdmpadm listexclude

To list subpaths to a specific controller to find out which devices are not functioning

# vxdmpadm getsubpaths ctrl=c1

To list all the paths for a disk

# vxdmpadm getsubpaths dmpnodename=c1t1d0s2

you will see that this disk is connected via c1 and c2

To see the disks names, how many paths there are, how many are disabled

# vxdmpadm getdmpnode enclosure=SENA0

To disable a paths

# vxdmpadm disable ctrl=c1

To verify status of all controllers

# vxdmpadm listctrl all

To enable a path again

# vxdmpadm enable ctrl=c1

To verify status do again

#vxdmpadm listctrl allow

! It will take 5 minutes before you see it is enabled again !

To speed this up do

# vxdctl enable

Adding disks to existing diskgroup and creating new volume

Friday, March 19th, 2010

1. Make sure solaris can see the disk.

# format
make sure the new disks are labeled by solaris ( use type “0″ = autodetect size , and label the disk !)

2. Make sure Veritas can see the new attached disk.

# vxdctl enable
(allow VxVM to discover newly added disks — DISKS NEED TO BE FORMATTED FIRST using the “format” COMMAND !!)

# vxdisk list
(will list disks detected, disks marked as “error” have not been initialized for use by VxVM)

3. Intitialise the disk in a specific diskgroup.

# vxdiskadm
1. option one to initialiase the disks in the oracledg diskgroup
make sure to use the list option so you can see that the disk is in error ( not yet initialised by veritas)

Or use the following commands:

( # /usr/lib/vxvm/bin/vxdisksetup -i c2t32d8 )
(# vxdg -g oracledg adddisk oracled01=c2t32d8 oracled02=c2t32d9)

4. Find out how much space is available on these new disks.

# vxassist -g oracledg maxsize oracled01 oracled02
`
(gets maximum size available for creating volume on specific disks )
( suppose resulting number is 28000000 )

# vxassist -g oracledg make newvol 28000000 stripeunit=48k columns=2 oracled01 oracled02
(creates volume u01vol of 28GB size using only oracled01 and oracled02 disks in a stripe layout)

# mkfs -F vxfs -o largefiles,bsize=8192 /dev/vx/rdsk/oracledg/u01vol
(create filesystem with largefile option necessary to create datafiles bigger than 2g)

# vi /etc/vfstab
(add filesystem so it is auto-mounted)

# mount /newvol

# df -k
verify new filesystem size.

Expand a volume in VxVM from command line

Friday, March 19th, 2010

1. Make sure solaris can see the disk.

# df -k
verify the current size of the filesystem /u11 you want to grow
# format
make sure the new disks are labeled by solaris ( use type “0″ = autodetect size , and label the disk !)

2. Make sure Veritas can see the new attached disk.

# vxdctl enable
(allow VxVM to discover newly added disks — DISKS NEED TO BE FORMATTED FIRST using the “format” COMMAND !!)

# vxdisk list
(will list disks detected, disks marked as “error” have not been initialized for use by VxVM)

3. Intitialise the disk in a specific diskgroup.

# vxdiskadm
1. option one to initialiase the disk in the oracledg diskgroup
make sure to use the list option so you can see that the disk is in error ( not yet initialised by veritas)

Or use the following commands:

( # /usr/lib/vxvm/bin/vxdisksetup -i c2t32d8 )
(# vxdg -g oracledg adddisk oracled01=c2t32d8 oracled02=c2t32d9)

4. Find out how much space is available on these new disks.

# vxassist -g oracledg maxgrow vol_u11 oracled01 oracled02
` Volume vol_u12 can be extended by 57675776 to 314105856 (153372Mb)
(gets maximum size available for resizing volume on specific disks)

# vxassist -g oracledg growby vol_u11 57675776 oracled01 oracled02
(extends the volume as a stripe on these 2 extra disks)

NOTE sometimes you get error
vxvm:vxassist: WARNING: dm:oracle16: No disk space matches specification
vxvm:vxassist: WARNING: dm:oracle17: No disk space matches specification

(I believe this to be some sort of rounding error, because afterward the volume is extended !)

# vxresize -g diskgroup volumename +2g

This will make the filesystem 2 g bigger

# vxprint -vt
Disk group: oracledg

V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX UTYPE

v backupvol – ENABLED ACTIVE 135254016 SELECT – fsgen
v ftpvol – ENABLED ACTIVE 6291456 SELECT – fsgen
v swapvol – ENABLED ACTIVE 28444672 SELECT – fsgen
v vol_u01 – ENABLED ACTIVE 55078912 SELECT – fsgen
v vol_u11 – ENABLED ACTIVE 314109952 SELECT vol_u11-01 fsgen
v vol_u12 – ENABLED ACTIVE 314105856 SELECT vol_u12-01 fsgen
v vol_u13 – ENABLED ACTIVE 58720256 SELECT – fsgen

# /opt/VRTSvxfs/sbin/fsadm -b 314109952 /u11
File system will be increased.

# df -k
verify new filesystem size.

Moving populated disks out of rootdg or moving rootdg to another system

Friday, March 19th, 2010

First, moving populated disks between diskgroups.
Get a list of disks in the diskgroup that you intend to move the populated disks out of.
# vxdisk list | grep rootdg

Get the configuration of the diskgroup.
# vxprint -ht -g rootdg

Determine which disks contain the volumes that are to be moved.

Save the configuration of the desired volumes in a format that can be used later by vxmake to recreate the volumes. Specify all volumes on the disks in question, plus any unassociated plexes and their child subdisks, plus any unassociated subdisks.
# vxprint -hmQq -g rootdg vol01 vol02 vol03 > /tmp/volinfo

Unmount the appropriate filesystems, and/or stop any processes holding the volumes open.

Stop all the volumes.
# vxvol -g rootdg stop vol01 vol02 vol03

Remove from the configuration database the definitions of the structures ( (volumes, plexes, subdisks) to be moved. NOTE that this does not affect your data.
# vxedit -g rootdg -r rm vol01 vol02 vol03

Remove the disks from the original diskgroup.
# vxdg -g roodg rmdisk rootdg01 rootdg02 rootdg03 rootdg04

If you are moving the disks to a preexisting diskgroup, SKIP THIS STEP. If not, initialize the diskgroup using one of your disks. It is simplest to keep the old disk names until a later step.
# vxdg init newdg rootdg01=c1t2d0s2

Add the disks to their new disk group. It is simplest to keep the old disk names until a later step.
# vxdg -g newdg adddisk rootdg02 rootdg03 rootdg04

Verify that the disks are in their new diskgroup.
# vxdisk list | grep newdg

Reload the object configuration into the new diskgroup.
# vxmake -g newdg -d /tmp/volinfo

Verify the configuration of the new diskgroup.
# vxprint -ht -g newdg

Test your data.

Second, moving rootdg between systems.

Get the diskgroup ID (dgid) of rootdg from the old host.
# vxdisk -s list
(example)

Disk: c1t5d0s2type: slicedflags: online ready private autoconfig autoimport importeddiskid: 824180434.4523.csclust2dgname: rootdgdgid: 824180442.4528.csclust2hostid: csclust1 Disk: c1t9d0s2type: slicedflags: online ready private autoconfig autoimport importeddiskid: 824180440.4525.csclust2dgname: rootdgdgid: 824180442.4528.csclust2hostid: csclust1 Disk: c1t13d0s2type: slicedflags: online ready private autoconfig autoimport importeddiskid: 830532975.3418.csclust1dgname: rootdgdgid: 824180442.4528.csclust2hostid: csclust1

Shutdown the old host, remove the disks, and connect the disks to the new host.

Import the diskgroup with its new name, assigning ownership of the diskgroup to the new host, using the dgid for the diskgroup name.
# vxdg -C -n newdg import 824180442.4528.csclust2

Perform the necessary steps to make the new host and VxVM recognize the new disks. I.e. perform the steps necessary to make the OS see the disks, and then perform a ‘vxdctl enable’ to restart vxconfigd so that VxVM also recognizes the disks.

Start all volumes in the diskgroup.
# vxrecover -g newdg -sb

Configuring rootdg on a slice

Monday, January 25th, 2010

Use this procedure if you want to create a rootdg diskgroup on a single slice.

Remember that rootdg is needed for Volume Manager to start the daemons.

After this procedure vxinstall is no longer needed. Use vxdiskadm to create other diskgroups.

1. Install the software packages for Veritas Volume Manager.

2. Configure the slice as a virtual disk in the diskgroup rootdg
# vxconfigd -m disable (to kill the vxconfigd)
# vxdctl init (to initialise VxVm database)
# vxdg init rootdg (to create rootdg)
# vxdctl add disk c0t0d0s7 type=simple (IGNORE THE WARNING : Not in configuration database)
# vxdisk -f init c0t0d0s7 type=simple (to add a disk record)
# vxdg adddisk c0t0d0s7 (make a slice into a virtual disk)
# vxdctl enable (reread config in memory)
# rm /etc/vx/reconfig.d/state.d/install-db (remove placeholder file for vxinstall)

3. Reboot or restart daemons manually.

# init 6

4.Create other diskgroups with vxdiskadm

# vxdiskadm