Solaris 9 Volume Manager - two disk system mirroring question

Posted on 2006-06-08
Last Modified: 2013-12-27
I've got a system with two 70gb scsi drives c0 & c1 with Solaris 9 04.

I've created hard partitions for the system disk including root /, /var, /opt, /usr on c0t0d0.  I used c0t0d0s7 for the state database replica and created 4 on that slice.  I created a slice for Solaris VM on c0t0d0s6 with the remainder of the disk drive.  On that slice I created 3 separate soft partitions that each correspond to a different filesystem including /export/home and two application filesystems.  

Is it possible to mirror this disk and its soft partitions to the c1t0d0 even though the system disk consists of hard partitions?
Question by:nsome

    Author Comment

    When creating a mirror for system filesystems, are you supposed to create individual concatenations for each (/, /var, /usr, /opt) or one containing all into a single concatenation that you want to mirror?
    LVL 20

    Accepted Solution

    > Is it possible to mirror this disk and its soft partitions
    Sure, the hard partitions just become simple Disksuite metadevices and the mirroring is done of one hard partition to an (equal sized) partition on one or more "spare" disks.

    > are you supposed to create individual concatenations...
    You _could_ have var, opt & usr as simple directories in a big /  filesystem on a big slice and then just mirror that slice - But I'd have them as seperate slices.

    The links yuzh gave you in http:Q_21853096.html#16696329 are good reading, but for a simple recipe, check out  Actually, I find his naming convention confusing, so I create metadevices like so:
    metainit -f dN1 1 1 c0t0d0sN
    metainit -f dN2 1 1 c0t1d0sN
    metainit dN0 -m dN1

    i.e. dN0 is the mirrored metadevice with 2 sub-mirrors, dN1 and dN2;  The N roughly corresponds to the slice number, though there are restrictions on the names you can use for metadevices (I don't think Disksuite allows d01 or numbers > d150 for example).  But so long as you work out a convention & stick with it, it's easy to "read" later

    LVL 38

    Expert Comment

    Please read this note for root disk mirroring (I wrote it for E250, the procedure
    apply to Solaris 8/9, for Solaris 9 SVM install by default, and you don't need to add the  Solstice DiskSuite 4.2.1)

    Part      Tag    Flag     Cylinders        Size            Blocks
      0       root    wm    1087 - 3260        4.88GB    (2174/0/0) 10243888
      1        var    wm    3261 - 4130        1.95GB    (870/0/0)   4099440
      2     backup    wm       0 - 7505       16.86GB    (7506/0/0) 35368272
      3       swap    wu       0 - 1086        2.44GB    (1087/0/0)  5121944
      4 unassigned    wm       0               0         (0/0/0)           0
      5 unassigned    wm    4131 - 7498        7.57GB    (3368/0/0) 15870016
      6 unassigned    wm       0               0         (0/0/0)           0
      7 unassigned    wm    7499 - 7505       16.11MB    (7/0/0)       32984

      Note: slice 7 for metadatabase. (mirroring)

       Disk 2 (identical to disk 1)

    Boot Disk Mirroring Setup use Solaris Volume Manager (Solaris 9):

     Note: for Solaris 8 need to install Solstice DiskSuite 4.2.1 from Software CD 2 of 2:
           cd /cdrom/sol_8_401_sparc_2/Solaris_8/EA/products/Disksuite_4.2.1
           pkgadd -d .         (will install all packages including GUI)
           Respond: all,y,y,y

           Following are the minimum required packages:
           SUNWmdr Solstice DiskSuite Drivers (root)
           SUNWmdu Solstice DiskSuite Commands
           SUNWmdx Solstice DiskSuite Drivers (64-bit)

           Note: GUI tools /usr/opt/SUNW/md/sbin/metatool &

    1) Important to backup the following files:
        cp -p /etc/system /etc/

        cp -p /etc/vfstab /etc/

        In case /etc/system gets messed up, we can still use the command boot -a from the OK
        prompt and specify by using:

    2) Make sure that 2nd disk are identical to disk 1

    3) copy the disk 1 layout to disk 2:
       The VTOC (volume table of contents) on the root disk and root mirror must be the same.
       Copy the VTOC using prtvtoc and fmthard.

       # prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t8d0s2

    4) Craete metadatabase on the small slice: ( on sds partion )
       metadb -a -f -c 2 /dev/dsk/c0t0d0s7     /dev/dsk/c0t8d0s7        

    5) Create a mirror for each and every slice in the partion table:

       for i in 0 1 3 5 ; do
         metainit -f d1$i 1 1 c0t0d0s$i    # disk 1
         metainit -f d2$i 1 1 c0t8d0s$i    # disk 2  for E250 use t8
         metainit -f d$i -m d1$i           # mirror device (one-way)

    d10: Concat/Stripe is setup
    d20: Concat/Stripe is setup
    d0: Mirror is setup
    d11: Concat/Stripe is setup
    d21: Concat/Stripe is setup
    d1: Mirror is setup
    d13: Concat/Stripe is setup
    d23: Concat/Stripe is setup
    d3: Mirror is setup
    d15: Concat/Stripe is setup
    d25: Concat/Stripe is setup
    d5: Mirror is setup

       Set the metadevice d0 is the root device
       metaroot d0

       the metaroot command add the followings to /etc/system file:
       * Begin MDD root info (do not edit)
       forceload: misc/md_trans
       forceload: misc/md_raid
       forceload: misc/md_hotspares
       forceload: misc/md_sp
       forceload: misc/md_stripe
       forceload: misc/md_mirror
       forceload: drv/pcipsy
       forceload: drv/glm
       forceload: drv/sd
       * End MDD root info (do not edit)

       and modify the following line in /etc/vfstab file:
       /dev/dsk/c0t0d0s0      /dev/rdsk/c0t0d0s0      /       ufs     1       no -  
       /dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      -

    6) Edit /etc/vfstab to mount the new mirrors on boot:
       change /dev/dsk/c0t0d0s to /dev/md/dsk/d
       change /dev/rdsk/c0t0d0s to /dev/md/rdsk/d

    7) Reboot the system to swith to the metadevices.
       verify the metadevice setup:
       metastat -p

       Suppress warning messages (optional):
       metainit hsp001

    8) Attach the 2nd submirrors to make 2-way mirrors:
       for i in 0 1 3 5 ; do
          metattach d$i d2$i  

    d0: submirror d20 is attached
    d1: submirror d21 is attached
    d3: submirror d23 is attached
    d5: submirror d25 is attached
       This will resync all mirrors simultaneously in the backgroud.

    9) Enable the mirror disk to be bootable:
        installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \

        Note: in your case the 2nd might be  /dev/rdsk/c0t1d0s0

    In case you need to boot from the mirror disk, at OBP promt type in:

    to find out the name of your 2nd disk, eg, disk1, then you can do:
    boot disk1

    to boot from the mirror disk

       PS: you need to change the partion numbers to your read disk layout.


    Author Comment

    Before yuzh posted the above procedure, I began using tfewster's link

    After init 6 reboot, for some reason mirror containing of slice 6 from each disk complained about a bad boot block and it couldn't get fisked.  This slice was to contain application volumes - system filesystem mirrors seemed to be fine /, /usr,/var and /opt as they all were contained within a mirror instead of a slice.

    Now I'm running into the following when trying to su.  I can login fine on the console.  As root on the console, I can su - uname to another username fine.  From that username to root it behaves the same...which seems like a permissions issue after the mirror on usr or something else...

    su: Unknown id: root
    LVL 38

    Expert Comment

    You need to use the Solaris CD to boot up the box to single user mode, the mount /dev/dsk/c0t0d0s0 and check if passwd shdow
    files corrupted, if not check the vfstab file to make sure there is no typo in the file.

    assume the mount point is /mnt, you need to look at /mnt/etc dir
    for the files.

    also check your real disk layout against the procedure, to make sure that you have done everything correctly.

    Have a nice weekend to all of you, cheers!
    LVL 20

    Expert Comment

    Please post your /etc/vfstab plus the output of `metastat -p` and `prtvtoc dev/rdsk/cXtYd0s2`  (fill in X and Y as appropriate, for the boot and mirror disk)

    Is /usr mounted with the "nosuid" option?

    Author Comment

    It was an issue with nosuid on it!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
    Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Video by: Phil
    This video goes over how to configure and start a jail in FreeBSD.  This video is meant to supplement the article included with this course.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now