From the computer of: bofh468
(3 recipes)
Created: Nov 13, 2003 Updated: Mar 30, 2004
This describes how to install Software raid using Solstice Disksuite. First, you need to grab the DiskSuite packages from Sun. It's a free download, but you do need to create a sunsolve account to get it.
You can find a download link for the software at http://wwws.sun.com/software/solaris/get.html. It's about half-way down that page.
Install the packages - There's an installer included. Don't bother. Just pkgadd the individual packages. There's only 5 or so.
Once you're done that, you'll need to determine how you want to lay out your disks. The following assumes that:
1 - You have 2 disks - c0t0d0 (disk0) and c0t1d0 (disk1).
2 - The system installed only on disk0, and disk1 is unused.
3 - Each disk has the following slices:
0 - /
1 - swap
2 - whole-disk
3 - unassigned 64-MB
4 - unassigned 64-MB
Adjust the above to match whatever your preferred layout is. This is only for a simple example. Slices 3 and 4 are for Meta-Database logging. If you don't have 128MB of free space to spare, then try and make some space (ie., sacrafice some swap if you have to).
Disclaimer: Before you continue, I can't stress enough. Make backups. I always do this procedure during system installation, and I do it routinely. Although your data is supposed to survive and actually migrate without incident, I have seen DiskSuite eat a system once or twice - usually due to operator error.
Make backups.
You need to duplicate your layout from disk0 to disk1. It's fairly important that the disk geometry matches. Metadevices work at the block-level of the disk, and if one disk has fewer blocks than the other you'll wind up making a mess. Once you're sure you're ready to proceed, dump the layout from disk0 to disk1 thusly:
Second, you need to create your meta-databases. This is for logging, and all but eliminates the need for fsck to run after a dirty shutdown. Do the following:
This adds (-a) 2 (-c for count) meta-databases in each of the slices. If you have more disks, you can span the databases across multiple disks for better performance and fault-tolerance.
The next step is to create your raid-devices. In a two-disk system, you're stuck with Raid0 and Raid1. Since Raid0 is almost pointless (you're doing this for redundancy, remember?!), we'll go with Raid1 - mirrored disks.
We'll deal with the following raid devices and members:
d0 - / mirror
d10 - /dev/dsk/c0t0d0s0
d20 - /dev/dsk/c0t1d0s0
d1 - swap
d11 - /dev/dsk/c0t0d0s1
d21 - /dev/dsk/c0t1d0s1
The device names are somewhat arbitrary. In a simple setup like this, I use d0 to match up with a mirrored slice0, and d10 to indicate member 1 of d0 (member 1 d0 = d10, member 2 d0 = d20).
So create the raid devices and members:
This initializes the devices. The command "metastat" will show you that the devices exist, but the mirror-halves aren't attached. So let's attach them:
You've just attached the first half of the mirror. Yes, this is the disk that you're currently running on. Your data is still there.
Next, you need to ensure the system will use the metadevices. The root-filesystem is easy:
Next, you need to edit /etc/vfstab to change the swap device to use /dev/md/dsk/d1 as swap. While you're in there, turn on logging under the mount options for the root filesystem (d0). Double-check that you haven't screwed up. Save and exit if it all looks good.
Once you're done, issue the following:
Watch your system come up. There will be some new messages, most notably the kernel complaining about not being able to forceload three raid modules:
You can ignore these messages. They're harmless. Basically, you haven't created any raid-devices that require those modules so they're refusing to load.
Now that your system is up (You didn't mess up vfstab, did you?!), you need to finish off the process. Log in and do this:
You'll notice that your system is now a little slower, both commands took a moment to return, and your disks are going nuts. Look at the output of "metastat" and you'll see why - your disks are syncing.
You'll need to install the bootsector to your second disk so that you can boot from it. This is fairly easy to do:
You might also want to set the OBP to boot from disk1 if it can't boot from disk0. If you bring the machine to the OBP (ok) prompt via init 0, you can enter the following:
This will set up a failover boot to disk1. The very last command there will also boot from disk1, proving to you that this works. Do be sure to substitute the correct disk for "disk1".
You now have your root filesystem and swap space sitting on raid1 volumes. This means that losing a disk no longer means that you have to rebuild your system. Now you just need to replace a disk.
I strongly suggest that you read through DiskSuite's docbook at Sun's online documentation site (docs.sun.com). There's a lot more that you can do with it that's not covered here. Oh, and you'll probably want to read up on how to actually replace a failed disk. :)
(If there's enough interest, I might be coerced into posting a howto on that)
Subscribe to the Tech-Recipes Newsletter
You can get tips like this delivered in your email every week!
We will never, ever sell your email address or spam you.
9 Recipe comments: View comments
Solaris software RAID by Anonymous
Re: Solaris software RAID by qmchenry
Nice article 5 star by Anonymous
Re: Solaris software RAID by Anonymous
Re: Solaris software RAID by Anonymous
Re: Solaris software RAID by Anonymous
Re: Solaris software RAID by Anonymous
size of replicas by drhuh
Re: Solaris software RAID by praxis22
Related recipes:
Solve Solaris metadb or metainit: Segmentation Fault errors
ZFS: Create a raidz filesystem
begin_script to mirror two drives on a Netra T2000
ZFS: Ten reasons to reformat your hard drives
Solaris 10: connect or login to zone console
Remove a Solaris package with pkgrm
Change BootPROM settings from the Solaris command line
Change Solaris DNS client settings
Solaris 10: shutdown or stop a zone
Mount an ISO image on a Solaris filesystem with lofiadm
Sponsored links
Login
Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.Search
Tech Recipes
· Home
· Mac OS X
· Solaris
· Windows
· Programming
· UNIX
· Cisco
· MySQL
· Google
· Instant messaging
· Add recipes
· Leave feedback
· Recommend us
· RSS Syndication
Hot recipes
Make XP look like Windows Vista / Longhorn for free!
SMS through E-Mail: Cingular, Nextel, Sprint, T-Mobile, Verizon, Virgin Mobile
XP: Small, Free Way to Use and Mount Images (ISO files) Without Burning Them
Vista: Should I Install 64-bit or 32-bit Version? (x64 vs x86)
How Do I Use or Open Bin, Cue, or ISO Files?
Hacks to Beat Rapidshare Download Limits and Waiting Time
MySpace Hack: View Pictures and Comments on a Private Profile
MySpace: Hack to Download Any Song on MySpace
Who's Online
There are currently, 2867 guest(s) and 2 member(s) that are online.
You are Anonymous user. You can register for free by clicking here
Information
Wish to advertise with us?
All logos and trademarks in this site are property of their respective owner. The comments and forum posts are property of their posters, all the rest © 2003-2007 by QD Ideas, LLC.
Users of this site are legally bound by the Terms and conditions and Disclaimer. Do not use this web site if you do not agree with these policies.
The members, admins, and authors of this website respect your privacy.
Page Generation: 1.65 Seconds
Fri Aug 8 13:58:02 2008