Solaris Tips

Solstice DiskSuite/Sun Volume Manager:
Using swap for State Replica Database

If you have some experience with Solaris on Sun hardware, you already know that almost all machines lack hardware RAID. Instead, you use Solstice DiskSuite, renamed in Solaris 9 to Sun Volume Manager.

Solstice DiskSuite (SDS for sort) saves its configuration in the State Replica Database, mantained through the use of metadb(1M), which gives it its knickname, in the disks. The usual way to install a Solaris server with two disks is to layout the filesystems in the first disk and, after install, convert those filesystems to mirrored metadevices. And, usually, you have to dedicate a small slice for the State Replica Database

Now I will explain how to avoid this dedicated slice

SDS allows to put the metadb in any slice in any disk, provided this slice is not already mounted, assigned to a metadevice or open for other purpose. Usually, if you have just installed your server and used the whole disk for the swap slice and filesystems, your disk has no slices that in that state.

The trick is that you can put the State Replica Database in the beginning of a slice and use that slice, the remaining of it in fact, to create a metadevice.

Well, if you have read the page title, you surely already know what I am going to explain now.

The procedure

I assume your system disk is c0t0d0 and it will be mirrored in c0t1d0.

  1. Install Solaris as usual, lying out the filesystems in the first disk (or half the disks if the machine has 4 or more disks) without creating a dedicated slice for State Replica Database.
  2. Boot the system in single user mode (boot -s).
  3. Copy the VTOC or partition table to the disk you will mirror your filesystems on. (From the shell or using format.)
  4. Deactivate the swap. Assuming your fist disk is c0t0d0 and that swap has been configured in slice 1 as standard, execute:
    # swap -d /dev/dsk/c0t0d0s1
    
  5. Create the State Replica Database in the swap slices:
    # metadb -a -f -c 2 c0t0d0s1
    # metadb -a -c 2 c0t1d0s1
    
  6. Create the Concat/Stripe metadevices that will form the mirrored swap metadevice:
    # metainit d11 1 1 c0t0d0s1
    d11: Concat/Stripe is setup
    # metainit d12 1 1 c0t1d0s1
    d12: Concat/Stripe is setup
    
  7. Create the mirror metadevice:
    # metainit d10 -m d11
    d10: Mirror is setup
    # metattach d10 d12
    d10: Submirror d12 is attached
    
  8. Activate your new swap:
    # swap -a /dev/md/dsk/d10
    
  9. Create the mirror for the remaining slices as usual.
  10. You are done!

That is it. Quick, simple and harmless.

Do not forget to change /etc/vfstab!

1