Posts Tagged ‘rootdg’

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