Solaris: Disk Mirroring with DiskSuite
Contents
Disk Layout
Keep two slides of 100MB available on each disk for the metadb state replicas.
Duplicate the disk layout
# prtvtoc /dev/rdsk/cXXdXXdXXs2 | fmthard –s - /dev/rdsk/cYYdYYtYYs2
Create the metadb replicas
Use the following commands to create the replicas on each disk.
# metadb –a –f –c 2 /dev/rdsk/cXXdXXtXXsX
# metadb –a –c 2 /dev/rdsk/cYYdYYtYYsY
Setup a mirror of a filesystem that can be umounted
# umount /your_fs
# metainit d10 1 1 cXXdXXtXXsX
# metainit d20 1 1 cYYdYYtYYsX
# metainit –m d30 d10
# metattach d30 d20
Use “metastat” to verify when the disk syncing completed. Update “/etc/vfstab” to the new created mirror “/dev/md/(r)dsk/d01 and remount the filesystem.
# mount /your_fs
Setup a mirror of a filesystem that can not be umounted
# metainit –f d11 1 1 cXXdXXtXXsX
# metainit d21 1 1 cYYdYYtYYsY
# metainit –m d02 d11
Update “/etc/vfstab” to the new created mirror “/dev/md/(r)dsk/d02 and reboot the system.
After the system is rebooted attach the second sub-mirror.
# metattach d31 d21
Use metastat to verify the syncing, don’t reboot the system until the syncing completed.
Setup a mirror of the swapspace
See “Setup a mirror of a filesystem that can not be umounted”
Setup a mirror of the root file system
# metainit d12 1 1 root_device
# metainit d22 cYYdYYtYYsY
# metainit –m d33 d12
# metaroot d03
The metaroot command will update /etc/vfstab, verify that “/” is set to the new created mirror. Sync the filesystems and reboot the system.
# sync; sync # reboot
When the system is rebooted attach the second submirror
# metattach d33 d22
Crashdump device
Update your crashdump device to the mirrored swap device.
# dumpadm -d swap
:x