metaset

 


 
 
 
 Maintenance Commands                                  metaset(1M)
 
 
 


NAME

metaset - configure shared disksets

SYNOPSIS

metaset -s setname -a -h hostname... metaset -s setname -a [ -l length ] drivename... metaset -s setname -d [ -f ] -h hostname... metaset -s setname -d [ -f ] drivename... metaset -s setname -r metaset -s setname -t [ -f ] metaset -s setname -b metaset -s setname -o [ -h hostname ] metaset [ -s setname ]

DESCRIPTION

In a diskset configuration, two hosts are physically con- nected to the same set of disks. When one host fails, the other host has exclusive access to the disks. metaset used without options shows details of disksets, if there are any. If no disksets are defined, metaset used with no options will return without producing any output. metaset administers sets of disks shared for exclusive (but not concurrent) access between such hosts. While disksets enable a high-availability configuration, DiskSuite itself does not actually provide a high-availability environment. Shared metadevices/hot spare pools can be created only from drives which are in the diskset created by metaset. To create a set, one or more hosts must be added to the set. To create metadevices within the set, one or more devices must be added to the set. The drivename specified must be in the form cxtxdx with no slice specified. Drives are repartitioned when they are added to a diskset only if Slice 7 is not set up correctly. A small portion of each drive is reserved in Slice 7 for use by DiskSuite. The remainder of the space on each drive is placed into Slice 0. Any existing data on the disks is lost after repartitioning. After adding a drive to a diskset, you can repartition the drive as necessary. However, Slice 7 should not be moved, removed, or overlapped with any other partition. After a diskset is created and metadevices are set up within the set, the metadevice name will be in the following form: /dev/md/setname/{dsk,rdsk}/dnumber where setname is the name of the diskset, and number is the number of the metadevice (0-127). Hot spare pools within local disksets use standard DiskSuite naming conventions. Hot spare pools with shared disksets use the following convention: setname/hspnumber where setname is the name of the diskset, and number is the number of the hot spare pool (0-999).

OPTIONS

