• You are not authorized to post comments.
  • You are not authorized to post comments.

Unix Tip: Mirroring your root partition with Solaris Volume Manager

By Sandra Henry-Stocker, ITworld.com |  Hardware Add a new comment


Digg!


Send in your Unix questions today! |
See additional Unix tips and tricks


Solaris Volume Manager can make easy work of mirroring your root file system, but you have to use the right commands in the right sequence to make easy work of this task. In this week's column, we'll run through each of the commands required to mirror root and show how you can check on what is happening in each step.


First, let's set the stage for our example system. We have a new Solaris 10 installation on a system with two internal disks and a disk array that we'll set up later. Each of the internal disks has been partitioned identically.

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm    1452 - 23167       29.92GB    (21716/0/0) 62737524
  1        var    wm   23168 - 24567        1.93GB    (1400/0/0)   4044600
  2     backup    wm       0 - 24619       33.92GB    (24620/0/0) 71127180
  3       swap    wu       0 -  1451        2.00GB    (1452/0/0)   4194828
  4 unassigned    wm       0                0         (0/0/0)            0
  5 unassigned    wm       0                0         (0/0/0)            0
  6 unassigned    wm       0                0         (0/0/0)            0
  7   reserved    wm   24568 - 24619       73.35MB    (52/0/0)      150228

The first thing we need to do is create the state database replicas. These are the data structures that store information about your volume configuration. We'll create multiple copies to ensure that we can recover if one copy becomes corrupt. You'll notice that we left a small partition for the state database replicas. We will now use the metadb -a -f command to create the replicas even if no database copies already exist. That -f option stands for "force".

# metadb -a -f c0t0d0s7 c0t1d0s7

In this example, we've only created two replicas, but you might want to create four or more to give you even better protection against potential problems. Database replicas can be created on dedicated slices or on slices that will become part of a concatenation or stripe.



To examine what we've done so far, we can use the metadb command without arguments:

# metadb
        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c0t0d0s7
     a        u         16              8192            /dev/dsk/c0t1d0s7

Now, we're going to use the metainit command to create a RAID 0 volume. Your choice of labels is flexible, but the convention we'll be using in this example is to name mirror components (or "submirrors") dx1 and dx2 and the mirrored device dx0 where "x" is a digit of 1 or more. Our root mirror will be d10, so our submirrors will be d11 and d12.

# metainit -f d11 1 1 c0t0d0s0
d11: Concat/Stripe is setup

The -f option is another "force" command. It tells metainit to create the submirror even if the slice contains a mounted file system.

ITworld LIVE

HardwareWhite Papers & Webcasts

White Paper

Deliver Cost-Effective Business Continuity with Extreme Capacity

IBM DB2 provides application cluster transparency technology that equips organizations running OLTP applications with the ability to deliver high availability and continuous uptime for transactional data, plus the flexibility and capacity they need to remain competitive.

White Paper

Expert Tips for Consolidating Servers & Avoiding Sprawl

The combined computing demands of VMs can tax even the most powerful server. Cost-effectiveness doesn't mean excessive consolidation; rather, it means balancing workloads between multiple servers. This expert FAQ guide will help you to decide which servers and applications are candidates for virtualization.

White Paper

Expert Guide to Secure Your Active Directory

Layered security is the way to go when it comes to protecting Active Directory. This expert e-guide explains the best method to use when planning and designing a security solution. Find out why it is important to secure Group Policy settings and discover how managed service accounts boost server security in R2.

White Paper

Windows Server 2008 R2 Learning Guide

This expert e-guide uncovers the most common questions that have surfaced with Windows Server 2008 R2. Learn details about this Microsoft operating system and discover the direct cost saving benefits IT departments can experience when making the switch.

White Paper

Best Practices to Achieve Optimal Memory Allocation and Remote Desktop User Experience

Many virtual machines don't fully utilize their available RAM, just like they don't fully utilize their available processors. But Dynamic Memory enables you to shuffle the deck and move some of that RAM around to go where it's needed for better consolidation and efficiency.

See more White Papers | Webcasts

Ask a question

Ask a Question