There are several mirrored configurations that are not recommended for the cluster Sun Cluster environment. For example, mirroring across the same disk or within the same tray is unsafe.
The following procedure is one method of adding disks to a disk group.
You may find that the CVM software offers many ways to produce the same result. Choose the method with which you feel the most comfortable.
There are now five disk groups in your cluster system, with two disks in each of the disk groups.
To inventory your disk resources, enter:
# vxdisk list |
For example, presume that the command shows there are two free disks, c1t0d1 and c2t0d1.
Initialize the disks.
# /etc/vx/bin/vxdisksetup -i c1t0d1 # /etc/vx/bin/vxdisksetup -i c2t0d1 |
Add disks into an existing disk group:
The command syntax is:
# vxdg -g disk_group_name adddisk devices ... |
For the present example, the command is:
# vxdg -g acct adddisk c1t0d1 c2t0d1 |
View the new expanded disk group.
The command syntax is:
# vxprint -g disk_group_name |
For the present example, the command would be:
# vxprint -g acct TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg acct acct - - - - - - dm c1t0d0 c1t0d0s2 - 2050272 - - - - dm c1t0d1 c1t0d1s2 - 2050272 - - - - dm c2t0d0 c2t0d0s2 - 2050272 - - - - dm c2t0d1 c2t0d1s2 - 2050272 - - - - v vol01 gen ENABLED 1024000 - ACTIVE - - pl vol01-01 vol01 ENABLED 1024128 - ACTIVE - - sd c1t0d0-01 vol01-01 ENABLED 1024128 0 - - - pl vol01-02 vol01 ENABLED 1024128 - ACTIVE - - sd c2t0d0-01 vol01-02 ENABLED 1024128 0 - - - |
Create mirrored volumes.
# vxassist make vol_name length disk_name # vxassist mirror vol_name disk_name |
# vxassist make newvol 100m c1t0d1 # vxassist mirror newvol c2t0d1 |
To move a disk between disk groups, remove the disk from one disk group and add it to the other.
For example, to move the physical disk c1t0d1 from disk group acct to disk group log_node1:
Determine if the disk is in use:
# vxprint -g acct TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg acct acct - - - - - - dm c1t0d0 c1t0d0s2 - 2050272 - - - - dm c1t0d1 c1t0d1s2 - 2050272 - - - - dm c2t0d0 c2t0d0s2 - 2050272 - - - - dm c2t0d1 c2t0d1s2 - 2050272 - - - - v newvol gen ENABLED 204800 - ACTIVE - - pl newvol-01 newvol ENABLED 205632 - ACTIVE - - sd c1t0d1-01 newvol-01 ENABLED 205632 0 - - - pl newvol-02 newvol ENABLED 205632 - ACTIVE - - sd c2t0d1-01 newvol-02 ENABLED 205632 0 - - - v vol01 gen ENABLED 1024000 - ACTIVE - - pl vol01-01 vol01 ENABLED 1024128 - ACTIVE - - sd c1t0d0-01 vol01-01 ENABLED 1024128 0 - - - pl vol01-02 vol01 ENABLED 1024128 - ACTIVE - - sd c2t0d0-01 vol01-02 ENABLED 1024128 0 - - - |
Remove the volume to free up the c1t0d1 disk:
# vxedit -g acct -fr rm newvol |
The -f option forces an operation. The -r option makes the operation recursive.
Remove the c1t0d1 disk from the acct disk group:
# vxdg -g acct rmdisk c1t0d1 |
Add the c1t0d1 disk to the log_node1 disk group:
# vxdg -g log_node1 adddisk c1t0d1 |
This procedure does NOT save the configuration or data on the disk.
This is the acct disk group after c1t0d1 is removed.
# vxprint -g acct TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg acct acct - - - - - - dm c1t0d0 c1t0d0s2 - 2050272 - - - - dm c2t0d0 c2t0d0s2 - 2050272 - - - - dm c2t0d1 c2t0d1s2 - 2050272 - - - - v vol01 gen ENABLED 1024000 - ACTIVE - - pl vol01-01 vol01 ENABLED 1024128 - ACTIVE - - sd c1t0d0-01 vol01-01 ENABLED 1024128 0 - - - pl vol01-02 vol01 ENABLED 1024128 - ACTIVE - - sd c2t0d0-01 vol01-02 ENABLED 1024128 0 - - - |
This is the log_node1 disk group after c1t0d1 is added.
# vxprint -g log_node1 TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg log_node1 log_node1 - - - - - - dm c1t0d1 c1t0d1s2 - 2050272 - - - - dm c1t3d0 c1t3d0s2 - 2050272 - - - - dm c2t3d0 c2t3d0s2 - 2050272 - - - - # |
To change permissions or ownership of volumes, you must use the vxedit command.
Do not use chmod or chgrp. The permissions and/or ownership set by chmod or chgrp are automatically reset to root during a reboot.
Here is an example of the permissions and ownership of the volumes vol01 and vol02 in the directory /dev/vx/rdsk before a change.
# ls -l crw------- 1 root root nnn,nnnnn date time vol01 crw------- 1 root root nnn,nnnnn date time vol02 ... |
This an example for changing the permissions and ownership for vol01.
# vxedit -g group_name set mode=755 user=oracle vol01 |
After the edit, note how the permissions and ownership have changed.
# ls -l crwxr-xr-x 1 oracle root nnn,nnnnn date time vol01 crw------- 1 root root nnn,nnnnn date time vol02 ... |