In addition to the options listed below, there are some option available on the mediator(7) man page. -a Adds drives or hosts to the named set. For a drive to be accepted into a set, the drive must not be in use within another metadevice or diskset, mounted on, or swapped on. When the drive is accepted into the set, it is repartitioned and the metadevice state database replica (for the set) may be placed on it. However, if a Slice 7 starts at cylinder 0, and is large enough to hold a state database replica, then the disk is not repartioned. Also, a drive is not accepted if it cannot be found on all hosts specified as part of the set. This means that if a host within the specified set is unreachable due to network problems, or is administra- tively down, the add will fail. -b Insures that the replicas are distributed according to the replica layout algorithm. This can be invoked at any time, and will do nothing if the replicas are correctly distributed. In cases where the user has used the metadb command to manually remove or add replicas, this command can be used to insure that the distribu- tion of replicas matches the replica layout algorithm. -d Deletes drives or hosts from the named diskset. For a drive to be deleted, it must not be in use within the set. The last host cannot be deleted unless all of the drives within the set are deleted. -f Forces one of three actions to occur: takes ownership of a diskset when used with -t; deletes the last disk drive from the diskset; or deletes the last host from the diskset. (Deleting the last drive or host from a diskset requires the -d option.) When used to forcibly take ownership of the diskset, this causes the diskset to be grabbed whether or not another host owns the set. All of the disks within the set are taken over (reserved) and fail fast is enabled, causing the other host to panic if it had diskset ownership. The meta- device state database will be read in by the host performing the take, and the shared metadevices con- tained in the set will be accessible. The -f option is also used to delete the last drive in the diskset, because this drive would implicitly contain the last state database replica. The -f option is also used for deleting hosts from a set. This option should only be used for deleting hosts from a set when the hosts are non-functional. This would be most useful in emergency maintenance situations where one or more of the hosts in a set are non-functional. In this case timeouts and failed com- mands can be avoided. It is important to realize that when a non- functional host comes back up its concept of what a complete list of hosts is may be incorrect if the -f option has been used while it is down. This option should be used with extreme care as it can cause unexpected problems and inconsistencies amongst the various hosts involved. See EXAMPLES for suggested usage of the -f option. -h hostname... Specifies one or more host names to be added to or deleted from a diskset. Adding the first host creates the set. The last host cannot be deleted unless all of the drives within the set have been deleted. The host name is not accepted if all of the drives within the set cannot be found on the specified host. The host name is the same name found in /etc/nodename. -l length Sets the size (in blocks) for the metadevice state database replica. The length can only be set when adding a new drive; it cannot be changed on an existing drive. The default size is 1034 blocks (517 Kbytes), which should be appropriate for most configurations. The minimum size of the length is 64 blocks. The max- imum size of the length is 8192 blocks. -o Returns an exit status of 0 if the local host or the host specified with the -h option is the owner of the diskset. -r Releases ownership of a diskset. All of the disks within the set are released. The metadevices set up within the set are no longer accessible. -s setname Specifies the name of a diskset on which metaset will work. If no setname is specified, all disksets are returned. -t Takes ownership of a diskset safely. If metaset finds that another host owns the set, this host will not be allowed to take ownership of the set. If the set is not owned by any other host, all the disks within the set will be owned by the host on which metaset was exe- cuted. The metadevice state database is read in, and the shared metadevices contained in the set become accessible. The -t option will take a diskset that has stale databases. When the databases are stale, metaset will exit code 66, and a message will be printed. At that point, the only operations permitted are the addi- tion and deletion of replicas. Once the addition or deletion of the replicas has been completed, the diskset should be released and retaken to gain full access to the data. EXAMPLES The following examples are executed in an environment con- taining two hosts, red and blue. The administrator host, the host on which the example commands are executed, is assumed to be host red. This example defines a diskset. # metaset -s relo-red -a -h red blue The name of the diskset is relo-red. The names of the first and second hosts added to the set are red and blue, respec- tively. (The hostname is found in /etc/nodename.) Adding the first host creates the diskset. A diskset can be created with just one host, with the second added later. The last host cannot be deleted until all of the drives within the set have been deleted. This example adds drives to a diskset. # metaset -s relo-red -a c2t0d0 c2t1d0 c2t2d0 c2t3d0 c2t4d0 c2t5d0 The name of the previously created diskset is relo-red. The names of the drives are c2t0d0, c2t1d0, c2t2d0, c2t3d0, c2t4d0, and c2t5d0. Note that there is no slice identifier ("sx") at the end of the drive names. This example deletes all drives in a diskset. Host red is assumed to be the set owner when this command is executed (see -t option). # metaset -s relo-red -f -d c2t0d0 c2t1d0 c2t2d0 c2t3d0 c2t4d0 c2t5d0 This operation would normally fail without the -f option due to an the attempt to remove the last disk containing repli- cas from the set. This example deletes host blue from set relo-red. # metaset -s relo-red -d -h blue If host blue was non-functional the above command would timeout and fail. In this case use the following form. # metaset -s relo-red -f -d -h blue Note that any set maintenance which occurs beyond this point will not be reflected in host blue's configuration. Once blue is brought back online it will have the same view of set relo-red (and any other set) as it did prior to being taken offline. This example removes the last host which also destroys the set. # metaset -s relo-red -d -h red

FILES

/etc/lvm/md.tab Contains list of metadevice configura- tions.

NOTES

Diskset administration, including the addition and deletion of hosts and drives, requires all hosts in the set to be accessible from the network.

ATTRIBUTES

See attributes(5) for descriptions of the following attri- bute: box; cbp-1 | cbp-1 l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE = Availability SUNWmdu

SEE ALSO

metaclear(1M), metadb(1M), metadetach(1M), metahs(1M), metainit(1M), metaoffline(1M), metaonline(1M), metaparam(1M), metareplace(1M), metaroot(1M), metastat(1M), metasync(1M), metattach(1M), md.cf(4), md.tab(4), mddb.cf(4) SunOS 5.8 Last change: 28 June 2000 6