Use this procedure to mirror user-defined file systems. In this procedure, nodes do not need to be rebooted.
Become superuser on a node of the cluster.
Put the slice on which a user-defined file system resides in a single slice (one-way) concatenation.
# metainit -f submirror1 1 1 disk-slice |
Create a second concatenation.
# metainit -f submirror2 1 1 submirror-disk-slice |
Create a one-way mirror with one submirror.
The metadevice name for the mirror does not need to be unique throughout the cluster.
# metainit mirror -m submirror1 |
Repeat Step 1 through Step 4 for each user-defined file system to be mirrored.
On each node, edit the /etc/vfstab file entry for each user-defined file system you mirrored.
Replace the names in the device to mount and device to fsck columns with the mirror name.
# vi /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/md/dsk/mirror /dev/md/rdsk/mirror /file-system ufs 2 no global |
Attach the second submirror to the mirror.
This attachment starts a sync of the submirrors.
# metattach mirror submirror2 |
Wait for the sync of the mirrors, started in Step 7, to complete.
Use the metastat(1M) command to view mirror status.
# metastat mirror |
If the disk used to mirror the user-defined file system is physically connected to more than one node (multiported), enable the localonly property of the raw disk device group for the disk used to mirror the user-defined file system.
You must enable the localonly property to prevent unintentional fencing of a node from its boot device if the boot device is connected to multiple nodes.
If necessary, use the scdidadm -L command to display the full device ID (DID) pseudo-driver name of the raw disk device group.
In the following example, the raw disk device group name dsk/d4 is part of the third column of output, which is the full DID pseudo-driver name.
# scdidadm -L ... 1 phys-schost-3:/dev/rdsk/c1t1d0 /dev/did/rdsk/d2 # scconf -c -D name=dsk/d2,localonly=true |
For more information about the localonly property, refer to the scconf_dg_rawdisk(1M) man page.
Use the scconf(1M) command to enable the localonly property.
# scconf -c -D name=rawdisk_groupname,localonly=true |
Specifies the name of the raw disk device group
The following example shows creation of mirror d4 to mirror /home, which resides on c0t0d0s4. Mirror d4 consists of submirror d14 on partition c0t0d0s4 and submirror d24 on partition c2t2d0s4. The /etc/vfstab file entry for /home is updated to use the mirror name d4. Disk c2t2d0 is a multiported disk, so the localonly property is enabled.
(Create the mirror:) # metainit -f d14 1 1 c0t0d0s4 d14: Concat/Stripe is setup # metainit -f d24 1 1 c2t2d0s4 d24: Concat/Stripe is setup # metainit d4 -m d14 d4: Mirror is setup (Edit the /etc/vfstab file:) # vi /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/md/dsk/d4 /dev/md/rdsk/d4 /home ufs 2 no global (Attach the second submirror:) # metattach d4 d24 d4: Submirror d24 is attached (View the sync status:) # metastat d4 d4: Mirror Submirror 0: d14 State: Okay Submirror 1: d24 State: Resyncing Resync in progress: 15 % done ... (Identify the DID name of the mirrored disk's raw disk device group:) # scdidadm -L ... 1 phys-schost-3:/dev/rdsk/c2t2d0 /dev/did/rdsk/d2 (Enable the localonly property of the mirrored disk's raw disk device group:) # scconf -c -D name=dsk/d2,localonly=true |
To create a diskset, go to "How to Create a Diskset".