Search This Blog

Sunday 11 October 2009

How to remove metaset in Solaris

This is the proceedure for removing a metaset in Solaris. Here my disk set name is test-set and owned by two nodes node1 and node2. Do all this command from /tmp directory.

1. Create new vfstab by removing the entry related to test-set
#cp /etc/vfstab /etc/vfstab.prereclaim
#cat /etc/vfstab.prereclaim|grep -v "/dev/md/test-set/" >/etc/vfatb

2.unmount all the filesystems from test-set forcefully
#for i in `cat /etc/vfstab.prereclaim |grep "/dev/md/smsc-ms/" |awk {'print $3'}`; do umount -f $i; done
The above 2 two steps are requied on all the nodes. For doing below steps, this node should have the ownership to the meta-set. you can get the ownership using metaset -s test-set -t command

3. Get all the logical drive in test-set
#metastat -s test-set -p|grep test-set|awk {'print $1 '}|cut -d \/ -f 2>metadevices

4. Removing the logincal drive one by one
#for i in `cat metadevices`; do metaclear -s smsc-ms -f $i; done

5. Getting all the physical disk name included in the test-set
#metaset |awk {'print $1'}|grep -v "^$"|grep dev>diskname

6. Removing the physcial disks from the test-set
#for i in `cat diskname`; do metaset -s smsc-ms -d -f $i; done

7. Now we can remove mediator and host from this metaset
metaset -s test-set -d -m node1 node2
metaset -s test-set -d -f -h node1
metaset -s test-set -d -f -h node2

No comments:

Post a Comment