Setting up RAID-5 in Solaris

solaris.jpg In Solaris, you can set up a software RAID-5 if you have enough of the drives. Here’s a quick howto:
First you would find the drive designations. Take for example:
c0t2d0s7 c0t3d0s7 c1t4d0s7 c1t5d0s7 c1t6d0s7 c1t7d0s7
At the prompt, you would add them to the database with the metadb command:
#metadb -a -f c0t2d0s7 c0t3d0s7 c1t4d0s7 c1t5d0s7 c1t6d0s7 c1t7d0s7
To check if they were added, you would get the information from the metadb command:
#metadb -i
To add all of the drives into a RAID volume, assign a number to your raid. You can use pretty much any digit but most people use single digits since they don’t have that many RAID volumes. I’ve used d9 in the example:
#metainit d9 c0t2d0s7 c0t3d0s7 c1t4d0s7 c1t5d0s7 c1t6d0s7 c1t7d0s7
Then you just wait as it initializes the volume. To check the status of the RAID volume, you use the metastat command:
#metastat d9
Finally the last thing you have to do is create a file system on the RAID volume:
#newfs -i 8192 /dev/md/rdsk/d9
Obviously this system would need to be mounted after the filesystem is in place, so you make a directory, mount the volume, and set the vfstab.
#mkdir /db9
#mount -F ufs /dev/md/dsk/d9 /db9

In vfstab add the line:
/dev/md/dsk/d9   /dev/md/rdsk/d9   /db9   ufs   2   yes   –
And there you go. Your very own software RAID-5 on a Solaris box.

  • Rovshan Pashayev

    but how to set hot-spare in this example