- 论坛徽章:
- 2
|
本帖最后由 东方蜘蛛 于 2010-10-27 15:00 编辑
Management of RAID volumes by use of the Solaris raidctl command
Create a mirror
raidctl -c [-r 1] primary secondary
Create a stripe
raidctl -c -r 0 disk1 disk2 [disk3] ...
Delete a RAID volume
raidctl -d volume
Display RAID volumes
raidctl
Update HBA controller firmware
raidctl -F file controller
Examples
1.) Creating a mirror
To create a RAID1 mirror
raidctl -c [-r 1] primary secondary
Example:
# raidctl -c c0t0d0 c0t1d0
RAID volume c0t0d0 will be created
Data on all drives will be lost
No file systems may be mounted on either disk
Secondary must be as large as primary
RAID volume has the capacity of one disk
2.) Creating a stripe
To create a RAID0 stripe
raidctl -c -r 0 disk1 disk2 [disk3] ..
Example:
# raidctl -c -r 0 c0t1d0 c0t2d0 c0t3d0
RAID volume c0t1d0 will be created
Data on all drives will be lost
No file systems may be mounted on any disk
RAID volume has the capacity of all disks
combined - smallest common size is used
After RAID volume creation
Member disk drives are no longer visible, only the RAID volume is presented
The RAID volume may be addressed as any other LUN in Solaris
The status of the RAID volume and it's member disks may be retrieved using raidctl(1M)
Each LSI1064 HBA supports up to 2 RAID volumes at any one time
Volumes must be labeled after creation before they can be used under Solaris
Labeling Volumes After Creation
After creating a RAID volume by using 'raidctl' or by using OBP level commands the volume must be labeled correctly before it can be used. This can be done using the 'format' command in Solaris:
As the root user run 'format' and choose the newly created volume from the list of drives.
(you may see some messages about the volume having a corrupt label or the block count being incorrect when booting or running format, this is due to the need for a correct label)
After the volume is selected chose "type" from the format menu, this will give you a list of available drive types to chose from.
Chose "0. Auto configure" from the list. This will define the volume with the correct type.
Then write the new label to the volume using the "label" command from the format> prompt. The system will ask you if you are ready to label the disk. type in "yes"
After you perform these steps the drive is ready for use. You can now partition the drive as needed and use the volume within Solaris normally.
Note also that after a RAID volume is deleted the drives that were previously part of the RAID volume should be re-labeled at that time for proper use also.
RAID Volumes Possible Status
OK - volume is optimal
DEGRADED - volume has a failed disk (mirror) or is otherwise functionally minimized
RESYNCING - volume is synchronizing (mirror)
FAILED - volume is offline
Disk Possible Status
OK - disk is operating normally
MISSING - disk is removed or otherwise offline
FAILED - disk is in a failed state and needs service
OBP Level Commands
PLEASE NOTE: OBP Level RAID commands are NOT SUPPORTED and are not intended for normal customer use. Future firmware updates may change command behavior and/or remove access to these commands altogether.
Before running the RAID OBP commands the auto-boot? variable needs to be set to false and the fcode-debug? variable needs to be set to true, then a reset-all is performed. After the reset finishes the controller must be selected. In the example below the "show-disks" command is used to determine the controller path. Note that the "/disk" was left off the path since it is the controller you want to select. (You can also use the probe-scsi-all command to find the path.)
{1} ok setenv auto-boot? false
auto-boot? = false
{1} ok setenv fcode-debug? true
fcode-debug? = true
{1} ok reset-all
:
: <system resets>
:
{1} ok show-disks
a) /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk
b) /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/cdrom
c) /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/disk
q) NO SELECTION Enter Selection, q to quit: a
/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk has been selected.
Type ^Y ( Control-Y ) to insert it in the command line.
e.g. ok nvalias mydev ^Y
for creating devalias mydev for /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk
{1} ok select /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1
The "show-volumes" command will show if there are any existing volumes and their state.
{1} ok show-volumes
Volume 0 Target 0 Type IM (Integrated Mirroring)
Optimal Enabled
2 Members 143112591 Blocks, 73 GB
Disk 1
Primary Online
Target 4 FUJITSU MAY2073RCSUN72G 0401
Disk 0
Secondary Online
Target 1 FUJITSU MAY2073RCSUN72G 0401
{1} ok
If you wanted to create a volume you would select the controller as above and use the "create" command. The following example creates a mirrored volume with disks 0 and 1.
{0} ok 0 1 create-im-volume
Target 0 size is 143243264 Blocks, 73 GB
Target 1 size is 143243264 Blocks, 73 GB
The volume can be any size from 1 MB to 69943 MB
What size do you want? [69943]
Volume size will be 143243264 Blocks, 73 GB
PhysDisk 0 has been created for target 0
PhysDisk 1 has been created for target 1
Volume has been created
{0} ok
This command creates a striped volume using disks 0 and 1
{0} ok 0 1 create-is-volume
Target 0 size is 143243264 Blocks, 73 GB
Target 1 size is 143243264 Blocks, 73 GB
The volume can be any size from 1 MB to 139886 MB
What size do you want? [139886]
Volume size will be 286486528 Blocks, 146 GB
PhysDisk 0 has been created for target 0
PhysDisk 1 has been created for target 1
Volume has been created
{0} ok
To unselect
{0} ok unselect-dev
when you have completed managing the RAID volumes you can set the auto-boot? and fcode-debug? variables back and reset the system:
{1} ok setenv auto-boot? true
auto-boot? = true
{1} ok setenv fcode-debug? false
fcode-debug? = false
{1} ok reset-all
Remember that even if you create a RAID volume at the OBP level you will still need to label the volume using format in Solaris before they can be properly used.
If you have existing RAID volumes and have to replace the system board the
following commands will need to be run to see the volume with the new board
{1} ok show-disks
a) /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk
b) /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/cdrom
c) /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/disk
q) NO SELECTION Enter Selection, q to quit: q
/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk has been selected.
Type ^Y ( Control-Y ) to insert it in the command line.
e.g. ok nvalias mydev ^Y
for creating devalias mydev for /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk
{1} ok select /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1
{0} ok show-volumes ( Look for the inactive volume)
{0} ok X activate-volume (X is the volume number)
{0} ok unselect-dev
If activating multiple volumes ensure they are activated in descending order:
{0} ok show-volumes
{0} ok 1 activate-volume
{0} ok 0 activate-volume
{0} ok unselect-dev
{0} ok probe-scsi-all
Failure to do so will result in the following error and will require a reset-all prior to activating the second volume:
{0} ok 0 activate-volumeVolume 0 is now activated
{0} ok 1 activate-volume
RAID volume request failed, ioc-status = 0007
Volume 1 could not be activateThe first volume activated will remain 'Degraded' until both volumes have completed syncing.
NOTE: IF the EEPROM variable "auto-boot?" was set to true you may get the following message.
{0} ok select /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1
Base SAS World Wide ID is 0!
This must be fixed immediately using set-sas-wwid
{0} ok
If you do see this message set "auto-boot?" to false and issue a "reset-all" |
|