Below are the steps, can you please edit those as per my / /var and /u01 mirroring, IT WILL MOST USEFUL HELP FOR ME EVER.
For this procedures, we will be mirroring all the slices of the local boot disk (c0t0d0) to another local disk (c1t0d0). You will have to make the appropriate changes for your system.
Reminders before you start:
- a slice is required for state database (also called replica or metadb)
- the local disks need to be identical and need to have the same partition layout
- for each partition on your boot disk (/, /usr, /var, /opt, /export/home, or any other partition you may have), you must create minimum of 3 new meta devices: one for the existing slice, one for the slice on the mirrored disk, and one for the SVM mirror
A) How to mirror the boot disk
A1) Prepare the partitions of the boot disk (c0t0d0) and the rootmirror disk (c1t0d0)
A1a) Be sure you have a slice 7 for state database on the boot disk.
To use slice 7 for replicas is a recommendation any other slice can be used. Furthermore slice 7 should have 32MB, but a size of 20MB should be the minimum.
A1b) Copy the partition table from boot disk (c0t0d0) to rootmirror disk (c1t0d0)
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c1t0d0s2
Be carefully with this command, write the vtoc to the right direction/disk!
A2) Initialize Solaris Volume Manager
# metadb -afc 3 c0t0d0s7 c1t0d0s7
Option -a for attach new replica device
Option -f is necessary if create the first replica on this system
Option -c 3 means to have 3 metadb copies on each disk's slice 7.
For conceptual information about state database please refer to
Chapter 6 - State Database (Overview) in Solaris Volume Manager Administration Guide
A2a) Optional: Only if you have an even number of disks or controllers for local replicas consider adding the following to file /etc/system
Why this flag? See
Document 1420334.1 Solaris Volume Manager (SVM): Understanding the Kernel Tunable Parameter "md:mirrored_root_flag"
A3) Initialize SVM root mirror (d0) for the root submirror partition (d1)
# metainit -f d1 1 1 c0t0d0s0
The option -f is required for active root
A3a) For rootmirror partition (d2)
# metainit d2 1 1 c1t0d0s0
A3b) Setup one-way mirror for the active root partition
# metainit d0 -m d1
Caution - Be sure to create a one-way mirror with the metainit command then attach the additional submirrors with the metattach command. When the metattach command is not used, no resynchronization operations occur. As a result, data could become corrupted when Solaris Volume Manager assumes that both sides of the mirror are identical and can be used interchangeably.
A4) Initialize SVM for all additional partitions of the boot disk (/var, /opt, …)
for swap mirror (d10):
# metainit -f d11 1 1 c0t0d0s1 (-f is required for active swap)
# metainit d12 1 1 c1t0d0s1
# metainit d10 -m d11
for /var mirror (d4):
# metainit -f d5 1 1 c0t0d0s4 (-f is required for active /var)
# metainit d6 1 1 c1t0d0s4
# metainit d4 -m d5
You can use this approach/example from /var for any other partition on the boot disk
A5) Modify /etc/vfstab for the boot disk
first make a copy for safety reasons
# cp /etc/vfstab /etc/vfstab.pre_svm
Change configuration for root in /etc/vfstab and /etc/system
# metaroot d0
This will change the entry for root in /etc/vfstab and put the entry 'rootdev:/pseudo/md@0:0,0,blk' to /etc/system
For additional partitions edit /etc/vfstab as follows:
for swap change from:
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/md/dsk/d10 - - swap - no -
for /var or any other partition on the boot disk change from:
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /var ufs 2 yes -
/dev/md/dsk/d4 /dev/md/rdsk/d4 /var ufs 2 yes -
Be carefully by editing /etc/vfstab, because boot can fail due to errors in /etc/vtstab!
A6) Activate one-way SVM boot mirror disk
# lockfs -fa
After the system has rebooted, you can verify that root and other slices are under SVM's control by running:
# df -k
# swap -l
A7) Attach second submirror to used SVM mirrors
# metattach d0 d2 ( root partition )
# metattach d10 d12 ( swap partition )
# metattach d4 d6 ( /var partition )
Verify the sync status of the SVM mirrors with
# metastat | grep sync
Once you have attached all the submirrors to the metamirrors, and all the syncing has completed, your boot disk is mirrored.
A8) Set the dump device to the correct device, using the command:
# dumpadm -d swap
Verify that the dump device is set correctly to swap with
A9) Set up Open Boot Prom (OBP) environment by following
Document 1504573.1 How to setup OBP/NVRAM parameter for SPARC if system is mirrored with Solaris Volume Manager?
and try to boot from aliases
ok boot rootmirror
ok boot rootdisk