This chapter describes how to create DiskSuite objects, both with the DiskSuite graphical user interface and the command line utilities.
Use the following to proceed directly to the section that provides step-by-step instructions using DiskSuite Tool.
Use the following to proceed directly to the section that provides step-by-step instructions using the command line interface.
When you create a DiskSuite object, you assign physical slices to a logical DiskSuite name. The DiskSuite objects that you can create using the steps in this chapter include:
For general information on DiskSuite, refer to Solstice DiskSuite 4.1 Reference.
Note - For hints on how to name metadevices, refer to "Metadevice Naming Conventions."
Here are the prerequisites for the steps in this chapter:
To work with "local" metadevices (metadevices not in a diskset configuration), type:
---------------
# metatool & ---------------
To work with metadevices in a diskset, make sure you are the diskset owner and type:
---------------------------------
# metatool -s diskset_name & ---------------------------------
This section describes how to create additional state database replicas on a system that is up and running.
After the initial state database replicas are created, you can create additional state database replicas as needed.
DiskSuite Tool displays the MetaDB object on the canvas.
Use Control-click to select multiple slices.
This method does not enable you to "change" the number of state database replicas on a slice, only to initially specify them.
This example shows a new state database replica added to a MetaDB object.
The added slice that contains the state database replica, c1t2d0s0, appears at the bottom of the list of slices in the committed MetaDB object.
After checking the prerequisites, and the preliminary information, use the metadb(1M) command to create additional state database replicas . Refer to the metadb(1M) man page for more information.
---------------------------------------------------------------------------
# metadb -a c0t2d0s0 # metadb flags first blk block count ... a u 16 1034 /dev/dsk/c0t2d0s0 ---------------------------------------------------------------------------
The -a option adds the additional state database replica to the system. The metadb command checks that the replica is active, as indicated by the a flag.
---------------------------------------------------------------------------
# metadb -a -c 2 c0t2d0s0 # metadb flags first blk block count ... a u 16 1034 /dev/dsk/c0t2d0s0 a u 1050 1034 /dev/dsk/c0t2d0s0 ---------------------------------------------------------------------------
The -a option adds additional state database replicas to the system. The
- c 2 option places two replicas on the specified slice. The metadb command
checks that the replicas are active, as indicated by the a flag.
This section describes how to create stripes and concatenations. To concatenate (add slices) to an existing stripe, refer to "How to Expand an Existing Concat/Stripe (DiskSuite Tool)."
Note - Because DiskSuite Tool uses the Concat/Stripe object to represent both concatenated metadevices and striped metadevices, the only way to distinguish them by a glance is to study the pattern of rectangles in the Concat/Stripe object.
Caution -
Do not create a striped metadevice from an existing file system or data. Doing so will destroy data. To create a striped metadevice from existing data, you must dump and restore the data to the metadevice.Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click the Attach button. Then click the Close button.
Note - If you drag slices one at a time, the "Stripe or Concat" dialog box does not appear, so be careful where you drop them on the Concat/Stripe object. To create a stripe, drop the slices on the rectangle labeled "stripe 0 of dx."
For more information on setting the interlace value, refer to Solstice DiskSuite 4.1 Reference.
Note - The interlace value cannot be changed after committing the metadevice.
This example shows a newly created stripe made of two slices. The Stripe object displays the slices on top of each other in a single rectangle. Compare the presentation of a concatenated metadevice.
To prepare the newly created stripe for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)." An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
After checking the prerequisites, and the preliminary information, create the striped metadevice with the metainit(1M) command. Refer to the metainit(1M) man page for more information.
Caution -
Do not create a striped metadevice from an existing file system or data. Doing so will destroy data. To create a striped metadevice from existing data, you must dump and restore the data to the metadevice.----------------------------------------------
# metainit d10 1 2 c0t1d0s2 c0t2d0s2 -i 32k d10: Concat/Stripe is setup ----------------------------------------------
The striped metadevice, d10, consists of a single stripe (the number 1) made of two slices (the number 2). The -i option sets the interlace to 32 Kbytes. (The interlace cannot be less than 8 Kbytes, nor greater than 100 Mbytes.) If interlace were not specified, the striped metadevice would use the default of 16 Kbytes. The system verifies that the Concat/Stripe object has been set up.
For more information on setting the interlace value, refer to Solstice DiskSuite 4.1 Reference.
------------------------------------------------
# metainit d20 1 3 c0t1d0s2 c0t2d0s2 c0t3d0s2 d20: Concat/Stripe is setup ------------------------------------------------
The striped metadevice, d20, consists of a single stripe (the number 1) made of three slices (the number 3). Because no interlace is specified, the striped metadevice uses the default of 16 Kbytes. The system verifies that the Concat/Stripe object has been set up.
To prepare the newly created striped metadevice for a file system, refer to "How to Create a File System on a Metadevice (Command Line). An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
Use this procedure to create a concatenation from slices that do not contain any data. To concatenate existing data, such as a file system or a database, refer to "How to Expand a Slice Containing Existing Data (DiskSuite Tool).
An unassigned and uncommitted Concat/Stripe object appears on the canvas. The metadevice name is automatically assigned.
Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
This example shows a newly created concatenation made of two slices. The object displays the slices in the concatenation so that each slice is in its own rectangle.
To prepare the newly created concatenation for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)." An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
After checking the prerequisites, and the preliminary information, use the metainit(1M) command to create the concatenation. For more information, refer to the metainit(1M) man page.
Do not use this procedure on an existing file system or data. To concatenate existing data, such as a file system or a database, refer to "How to Expand a Slice Containing Existing Data (Command Line)."
The following examples create concatenations that do not contain any existing data.
-----------------------------------------
# metainit d25 2 1 c0t1d0s2 1 c0t2d0s2 d25: Concat/Stripe is setup -----------------------------------------
This example creates a concatenation, d25, consisting of two "stripes" (the number 2) each made of a single slice (the number 1 in front of each slice). The system verifies that the Concat/Stripe object has been set up.
---------------------------------------------------------------
# metainit d40 4 1 c0t1d0s2 1 c0t2d0s2 1 c0t2d0s3 1 c0t2d1s3 d40: Concat/Stripe is setup ---------------------------------------------------------------
This example creates a concatenation called d40 consisting of four "stripes" (the number 4) each made of a single slice (the number 1 in front of each slice). The system verifies that the Concat/Stripe object has been set up.
To prepare the newly created concatenation for a file system, refer to "How to Create a File System on a Metadevice (Command Line)." An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
This section describes how to create a mirror from scratch, and how to mirror an existing file system, including root (/).
Note - In the past, when creating a mirror for a file system, the mount point would change. Now, in certain instances, you can create mirrors without having to change the mount point. Refer to "How to Create a Mirror From an Existing Concat/Stripe (Command Line)," for more information.
Caution -
When creating a mirror for an existing file system, be sure that the initial submirror contains the data.The high-level steps in this procedure are:
An unassigned and uncommitted Mirror object appears on the canvas. The metadevice name is automatically assigned.
Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
A resync of the second submirror begins. The Mirror object displays the resync progress.
This example shows a committed mirror object, d5, consisting of two striped metadevice s (submirrors), d3 and d4.
To prepare the newly created mirror for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)." An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
The high-level steps in this procedure are:
Check the prerequisites, and the preliminary information, before beginning. Refer to the metainit(1M) and metattach(1M) man pages for more information.
--------------------------------
# metainit d51 1 1 c0t0d0s2 d51: Concat/Stripe is setup # metainit d52 1 1 c1t0d0s2 d52: Concat/Stripe is setup # metainit d50 -m d51 d50: Mirror is setup # metattach d50 d52 d50: Submirror d52 is attached --------------------------------
This example creates a two-way mirror, d50. The metainit(1M) command creates two submirrors (d51 and d52), which are actually concatenations. The metainit -m command creates the one-way mirror from the d51 concatenation. The metattach(1M) command attaches d52, creating a two-way mirror and causing a mirror resync. (Any data on the attached submirror is overwritten by the other submirror during the resync.) The system verifies that the objects are set up.
To prepare a newly created mirror for a file system, refer to "How to Create a File System on a Metadevice (Command Line)." An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
Use this procedure to mirror file systems that can be unmounted.
Note - Some file systems can be unmounted, while other file systems (like root (/), /usr, /opt, or swap) cannot be unmounted. To mirror these file systems, refer to "How to Create a Mirror From a File System That Cannot Be Unmounted (DiskSuite Tool)."
The high-level steps in this procedure are:
DiskSuite Tool should display the file system's name next to the name of the slice upon which it is mounted. If you mount a file system after starting DiskSuite Tool, select Rescan Configuration from the File menu.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
When the slice is dropped, a warning dialog box is displayed that the slice is mounted. Click Continue.
Click Really Commit on the warning dialog box that appears. This creates a metadevice that contains the file system, which will be used as the first submirror.
Note - If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the concatenation's name.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
See Step 4.
Select an unused slice, a slice that contains a state database replica, or more than one slice that is the same size or greater as the existing file system.
This creates a metadevice, which will be used as the second submirror.
DiskSuite Tool displays an unassigned and uncommitted mirror object on the canvas and gives it a metadevice name.
See Step 4.
Note - If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the mirror's metadevice name.
This creates the one-way mirror.
For example, use the umount(1M) command, or File System Manager.
DiskSuite Tool updates the file system's current mount status.
For example, use the mount(1M) command or File System Manager. (The mount point has now changed from the slice name to the mirror name.)
DiskSuite Tool updates the file system's mount point. The Mirror object shows that it is being used by the file system.
Data from the first submirror is resynced to the second mirror automatically.
This example shows a committed two-way mirror consisting of submirrors d0 and d7, which in turn consist of slices c1t1d0s2 and c2t1d0s2, respectively. The file system, /fs1, is mounted on the mirror, d2.
Use this procedure to mirror an existing file system that can be unmounted.
Note - To use the command line to mirror /usr, /opt, or swap, refer to "How to Create a Mirror From a File System That Cannot Be Unmounted (Command Line)." To use the command line to mirror root (/), refer to "SPARC: How to Create a Mirror From root (/) (Command Line)," or "x86: How to Create a Mirror From root (/) (Command Line)."
The high-level steps in this procedure are:
Check the prerequisites, and the preliminary information, before beginning. Refer to the metainit(1M) and metattach(1M) man pages for more information.
---------------------------------------------------------------------------
# metainit -f d1 1 1 c1t0d0s0 d1: Concat/Stripe is setup # metainit d2 1 1 c2t0d0s0 d2: Concat/Stripe is setup # metainit d0 -m d1 d0: Mirror is setup # umount /master (Edit the /etc/vfstab file so that the file system references the mirror) # mount /master # metattach d0 d2 d0: Submirror d2 is attached ---------------------------------------------------------------------------
The -f option forces the creation of the first concatenation, d1, which contains the mounted file system /master on /dev/dsk/c1t0d0s0. The second concatenation, d2, is created from /dev/dsk/c2t0d0s0. (This slice must be the same size or greater than that of d1.) The metainit command with the -m option creates the one-way mirror, d0, from d1.
Next, /master is unmounted and its entry changed in the /etc/vfstab file to reference the mirror. For example, the following line:
----------------------------------------------------------
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 /master ufs 2 yes - ----------------------------------------------------------
should be changed to:
----------------------------------------------------
/dev/md/dsk/d0 /dev/md/rdsk/d0 /master ufs 2 yes - ----------------------------------------------------
Finally, the /master file system is remounted and submirror d2 attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d2 is attached.)
Use this procedure to mirror file systems, such as root (/), /usr, /opt, and swap, that cannot be unmounted during normal system usage.
The high-level steps in this procedure are:
Note - When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which may not be available. See Chapter 7, "Troubleshooting the System," for details on recording the alternate boot device, and on booting from the alternate boot device.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click the Attach button. Then click the Close button .
When you drop the slice, DiskSuite Tool displays a warning dialog box. Click the Continue button.
Click the Really Commit button if DiskSuite Tool displays a warning dialog box. This creates a one-way concatenation that contains the file system, which will be used as the first submirror.
Note - If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the concatenation's metadevice name.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
See Step 3.
When creating this one-way concatenated metadevice, use an unused slice that is the same size as or greater than the existing file system.
This creates the second submirror.
DiskSuite Tool displays an unassigned and uncommitted Mirror object on the canvas and gives it a metadevice name.
See Step 3.
Click the Continue button if DiskSuite Tool displays a warning dialog box.
Note - If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the mirror's metadevice name.
Data from the first submirror is resynced to the second mirror.
Refer to Chapter 7, "Troubleshooting the System," for more information.
This example shows a committed mirror containing the /usr file system.
Use this procedure to mirror file systems, such as /usr, /opt, and swap, that cannot be unmounted during normal system usage.
Note - To use the command line to mirror root (/), refer to "SPARC: How to Create a Mirror From root (/) (Command Line)," or "x86: How to Create a Mirror From root (/) (Command Line)."
The high-level steps in this procedure are:
After checking the prerequisites, and the preliminary information, use the metainit(1M) and metattach(1M) commands to create the mirror.
----------------------------------------------------------------
# metainit -f d12 1 1 c0t3d0s6 d12: Concat/Stripe is setup # metainit d22 1 1 c1t0d0s6 d22: Concat/Stripe is setup # metainit d2 -m d12 d2: Mirror is setup (Edit the /etc/vfstab file so that /usr references the mirror) # reboot ... # metattach d2 d22 d2: Submirror d22 is attached ----------------------------------------------------------------
The -f option forces the creation of the first concatenation, d12, which contains the mounted file system /usr on /dev/dsk/c0t3d0s6. The second concatenation, d22, is created from /dev/dsk/c1t0d0s6. (This slice must be the same size or greater than that of d12.) The metainit command with the -m option creates the one-way mirror d2 using the concatenation containing /usr. Next, the /etc/vfstab file must be edited to change the entry for /usr to reference the mirror. For example, the following line:
-------------------------------------------------------
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 yes - -------------------------------------------------------
should be changed to:
-------------------------------------------------
/dev/md/dsk/d2 /dev/md/rdsk/d2 /usr ufs 1 yes - -------------------------------------------------
After a reboot, the second submirror d22 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d22 is attached.)
----------------------------------------------------------------
# metainit -f d11 1 1 c0t0d0s1 d11: Concat/Stripe is setup # metainit d21 1 1 c1t0d0s1 d21: Concat/Stripe is setup # metainit d1 -m d11 d1: Mirror is setup (Edit the /etc/vfstab file so that swap references the mirror) # reboot ... # metattach d1 d21 d1: Submirror d21 is attached ----------------------------------------------------------------
The -f option forces the creation of the first concatenation, d11, which contains the mounted file system swap on /dev/dsk/c0t0d0s1. The second concatenation, d21, is created from /dev/dsk/c1t0d0s1. (This slice must be the same size or greater than that of d11.) The metainit command with the -m option creates the one-way mirror d1 using the concatenation containing swap. Next, if there is an entry for swap in the /etc/vfstab file, it must be edited to reference the mirror. For example, the following line:
-----------------------------------
/dev/dsk/c0t0d0s1 - - swap - no - -----------------------------------
should be changed to:
--------------------------------
/dev/md/dsk/d1 - - swap - no - --------------------------------
After a reboot, the second submirror d21 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d21 is attached.)
Use this task to mirror root (/) on a SPARC system.
Note - The task for using the command line to mirror root (/) on an x86 system is different from the task used for a SPARC system. To mirror root (/) on an x86 system, refer to "x86: How to Create a Mirror From root (/) (Command Line)." When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which may not be available. See Chapter 7, "Troubleshooting the System," for details on recording the alternate boot device, and on booting from the alternate boot device.
The high-level steps in this procedure are:
Make sure you have met the prerequisites, and have read the preliminary information. For more information refer to the metainit(1M), metaroot(1M), and metattach(1M) man pages.
-------------------------------------------------------------------------------
# metainit -f d11 1 1 c0t3d0s0 d11: Concat/Stripe is setup # metainit d12 1 1 c1t3d0s0 d12: Concat/Stripe is setup # metainit d10 -m d11 d10: Mirror is setup # metaroot d10 # lockfs -fa # reboot ... # metattach d10 d12 d10: Submirror d12 is attached # ls -l /dev/rdsk/c1t3d0s0 lrwxrwxrwx 1 root root 88 Feb 8 15:51 /dev/rdsk/c1t3d0s0 - ../../devices/iommu@f,e0000000/vme@f,df010000/SUNW,pn@4d,1080000/ipi3sc@0,0/i d@3,0:a,raw -------------------------------------------------------------------------------
The -f option forces the creation of the first concatenation, d11, which contains the mounted file system root (/) on /dev/dsk/c0t3d0s0. The second concatenation, d12, is created from /dev/dsk/c1t3d0s0. (This slice must be the same size or greater than that of d11.) The metainit command with the -m option creates the one-way mirror d10 using the concatenation containing root (/). Next, the metaroot command edits the /etc/vfstab and /etc/system files so that the system may be booted with the root file system (/) on a metadevice. (It is a good idea to run lockfs -fa before rebooting.) After a reboot, the submirror d12 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d12 is attached.) The ls -l command is run on the root raw device to determine the path to the alternate root device in case the system needs to be booted from it.
Use this task to mirror root (/) on an x86 system.
Note - When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which may not be available. See Chapter 7, "Troubleshooting the System," for details on recording the alternate boot device, and on booting from the alternate boot device.
The high-level steps in this task are:
Note - You cannot mirror root (/) on an IDE drive.
For the purpose of the following procedures, assume that the alternate disk is c0t1d0.
Use these steps to create a Solaris partition on an x86 system.
-------------------------------
# fdisk /dev/rdsk/c0t1d0p0 -------------------------------
-------------------------------------------------------------
The recommended default partitioning for your disk is: a 100% "SOLARIS System" partition To select this, please type "y". To partition your disk differently, type "n" and the "fdisk" program will let you select other partitions. -------------------------------------------------------------
-----------------------------------------------------------------
Total disk size is 1855 cylinders Cylinder size is 1110 (512 byte) blocks Partition Status Type Start End Length % ========= ====== ======== ===== === ====== === 1 Active SOLARIS 1 1854 1854 100 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Change Active (Boot from) partition 3. Delete a partition 4. Exit (Update disk configuration and exit) 5. Cancel (Exit without updating disk configuration) Enter Selection: -----------------------------------------------------------------
Make sure that the Solaris partition is active. Otherwise, you will be unable to boot from it.
---------------------------------------------------------------
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 <DEFAULT cyl 2676 alt 2 hd 9 sec 85'> /eisa/ncrs@8000,0/cmdk@0,0 1. c1t1d0 <DEFAULT cyl 1865 alt 2 hd 7 sec 80 ABCDEFG /eisa/eha@1000,0/cmdk@1,0 2. c1t2d0 <DEFAULT cyl 1461 alt 2 hd 9 sec 64'> /eisa/eha@1000,0/cmdk@2,0 3. c1t3d0 <DEFAULT cyl 1461 alt 2 hd 9 sec 64'> /eisa/eha@1000,0/cmdk@3,0 4. c1t4d0 <DEFAULT cyl 1865 alt 2 hd 7 sec 80'> /eisa/eha@1000,0/cmdk@4,0 Specify disk (enter its number): 1 selecting c1t1d0: ABCDEFG [disk formatted] FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk fdisk - run the fdisk program repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name quit ---------------------------------------------------------------
------------------------------------------------------------
format partition PARTITION MENU: 0 - change `0' partition 1 - change `1' partition 2 - change `2' partition 3 - change `3' partition 4 - change `4' partition 5 - change `5' partition 6 - change `6' partition 7 - change `7' partition select - select a predefined table modify - modify a predefined partition table name - name the current table print - display the current table label - write partition map and label to the disk quit partition 0 Part Tag Flag Cylinders Size Blocks Blocks 0 unassigned wm 0 0 (0/0/0) Enter partition id tag [unassigned]: root Enter partition permission flags [wm]: wm Enter new starting cyl [0]: 4 Enter partition size [0b, 0c, 0.00mb]: 400mb partition label Ready to label disk, continue? y partition'> ------------------------------------------------------------
----------------------------------------------------------
partition quit FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name quit format quit ----------------------------------------------------------
Note the following important information about the Solaris root (/) partition:
Use the installboot command to install the boot information on the alternate boot disk:
-----------------------------------------
# installboot /usr/lib/fs/ufs/pboot \ /usr/lib/fs/ufs/bootblk \ /dev/rdsk/c0t1d0s0 -----------------------------------------
This example assumes that a Solaris partition has been created and installed with the boot information using the tasks above.
--------------------------------------------------------------------
# metainit -f d10 1 1 c0t0d0s0 d10:Concat/Stripe is setup # metainit d20 1 1 c1t0d0s0 d20: Concat/Stripe is setup # metainit d0 -m d10 d10: Mirror is setup # metaroot d0 # lockfs -fa # reboot ... # metattach d0 d20 d0: Submirror d20 is attached # ls -l /dev/rdsk/c1t0d0s0 lrwxrwxrwx 1 root root 55 Mar 5 12:54 /dev/rdsk/c1t0d0s0 - ../. devices/eisa/eha@1000,0/cmdk@1,0:a --------------------------------------------------------------------
The -f option forces the creation of the first concatenation, d10, which contains the mounted file system root (/) on /dev/dsk/c0t0d0s0. The second concatenation, d20, is created from /dev/dsk/c1t0d0s0. (This slice must be the same size or greater than that of d10.) The metainit command with the -m option creates the one-way mirror d0 using the concatenation containing root (/). Next, the metaroot command edits the /etc/vfstab and /etc/system files so that the system may be booted with the root file system (/) on a metadevice. After a reboot, the submirror d20 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d20 is attached.) Using the ls -l command on the root raw device determines the path to the alternate root device in case the system needs to be booted from it.
This section describes how to create RAID5 metadevices.
An unassigned and uncommitted RAID5 object appears on the canvas. The metadevice name is automatically assigned.
Display the object's pop-up menu and choose Info. The RAID Information window for this RAID5 metadevice appears.
See Solstice DiskSuite 4.1 Reference for more information on setting the interlace value.
Use Control-click to select multiple slices. You need at least three slices.
DiskSuite starts initializing the RAID5 metadevice.
Note - You must wait for the initialization to finish before you can use the RAID5 metadevice.
This example shows a RAID5 metadevice. Notice that the size displayed is 1.95 GBytes even though the metadevice is made of three 999.63 MByte slices. (One slice's worth of storage capacity is used for parity.)
To prepare the newly created RAID5 metadevice for a file system, refer to "How to Create a File System on a Metadevice (File System Manager) ." An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
To associate a hot spare pool with a RAID5 metadevice, refer to "How to Associate a Hot Spare Pool (DiskSuite Tool)."
After checking the prerequisites, and the on preliminary information, use the metainit(1M) command to create the RAID5 metadevice. For more information, refer to the metainit(1M) man page.
----------------------------------------------
# metainit d45 -r c2t3d0s2 c3t0d0s2 c4t0d0s2 d45: RAID is setup ----------------------------------------------
The RAID5 metadevice d45 is created with the -r option from three slices. Because no interlace is specified, d45 uses the default of 16 Kbytes. The system verifies that the RAID5 metadevice has been set up, and begins initializing the metadevice.
Note - You must wait for the initialization to finish before you can use the RAID5 metadevice.
To prepare the newly created RAID5 metadevice for a file system, refer to "How to Create a File System on a Metadevice (Command Line)." An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
To associate a hot spare pool with a RAID5 metadevice, refer to "How to Associate a Hot Spare Pool (Command Line)."
This section describes how to create trans metadevices (UFS logging).
Caution -
Mirroring logging devices is strongly recommended. Losing the data in a logging device because of device errors can leave a file system in an inconsistent state which fsck(1M) may not be able to fix without user intervention. Using a mirror for the master device is a good idea to ensure data redundancy.Before beginning, identify the slice or metadevice that contains the file system. You'll need this when creating the master device. Also, decide if you want to mirror the logging device. If so, use "How to Create a Trans Metadevice Using Mirrors (DiskSuite Tool)." If you are mirroring the logging device, it is a good idea that the master device be a mirror also.
You can create a file system on the trans metadevice later if the master device doesn't already have a file system.
To create a trans metadevice for a file system, such as /usr, that cannot be unmounted during normal system operation, refer to "How to Create a Trans Metadevice For a File System That Cannot Be Unmounted (DiskSuite Tool)."
An unassigned and uncommitted Trans Metadevice object appears on the canvas. The metadevice name is automatically assigned.
Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
When you can drag a slice from the Slice Browser, or drag a metadevice from the Objects list, a warning dialog box is displayed. Click Continue.
Note - If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the trans metadevice's name.
A Warning dialog box appears if the logging device is not mirrored.
Logging becomes effective for the file system when you remount the system. On subsequent reboots, instead of checking the file system, fsck(1M) displays this message:
--------------------------------
/dev/md/rdsk/dx: is logging. --------------------------------
This example shows a committed trans metadevice, d8, consisting of slice c3t0d0s5 for the master device, and a mirror, d5, for the logging device. Notice how the master and logging devices are displayed within the trans object.
After checking the prerequisites, and the preliminary information, create the trans metadevice with the metainit(1M) command. Refer to the metainit(1M) man page for more information.
-------------------------------------------------------------------------------------
# umount /home1 # metainit d63 -t c0t2d0s2 c2t2d0s1 d63: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice) # mount /home1 -------------------------------------------------------------------------------------
Slice /dev/dsk/c0t2d0s2 contains a file system mounted on /home1. The slice to contain the logging device is /dev/dsk/c2t2d0s1. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d63.
Next, the /etc/vfstab file must be edited to change the entry for the file system to reference the trans metadevice. For example, the following line:
---------------------------------------------------------
/dev/dsk/c0t2d0s2 /dev/rdsk/c0t2d0s2 /home1 ufs 2 yes - ---------------------------------------------------------
should be changed to:
-----------------------------------------------------
/dev/md/dsk/d63 /dev/md/rdsk/d63 /home1 ufs 2 yes - -----------------------------------------------------
Logging becomes effective for the file system when it is remounted.
On subsequent reboots, instead of checking the file system, fsck(1M) displays a logging message for the trans metadevice:
------------------------------
# reboot ... /dev/md/rdsk/d63: is logging ------------------------------
-------------------------------------------------------------------------------------
# umount /home2 # metainit d40 -t d2 c1t2d0s0 d40: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice) # mount /home2 -------------------------------------------------------------------------------------
Stripe d2 contains a file system mounted on /home2. The slice to contain the logging device is /dev/dsk/c1t2d0s0. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d40.
Next, the /etc/vfstab file must be edited to change the entry for the file system to reference the trans metadevice. For example, the following line:
---------------------------------------------------
/dev/md/dsk/d2 /dev/md/rdsk/d2 /home2 ufs 2 yes - ---------------------------------------------------
should be changed to:
-----------------------------------------------------
/dev/md/dsk/d40 /dev/md/rdsk/d40 /home2 ufs 2 yes - -----------------------------------------------------
Logging becomes effective for the file system when it is remounted.
On subsequent reboots, instead of checking the file system, fsck(1M) displays a logging message for the metadevice:
------------------------------
# reboot ... /dev/md/rdsk/d40: is logging ------------------------------
Use this procedure to log a file system, such as /usr, that cannot be unmounted during normal system operation.
An unassigned and uncommitted Trans Metadevice object appears on the canvas. The metadevice name is automatically assigned.
Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
This must be the slice or metadevice that contains the file system.
Click the Continue button on the dialog box that appears.
Click the Continue button on the dialog box that appears.
Click the Really Commit button on the confirmation dialog box.
After the reboot, logging becomes effective for the file system.
This example shows a trans metadevice that contains the /usr file system.
After checking the prerequisites, and the preliminary information, use this procedure to log a file system, such as /usr, that cannot be unmounted during normal system operation. Refer to the metainit(1M) man page for more information.
-------------------------------------------------------------------------------------
# metainit -f d20 -t c0t3d0s6 c1t2d0s1 d20: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice) # reboot -------------------------------------------------------------------------------------
Slice /dev/dsk/c0t3d0s6 contains the /usr file system. The slice to contain the logging device is /dev/dsk/c1t2d0s1. Because /usr cannot be unmounted, the metainit command is run with the -f option to force the creation of the trans device, d20. Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the trans metadevice. For example, the following line:
------------------------------------------------------
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 no - ------------------------------------------------------
should be changed to:
--------------------------------------------------
/dev/md/dsk/d20 /dev/md/rdsk/d20 /usr ufs 1 no - --------------------------------------------------
Logging becomes effective for the file system when the system is rebooted.
You can increase data availability of a trans metadevice by using mirrors for the master and logging devices. Failure to mirror the logging device could result in significant data loss if the logging slice experiences errors. If you are mirroring the logging device, it is a good idea that the master device be a mirror also.
Create two mirrors, one for the master device, and one for the logging device. The mirror for the master device must contain the file system.
Use the mirrors created in step 2 for the master and logging devices.
After checking the prerequisites, and the preliminary information, use the metainit(1M) to create the trans metadevice.
-------------------------------------------------------------------------------------
# umount /home1 # metainit d64 -t d30 d12 d64: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice) # mount /home1 -------------------------------------------------------------------------------------
Mirror d30 contains a file system mounted on /home1. The mirror to contain the logging device is d12. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d64.
Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the trans metadevice. For example, the following line:
-----------------------------------------------------
/dev/md/dsk/d30 /dev/md/rdsk/d30 /home1 ufs 2 yes - -----------------------------------------------------
should be changed to:
-----------------------------------------------------
/dev/md/dsk/d64 /dev/md/rdsk/d64 /home1 ufs 2 yes - -----------------------------------------------------
Logging becomes effective for the file system when the file system is remounted.
On subsequent file system remounts or system reboots, instead of checking the file system, fsck(1M) displays a logging message for the metadevice:
------------------------------
# reboot ... /dev/md/rdsk/d64: is logging ------------------------------
This section describes how to create hot spare pools, add slices to hot spare pools , and assign hot spare pools to metadevices.
You can create an empty hot spare pool, and add hot spares later if necessary. If you choose to do so, skip Step 4 and Step 5 in this task.
An unassigned and uncommitted Hot Spare Pool object appears on the canvas. The metadevice name is automatically assigned.
Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
Use Control-click to select multiple slices.
This example shows a committed hot spare pool object, hsp000, consisting of slice c0t1d0s2.
To add hot spares to the hot spare pool, refer to "How to Add a Hot Spare Slice to a Hot Spare Pool (DiskSuite Tool)." After creating the hot spare pool , you need to associate it with a submirror or RAID5 metadevice. See "How to Associate a Hot Spare Pool (DiskSuite Tool)."
After checking the prerequisites, and the preliminary information, use the metainit(1M) command to create a hot spare pool. Refer to the metainit(1M) man page for more information.
--------------------------------------
# metainit hsp001 c2t2d0s2 c3t2d0s2 hsp001: Hotspare pool is setup --------------------------------------
The hot spare pool hsp100 contains two disks as the hot spares. The system verifies that the hot spare pool has been set up.
To add more hot spares to the hot spare pool, refer to "How to Add a Hot Spare Slice to a Hot Spare Pool (Command Line)." After creating the hot spare pool, you need to associate it with a submirror or RAID5 metadevice . See "How to Associate a Hot Spare Pool (Command Line)."
A hot spare pool must exist before it can be associated with a submirror or RAID5 metadevice.
The object appears on the canvas.
The hot spare pool should have slices the same size or larger than the submirrors in the mirror, or the slices in the RAID5 metadevice. Ideally, the Hot Spare Pool contains hot spares that are on a different controller than the slices in the metadevice.
This example shows a hot spare pool associated with two submirrors.
After checking the prerequisites, and the preliminary information, use the metaparam(1M) command to associate a hot spare pool. Refer to the metaparam(1M) man page for more information.
----------------------------
# metaparam -h hsp100 d10 # metaparam -h hsp100 d11 # metastat d0 d0: Mirror Submirror 0: d10 State: Okay Submirror 1: d11 State: Okay ... d10: Submirror of d0 State: Okay Hot spare pool: hsp100 ... d11: Submirror of d0 State: Okay Hot spare pool: hsp100 ... ----------------------------
The -h option associates a hot spare pool, hsp100, with two submirrors, d10 and d11, of a mirror, d0. The metastat command shows that the hot spare pool is associated with the submirrors.
----------------------------
# metaparam -h hsp001 d10 # metastat d10 d10: RAID State: Okay Hot spare pool: hsp001 ... ----------------------------
The -h option associates a hot spare pool named hsp001 with a RAID5 metadevice named d10. The metastat command shows that the hot spare pool is associated with the RAID5 metadevice.
You can add a slice to one or more hot spare pools. When a hot spare is added, the existing order of the hot spares is preserved. The new hot spare is added at the end of the list of hot spares in the hot spare pool that is specified.
The object appears on the canvas.
If the hot spare pool already contains slices, locate a slice of the same or greater size than the slice(s) in the hot spare pool.
This example shows a hot spare pool that initially consisted of one slice, c1t2d0s2. Slice c0t1d0s2 was added and the hot spare pool was committed.
After checking the prerequisites, and the preliminary information, use the metahs(1M) command to add a slice to a hot spare pool. Refer to the metahs(1M) man page for more information.
Note - The added hot spare follows whatever hot spares already exist in the hot spare pool.
---------------------------------------
# metahs -a hsp001 /dev/dsk/c3t0d0s2 hsp001: Hotspare is added ---------------------------------------
The -a option adds the slice /dev/dsk/c3t0d0s2 to hot spare pool hsp001. The system verifies that the slice has been added to the hot spare pool.
-------------------------------------
# metahs -a -all /dev/dsk/c3t0d0s2 hsp001: Hotspare is added hsp002: Hotspare is added hsp003: Hotspare is added -------------------------------------
The -a and -all options add the slice /dev/dsk/c3t0d0s2 to all hot spare pool s configured on the system. The system verifies that the slice has been added to all hot spare pools.
You can change a hot spare pool's association at any time as long as none of its slices are currently in use as hot spares.
The object appears on the canvas.
The object appears on the canvas.
Note - To avoid data fabrication, DiskSuite does not allow hot sparing of a metadevice if it contains slices in the "Last Erred" state. For more information, refer to "Overview of Replacing and Enabling Slices in Mirrors and RAID5 Metadevices."
This example shows a mirror that started with hot spare pool hsp000 associated with each submirror. Submirror d7 is now associated with hsp001.
After checking the prerequisites, and the preliminary information, use the metaparam(1M) command to change the metadevice's associated hot spare pool. For more information, refer to the metaparam(1M) man page.
----------------------------
# metastat d4 d4: RAID State: Okay Hot spare pool: hsp001 ... # metaparam -h hsp002 d4 # metastat d4 d4: RAID State: Okay Hot spare pool: hsp002 ... ----------------------------
In this example, the hot spare pool hsp001 is currently associated with a RAID5 metadevice named d4. The hot spare pool association is changed to hsp002. The metastat command shows the hot spare pool association before and after.
This section describes how to create disksets, and populate them with hosts and disk drives.
Note - Currently, disksets are only supported on SPARCstorage Array disks.
Note - Disksets must be created and configured using the DiskSuite command line interface. After you have created a diskset, you can administer state database replicas, metadevices, and hot spare pools within a diskset using either DiskSuite Tool or the command line utilities.
The high-level steps in creating a diskset are:
Before creating a diskset:
Note - If you are not familiar with how to configure the same device names for the shared drives in the diskset, refer to "How to Configure Disk Drive Device Names for a Diskset (Command Line)."
-----------------------------------------------
# metaset -s setname -a -h host... -----------------------------------------------
In this command,
----------------------------------------------------------------------
-s setname Specifies the name of a diskset on which metaset(1M) will work. -a Adds hosts to the named diskset. DiskSuite supports a maximum of two hosts per diskset. -h host... Specifies one or more hosts to be added to a diskset. Adding the first host creates the set. The second host can be added later, but it is not accepted if all the drives within the set cannot be found on the specified host. host is the same name found in /etc/nodename. ----------------------------------------------------------------------
------------
# metaset ------------
-------------------------------------------
red# metaset -s relo-red -a -h red blue red# metaset -s relo-blue -a -h red blue red# metaset Set name = relo-red, Set number = 1 Host Owner red blue Set name = relo-blue, Set number = 2 Host Owner red blue -------------------------------------------
In this example, you create two shared disksets, relo-red and relo-blue, from the host red. The host names are red and blue, each with their own local disksets. The metaset command shows the status. At this point, neither set has an owner. The host that adds disks to the set will become the owner by default.
The following conditions must be satisfied for a drive to be accepted into a diskset:
-----------------------------------------------
# metaset -s setname -a drivename... -----------------------------------------------
In this command,
--------------------------------------------------------------------
-s setname Specifies the name of a diskset on which metaset(1M) will work. -a Adds drives to the named diskset. drivename... Specifies the drives to add to the diskset. Drive names are in the form cxtxdx; no "sx" slice identifiers are at the end of the name. They need to be the same on all hosts in the diskset. --------------------------------------------------------------------
The first host to add a drive to a diskset becomes the implicit owner of the diskset.
------------
# metaset ------------
------------------------------------------------------------------------
red# metaset -s relo-red -a c1t2d0 c1t3d0 c2t2d0 c2t3d0 c2t4d0 c2t5d0 red# metaset Set name = relo-red, Set number = 1 Host Owner red Yes blue Drive Dbase c1t2d0 Yes c1t3d0 Yes c2t2d0 Yes c2t3d0 Yes c2t4d0 Yes c2t5d0 Yes Set name = relo-blue, Set number = 2 Host Owner red blue ------------------------------------------------------------------------
In this example, the host names are red and blue, each with their own local disksets. The two shared disksets are relo-red and relo-blue. The disks in the set relo-red are normally accessed by host red, but may be accessed by host blue if red fails. At this point, no disks have been added to the diskset relo-blue.
After you create a diskset, you can create metadevices and hot spare pools using the drives you added to the diskset. You can use either DiskSuite Tool or the command line utilities.
To use DiskSuite Tool to create DiskSuite objects in a diskset, make sure you are the diskset owner and enter the command line:
---------------------------------
# metatool -s diskset_name & ---------------------------------
Use the DiskSuite Tool tasks in this chapter to create DiskSuite objects, such as mirrors and trans metadevices.
After checking the prerequisites, use the metainit(1M) command to create DiskSuite objects in a diskset. Refer to the metainit(1M) man page for more information.
---------------------------------------------------
# metainit -s relo-red d51 1 1 /dev/dsk/c0t0d0s2 relo-red/d51: Concat/Stripe is setup # metainit -s relo-red d52 1 1 /dev/dsk/c1t0d0s2 relo-red/d52: Concat/Stripe is setup # metainit -s relo-red d50 -m d51 relo-red/d50: mirror is setup # metattach -s relo-red d50 d52 relo-red/d50: Submirror d52 is attached ---------------------------------------------------
This example creates a mirror, d50, in diskset relo-red.
This section describes how to create a new file system on a metadevice.
This task assumes you have installed Solstice Storage Manager on the host you are working with, and that you have launched the Storage Manager application. For more information, see Appendix A, "Using Storage Manager."
If you have appropriately configured DiskSuite Tool, select File System Manager from the DiskSuite Tool "Tools" menu.
If you have not configured DiskSuite Tool as such, you must first launch Storage Manager from the Solstice Launcher.
Note - To configure DiskSuite to work with Storage Manager, refer to "How to Enable DiskSuite to Launch Storage Manager (Command Line)."
File System Manager begins building the new file system on the metadevice.
After checking the prerequisites, and the preliminary information, use the newfs(1M) command to create a new file system on a metadevice. Refer to the newfs(1M) man page for more information.
----------------------------------------------------------------------------------
# newfs /dev/md/rdsk/d3 newfs: construct a new file system /dev/md/rdsk/d3: (y/n)? y /dev/md/rdsk/d3: 917280 sectors in 1638 cylinders of 7 tracks, 80 sectors 447.9MB in 103 cyl groups (16 c/g, 4.38MB/g, 2112 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 9072, 18112, 27152, 36192, 45232, 54272, 63312, 71712, 80752, 89792, 98832, 107872, 116912, 125952, 134992, 143392, 152432, 161472, 170512, 179552, 188592, 197632, 206672, 215072, 224112, 233152, 242192, 251232, 260272, 269312, 278352, 286752, 295792, 304832, 313872, 322912, 331952, 340992, 350032, 358432, 367472, 376512, 385552, 394592, 403632, 412672, 421712, 430112, 439152, 448192, 457232, 466272, 475312, 484352, 493392, 501792, 510832, 519872, 528912, 537952, 546992, 556032, 565072, 573472, 582512, 591552, 600592, 609632, 618672, 627712, 636752, 645152, 654192, 663232, 672272, 681312, 690352, 699392, 708432, 716832, 725872, 734912, 743952, 752992, 762032, 771072, 780112, 788512, 797552, 806592, 815632, 824672, 833712, 842752, 851792, 860192, 869232, 878272, 887312, 896352, 905392, 914432, # fsck /dev/md/rdsk/d3 ** /dev/md/rdsk/d3 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 2 files, 9 used, 942654 free (14 frags, 117830 blocks, 0.0% fragmentation) ----------------------------------------------------------------------------------
This example creates a file system on a concatenation named d3. The fsck(1M) command verifies the new file system.
----------------------------------------------------------------------------------
# newfs /dev/md/relo-red/rdsk/d33 newfs: construct a new file system /dev/md/relo-red/rdsk/d33: (y/n)? y /dev/md/relo-red/rdsk/d33: 917280 sectors in 1638 cylinders of 7 tracks, 80 sectors 447.9MB in 103 cyl groups (16 c/g, 4.38MB/g, 2112 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 9072, 18112, 27152, 36192, 45232, 54272, 63312, 71712, 80752, 89792, 98832, 107872, 116912, 125952, 134992, 143392, 152432, 161472, 170512, 179552, 188592, 197632, 206672, 215072, 224112, 233152, 242192, 251232, 260272, 269312, 278352, 286752, 295792, 304832, 313872, 322912, 331952, 340992, 350032, 358432, 367472, 376512, 385552, 394592, 403632, 412672, 421712, 430112, 439152, 448192, 457232, 466272, 475312, 484352, 493392, 501792, 510832, 519872, 528912, 537952, 546992, 556032, 565072, 573472, 582512, 591552, 600592, 609632, 618672, 627712, 636752, 645152, 654192, 663232, 672272, 681312, 690352, 699392, 708432, 716832, 725872, 734912, 743952, 752992, 762032, 771072, 780112, 788512, 797552, 806592, 815632, 824672, 833712, 842752, 851792, 860192, 869232, 878272, 887312, 896352, 905392, 914432, ----------------------------------------------------------------------------------
This example creates a file system on a concatenation name d33 in diskset relo-red.
Note - A file system that resides on a metadevice in a diskset cannot be automatically mounted at boot via the /etc/vfstab file. The necessary diskset RPC daemons (rpc.metad and rpc.metamhd) do not start early enough in the boot process to permit this. Additionally, the ownership of a diskset is lost during a reboot.
If You Want to Make the File System Available ... | Then ... |
---|---|
Now | Mount the file system with the mount(1M) command, specifying the metadevice name as the mount device, such as /dev/md/dsk/d30. |
Automatically when the system boots | Create or modify the file system's entry in the /etc/vfstab file, using the metadevice block and raw device names. |
As a shared (exported) resource | Create a file system entry in the /etc/dfs/dfstab file. |