LinhNamVu? - 30 Jan 2007
Setting up RAID on a Solaris 10 6/06 Machine
Install OS
Insert disks (make sure you have the right architecture (sparc,x86))
Install OS (to boot into selected media use STOP+A, then use
More detailed
instructions from sun. Also keep in mind how you want to setup your partitions/disks.
Partitioning
If you want to just mirror the same partitions as installed the OS:
Copy partition layout to other disks with
-
prtvtoc /dev/rdsk/c#t#d#s# | fmthard -s - /dev/rdsk/c#t#d#s#
If you want to create you're own partition setup then create it on one of the empty disks
To format a disk use:
Then make sure the other disks you want in the RAID to have the same partition layout as the one you have
-
prtvtoc /dev/rdsk/c#t#d#s# | fmthard -s - /dev/rdsk/c#t#d#s#
Setup RAID
Choose a naming convention of metadevices for RAID
- dXY (X = disk number in raid) (Y = raid number)
Create devices
-
metainit -f d10 1 1 /dev/dsk/c#t#d#s#
-
metainit -f d20 1 1 /dev/dsk/c#t#d#s#
-
metainit -f d30 1 1 /dev/dsk/c#t#d#s#
-
etc...
Create RAID device.This command will create the initial metadevice for our raid
Attach the first device
-
metattach -f d0 d10 (note: there is one less 'a' in metattach)
The created metadevices will be located in /dev/md/dsk/DEVICE_NAME_HERE
If you are creating a metadevice for the partition that the systems boots off of then you'll need to edit /etc/vfstab and reboot the system and boot into the new metadevice settings. If not you can ignore this step.
-
vi /etc/vfstab
-
lockfs -fa
-
init 6
Attach remaining devices
-
metattach -f d0 d20
-
metattach -f d0 d30
-
etc...
If you want to be able to boot off the other disk if the first one fails then
-
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0
-
setenv boot-device disk disk1
-
nvstore
-
boot disk1
Maintanence
You can see the status of the disks using
metastat . If you want to see the progress of the syncing then use
metastat -c . In the event one of the drives goes missing, that command will show you. Once you re-insert the new drive you can create it with the above steps and attach it. Running
metastat will show that the drive needs maintanence and running
metasync will tell it that it can start syncing again.
metastat -c will now show the sync progress.