跳转至

Raid卡os命令

1、组建raid要求(raid1=2,raid5=3,raid6=4,raid10=4,raid50=6,raid60=8) 2、phy注错(raid盘大于2块,linkreset/hardreset可以跑其中一部分,disbale的不能跑raid) 3、jbod:逻辑上将几个物理磁盘连起来,看起来像一个大的逻辑磁盘,无容错。 4、ugood:空闲盘(Unconfigured Good状态的硬盘),表示可以直接制作raid 5、若磁盘状态为JBOD,则制作raid时会出错,必须将JBOD状态修改为UGood状态,才能正常制作raid

9361-8i卡

(only不能配置raid,得先切换ugood,最好类型相同,ugood状态下看不到盘符)

ugood切only

storcli /c0 set jbod=on

onln切换ugood,当盘有系统加force

storcli /c0 set jbod=off force

查看信息状态
Text Only
1
2
storcli show
storcli /c0 show
Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
[root@localhost Linux]# storcli /c0 show
Generating detailed summary of the adapter, it may take a while to complete.

CLI Version = 007.0510.0000.0000 May 4, 2018
Operating system = Linux 3.10.0-1127.el7.x86_64
Controller = 0
Status = Success
Description = None

Product Name = AVAGO MegaRAID SAS 9361-16i
Serial Number = SKB2183970
SAS Address =  500062b207f9fac0
PCI Address = 00:8d:00:00
System Time = 12/21/2024 18:03:26
Mfg. Date = 06/01/21
Controller Time = 12/21/2024 10:03:25
FW Package Build = 24.22.0-0091
BIOS Version = 6.36.00.3_4.19.08.00_0x06180205
FW Version = 4.740.00-8464
Driver Name = megaraid_sas
Driver Version = 07.710.50.00-rh1
Current Personality = RAID-Mode
Vendor Id = 0x1000
Device Id = 0xCE
SubVendor Id = 0x1000
SubDevice Id = 0x9371
Host Interface = PCI-E
Device Interface = SAS-12G
Bus Number = 141
Device Number = 0
Function Number = 0
Drive Groups = 1

TOPOLOGY :
========

---------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT     Size PDC  PI SED DS3  FSpace TR
---------------------------------------------------------------------------
 0 -   -   -        -   RAID1 Optl  N  1.818 TB dflt N  N   dflt Y      N
 0 0   -   -        -   RAID1 Optl  N  1.818 TB dflt N  N   dflt Y      N
 0 0   0   252:2    1   DRIVE Onln  N  3.637 TB dflt N  N   dflt -      N
 0 0   1   252:3    3   DRIVE Onln  N  1.818 TB dflt N  N   dflt -      N
---------------------------------------------------------------------------

DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID
DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded
Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active
PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present
TR=Transport Ready

Virtual Drives = 1

VD LIST :
=======

---------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache Cac sCC     Size Name
---------------------------------------------------------------
0/0   RAID1 Optl  RW     Yes     RWTD  -   ON  800.0 GB raid_1
---------------------------------------------------------------

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency

Physical Drives = 2

PD LIST :
=======

--------------------------------------------------------------------------------
EID:Slt DID State DG     Size Intf Med SED PI SeSz Model                Sp Type
--------------------------------------------------------------------------------
252:2     1 Onln   0 3.637 TB SATA HDD N   N  512B HGST HUS726T4TALE6L4 U  -
252:3     3 Onln   0 1.818 TB SATA HDD N   N  512B TOSHIBA MG04ACA200N  U  -
--------------------------------------------------------------------------------

EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup
DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare
UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface
Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info
SeSz-Sector Size|Sp-Spun|U-Up|D-Down/PowerSave|T-Transition|F-Foreign
UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded
CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded
删除raid组

storcli64 /ccontroller_id /vraid_id del

Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[root@localhost Linux]# storcli /c0/v0 delete
CLI Version = 007.0510.0000.0000 May 4, 2018
Operating system = Linux 3.10.0-1127.el7.x86_64
Controller = 0
Status = Failure
Description = Delete VD failed

Detailed Status :
===============

----------------------------------
VD ErrCd Status
----------------------------------
 0   255 VD has OS/FS, use force.
----------------------------------



[root@localhost Linux]# storcli /c0/v0 delete force
CLI Version = 007.0510.0000.0000 May 4, 2018
Operating system = Linux 3.10.0-1127.el7.x86_64
Controller = 0
Status = Success
Description = Delete VD succeeded
删除raid后查看状态
Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[root@localhost Linux]# storcli /c0 show
Generating detailed summary of the adapter, it may take a while to complete.

