Metadevices

A metadevice is a name for a group of physical slices that appear to the system as a single, logical device. Metadevices are actually pseudo, or virtual, devices in standard UNIX terms.

You create a metadevice by using concatenation, striping, mirroring, RAID level 5, or UFS logging. Thus, the types of metadevices you can create are concatenations, stripes, concatenated stripes, mirrors, RAID5 metadevices, and trans metadevices.

DiskSuite uses a special driver, called the metadisk driver, to coordinate I/O to and from physical devices and metadevices, enabling applications to treat a metadevice like a physical device. This type of driver is also called a logical, or pseudo, driver.

You can use either the DiskSuite Tool graphical user interface or the command line utilities to create and administer metadevices.

Can be used directly, or as the basic building blocks for mirrors and trans devices. There are three types of simple
metadevices: stripes, concatenations, and concatenated stripes. Simple metadevices consist only of physical slices. By themselves, simple metadevices do not provide data redundancy.

Mirror

Replicates data by maintaining multiple copies. A mirror is composed of one or more simple metadevices called submirrors.

RAID5

Replicates data by using parity information. In the case of missing data, the missing data can be regenerated using available data and the parity information. A RAID5 metadevice is composed of slices. One slice's worth of space is allocated to parity information, but it is distributed across all slices in the RAID5 metadevice.

Trans

Used to log a UFS file system. A trans metadevice is composed of a master device and a logging device. Both of these devices can be a slice, simple metadevice, mirror, or
RAID5 metadevice. The master device contains the UFS file system.

How Are Metadevices Used?

You use metadevices to increase storage capacity and data availability. In some instances, metadevices can also increase I/O performance. Functionally, metadevices behave the same way as slices. Because metadevices look like slices, they are transparent to end users, applications, and file systems. Like physical devices, metadevices are accessed through block or raw device names. The metadevice name changes, depending on whether the block or raw device is used. See "Metadevice Conventions" for details about metadevice names.

You can use most file systems commands (mount(1M), umount(1M), ufsdump(1M), ufsrestore(1M),and so forth) on metadevices. You cannot use the format(1M) command, however. You can read, write, and copy files to and from a metadevice, as long as you have a file system mounted on the metadevice.

SPARC and x86 systems can create metadevices on the following disk drives:

SPARC - IPI, SCSI devices, and SPARCStorage Array drives

x86 - SCSI and IDE devices

Metadevice Conventions

How are metadevices named?

Metadevice names begin with the letter "d" followed by a number (for example, d0 as shown in Table 1-4).

Yes. Instead of specifying the full metadevice name, such as /dev/md/dsk/d1, you can use d1. You can use either the command line interface or DiskSuite Tool to name metadevices.

What is the maximum number of metadevices possible?

1024 (though the default number of metadevices is 128). You can increase the number of default metadevices by editing the /kernel/drv/md.conf file. See "System and Startup Files" for more information on this file.

Yes. DiskSuite enables you to rename a metadevice at any time, as long as the name being used is not in use by another metadevice, and as long as the metadevice itself is not in use. For a file system, make sure it is not mounted or being used as swap. Other applications using the raw device, such as a database, should have their own way of stopping access to the data.

You can use either DiskSuite Tool (via a metadevice's Information window) or the command line (the metarename(1M) command) to rename metadevices.

The metarename(1M) command with the -x option can "switch" metadevices that have a parent-child relationship. Refer to Solstice DiskSuite 4.2.1 User's Guide for procedures to rename and switch metadevices.

Example -- Metadevice Consisting of Two Slices

Figure 1-1 shows a metadevice "containing" two slices, one each from Disk A and Disk B. An application or UFS will treat the metadevice as if it were one physical disk. Adding more slices to the metadevice will increase its capacity.

Figure 1-1 Relationship Among a Metadevice, Physical Disks, and Slices