Difference between revisions of "Mirroring Disks"

From Peter Pap's Technowiki
Jump to: navigation, search
(Created page with "In Solaris 10, you can mirror the disks during the build process with Jumpstart, or even use ZFS mirroring. However, on older systems, you need to mirror the disks the old fashi...")
 
Line 12: Line 12:
 
Once they are installed, reboot the box.  It wouldn't hurt to do an 'init 0' and then a 'boot -r'!
 
Once they are installed, reboot the box.  It wouldn't hurt to do an 'init 0' and then a 'boot -r'!
  
2.
+
2. Copy the primary disks VTOC to the secondary disk:
 +
 
 +
  prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
 +
 
 +
3. Create the metadatabases
 +
 
 +
  metadb -f -a -c3 /dev/dsk/c1t0d0s7
 +
  metadb -f -a -c3 /dev/dsk/c1t1d0s7
 +
 
 +
4. Create and initialise the metadevices on the primary disk
 +
 
 +
  metainit -f d10 1 1 c1t0d0s0
 +
  metainit -f d10 1 1 c1t0d0s1
 +
  metainit -f d10 1 1 c1t0d0s3
 +
  metainit -f d10 1 1 c1t0d0s4
 +
  metainit -f d10 1 1 c1t0d0s5
 +
  metainit -f d10 1 1 c1t0d0s6
 +
  metainit d0 -m d10
 +
  metainit d1 -m d11
 +
  metainit d3 -m d13
 +
  metainit d4 -m d14
 +
  metainit d5 -m d15
 +
  metainit d6 -m d16
 +
 
 +
5. Assign the root metadevice
 +
 
 +
  metaroot d0
 +
 
 +
6. Edit /etc/vfstab and make sure that all the devices are changed to metadevices.  So each line that looked like this
 +
 
 +
  /dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3  /var  ufs  1 no    -
 +
 
 +
now looks like
 +
 
 +
  /dev/md/dsk/d3 /dev/md/rdsk/d3  /var  ufs  1 no    -
 +
 
 +
7. Run the lockfs command and reboot
 +
 
 +
  lockfs -fa
 +
  reboot

Revision as of 01:13, 11 October 2010

In Solaris 10, you can mirror the disks during the build process with Jumpstart, or even use ZFS mirroring. However, on older systems, you need to mirror the disks the old fashioned way with DiskSuite 4.2.1. In this example, the file names for the two disks being mirrored are c1t0d0sX and c1t1d0sX.

1. You need to make sure the following packages are installed first:

 SUNWmdr SUNWmdu SUNWmdx

This is the least you need to install! Oh and they will need to bzip to install successfully! They can be found on "Solaris 8 Software CD 2" (not sure for Solaris 9, but they could be part of the standard disto), in the following location:

 cd $PATH_TO_CDROM/Solaris_8/EA/products/DiskSuite_4.2.1/sparc/Packages
 pkgadd -d . SUNWmdr SUNWmdu SUNWmdx

Once they are installed, reboot the box. It wouldn't hurt to do an 'init 0' and then a 'boot -r'!

2. Copy the primary disks VTOC to the secondary disk:

  prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2

3. Create the metadatabases

  metadb -f -a -c3 /dev/dsk/c1t0d0s7
  metadb -f -a -c3 /dev/dsk/c1t1d0s7

4. Create and initialise the metadevices on the primary disk

  metainit -f d10 1 1 c1t0d0s0
  metainit -f d10 1 1 c1t0d0s1
  metainit -f d10 1 1 c1t0d0s3
  metainit -f d10 1 1 c1t0d0s4
  metainit -f d10 1 1 c1t0d0s5
  metainit -f d10 1 1 c1t0d0s6
  metainit d0 -m d10
  metainit d1 -m d11
  metainit d3 -m d13
  metainit d4 -m d14
  metainit d5 -m d15
  metainit d6 -m d16

5. Assign the root metadevice

  metaroot d0

6. Edit /etc/vfstab and make sure that all the devices are changed to metadevices. So each line that looked like this

  /dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3  /var  ufs   1 no    -

now looks like

  /dev/md/dsk/d3 /dev/md/rdsk/d3  /var  ufs   1 no    -

7. Run the lockfs command and reboot

  lockfs -fa
  reboot