CLI Version = 007.0510.0000.0000 May 4, 2018
Operating system = Linux 3.10.0-1127.el7.x86_64
Controller = 0
Status = Success
Description = None

Product Name = AVAGO MegaRAID SAS 9361-16i
Serial Number = SKB2183970
SAS Address =  500062b207f9fac0
PCI Address = 00:8d:00:00
System Time = 12/21/2024 18:12:58
Mfg. Date = 06/01/21
Controller Time = 12/21/2024 10:12:56
FW Package Build = 24.22.0-0091
BIOS Version = 6.36.00.3_4.19.08.00_0x06180205
FW Version = 4.740.00-8464
Driver Name = megaraid_sas
Driver Version = 07.710.50.00-rh1
Current Personality = RAID-Mode
Vendor Id = 0x1000
Device Id = 0xCE
SubVendor Id = 0x1000
SubDevice Id = 0x9371
Host Interface = PCI-E
Device Interface = SAS-12G
Bus Number = 141
Device Number = 0
Function Number = 0
Physical Drives = 2

PD LIST :
=======

--------------------------------------------------------------------------------
EID:Slt DID State DG     Size Intf Med SED PI SeSz Model                Sp Type
--------------------------------------------------------------------------------
252:2     1 UGood -  3.637 TB SATA HDD N   N  512B HGST HUS726T4TALE6L4 U  -
252:3     3 UGood -  1.818 TB SATA HDD N   N  512B TOSHIBA MG04ACA200N  U  -
--------------------------------------------------------------------------------

EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup
DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare
UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface
Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info
SeSz-Sector Size|Sp-Spun|U-Up|D-Down/PowerSave|T-Transition|F-Foreign
UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded
CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded
组建raid1

storcli64 /ccontroller_id add vd rlevel[0|1|5|6|10|50|60] [size=<VD1_Sz>,<VD2_Sz>,..|*all] [name=<VDNAME1>,..] drives=enclosure_id:slot_id|enclosure_id:startid-endid,enclosure_id:slot_id|enclosure_id:startid-endid [pdperarray=pdperarray] [pdcache=on|off|*default][pi] [wt|*wb|awb] [nora|*ra] [Strip=<8|16|32|64|128|256|1024>] [EmulationType=0|1|2] [Spares=[enclosure_id:slot_id|enclosure_id:startid-endid,enclosure_id:slot_id|enclosure_id:startid-endid]

storcli /c0 add vd raid1 size=200gb name=testraid1 drives=252:2-3

Text Only
1
2
3
4
5
6
[root@localhost Linux]# storcli /c0 add vd raid1 size=1000gb name=testraid1 drives=252:2-3
CLI Version = 007.0510.0000.0000 May 4, 2018
Operating system = Linux 3.10.0-1127.el7.x86_64
Controller = 0
Status = Success
Description = Add VD Succeeded
Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[root@localhost Linux]# lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0  1000G  0 disk
sdb               8:16   0 447.1G  0 disk
├─sdb1            8:17   0   200M  0 part /boot/efi
├─sdb2            8:18   0     1G  0 part /boot
└─sdb3            8:19   0   446G  0 part
  ├─centos-root 253:0    0    50G  0 lvm  /
  ├─centos-swap 253:1    0     4G  0 lvm  [SWAP]
  └─centos-home 253:2    0   392G  0 lvm  /home
创建分区

fdisk /dev/sda

Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[root@localhost Linux]# fdisk /dev/sda

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-2097151999, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151999, default 2097151999):
Using default value 2097151999
Partition 1 of type Linux and of size 1000 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost Linux]# lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0  1000G  0 disk
└─sda1            8:1    0  1000G  0 part
sdb               8:16   0 447.1G  0 disk
├─sdb1            8:17   0   200M  0 part /boot/efi
├─sdb2            8:18   0     1G  0 part /boot
└─sdb3            8:19   0   446G  0 part
  ├─centos-root 253:0    0    50G  0 lvm  /
  ├─centos-swap 253:1    0     4G  0 lvm  [SWAP]
  └─centos-home 253:2    0   392G  0 lvm  /home

跑fio

fio fio.conf

Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[global]
#kb_base=1000
#unit_base=0
numjobs=1
time_based
runtime=54000
#21600 6小时 54000 15
#604800秒(7天)
direct=1
rw=rw
#rw=randrw
rwmixwrite=50
bs=1024k
size=40G
ioengine=libaio
iodepth=64
thread
verify=md5
group_reporting

[job.nvme0.0]
name="job_nvme0_0"
filename=/dev/nvme0n1
offset=100G