Setting Up RAID Volumes with Solaris Volume Manager, Part 2

Be the first to comment | 3I like it!
May 25, 2005, 07:39 AM —  ITworld.com — 

In last week's column, we examined the process of setting up RAID volumes on a Solaris 9 server. The process is surprisingly straightforward when there are no file systems on the target disks or partitions. When file systems occupy the target space, they have to be backed up and then reloaded for RAID 5. For mirrored volumes, on the other hand, you can set up your volume in such a way as to preserve the initial partition's contents. In this column, we'll look at how these things are done.



RAID 5 for File Systems



Let's says that we want to turn the /var partition on our new Solaris 9 server into a RAID 5 volume. One way to back up its contents is to use a ufsdump command to copy the file system to another location on the disk. A command such as this will copy /var quite expediently (you need to create /var-bkp first):




# ufsdump 0f - /dev/rdsk/c0t0d0s5 | (cd /var-bkp/; ufsrestore xf -)



The 0f argument in this command specifies that we want a full dump and that we will specify the device that we are writing to. The - argument says that we're not really writing to a device at all; instead we are going to pipe the dump output to another command. The /dev/rdsk/c0t0d0s5 argument is, of course, our /var partition.



On the right side of the pipe, we have grouped two commands -- one to move into the /var-bkp directory and another to extract the contents from the dump. When this command completes, /var-bkp looks the same as /var.



Since the system won't allow us to unmount /var, we'll just make some changes to /etc/vfstab and reboot the system to use the backup as /var. To do this, we first comment out the mount line for /var from /etc/vfstab. Then, we move /var to /var-orig (to get the mount out of the way), move /var-bkp to /var and reboot:


# mv /var /var-orig
# mv /var-bkp /var
# reboot


At this point, /var is simply a subdirectory in root and partition 5 is not mounted. We can, therefore, proceed with our construction of the new RAID 5 volume using a metainit command such as this:


# metainit d5 -r c0t0d0s5 c0t1d0s5 c0t2d0s5d5: RAID is setup


Again, metainit has not completed the configuration of the volume when it spits out "RAID is setup". It will take a while longer and we can use the metastat command to watch its progress. The new volume will be ready when the state is "Okay":



# metastat | grep State
    State: Okay



Once the RAID volume is ready, we can build a new file system with newfs, mount the volume on a temporary mount and then copy the contents of /var-bkp (now /var) back to what will become the new /var. The newfs and mount commands will look like this:



# newfs /dev/md/rdsk/d5
# mkdir /var-new
# mount /dev/md/dsk/d5 /var-new

Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
peer-to-peer

Esther Schindler
If the comments are ugly, the code is ugly

claird
SVG a graphics format for 21st century

pasmith
Take Chrome OS for a test spin

Sandra Henry-Stocker
Solaris Tip: Have Your Files Changed Since Installation?

sjvn
64-bits of protection?

jfruh
Android fragments vs. the iPhone monolith

mikelgan
What Gizmodo missed about the Pro WX Wireless USB disk drive

 

Sidekick: The Good News & the Bad News
Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325

Join the conversation here

The Daily Tip

The Daily TipQuick, practical advice for IT pros. Made fresh daily.

Hot tips:

Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.

Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.
Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace