Home  >  Article  >  Operation and Maintenance  >  How to check Raid disk array information in Linux

How to check Raid disk array information in Linux

WBOY
WBOYforward
2023-05-16 21:46:1416548browse

How to view soft and hard raid information under Linux.

Software raid: You can only view it through the Linux system itself

cat /proc/mdstat

You can see the raid level, status and other information.

Hardware raid: The best way is to check it through the installed raid manufacturer's management tool, including cmdline and graphical interface. For example, adapterc's hardware card can be viewed through the following command:

# /usr/dpt/raidutil -l all

You can see very detailed information.

Of course, more often than not, the corresponding management tools are not installed, and you can only rely on Linux itself. Generally, I know two methods:

# dmesg |grep -i raid

# cat /proc/scsi/scsi

The information displayed is similar, including the manufacturer, model, and level of the raid, but the information of each hard disk cannot be viewed.

In addition, after actual testing, Dell's servers can be displayed through commands, while HP, IBM, etc. servers cannot be displayed through the above commands. Dell's bmc can only be viewed by installing the hardware manufacturer's management tool.

cat /proc/scsi/scsi

You can see that it is a device on scsi. Generally you can see the raid level. lspci can see the model of the raid card.

============================================== ==============

rpm -ivh megacli-1.01.09-0.i386.rpm

Command usage:

megacli -ldinfo -lall -aall Check raid level
megacli -adpallinfo -aall Check raid card information
megacli -pdlist -aall View hard disk information
megacli -adpbbucmd -aall View Battery information
megacli -fwtermlog -dsply -aall View raid card log

Introduction to common parameters of megacli

megacli -adpcount [Number of display adapters]
megacli -adpgettime –aall [Display adapter time]
megacli -adpallinfo -aall [Display all adapter information]
megacli -ldinfo -lall -aall [Display all logical disk group information]
megacli - pdlist -aall [Display all physical information]
megacli -adpbbucmd -getbbustatus -aall |grep 'charger status' [View charging status]
megacli -adpbbucmd -getbbustatus -aall [Display bbu status information]
megacli -adpbbucmd -getbbucapacityinfo -aall [Display bbu capacity information]
megacli -adpbbucmd -getbbudesigninfo -aall [Display bbu design parameters]
megacli -adpbbucmd -getbbuproperties -aall [Display current bbu properties]
megacli - cfgdsply -aall [Display raid card model, raid settings, disk related information]

Changes in tape status, from disk removal to disk insertion.

device |normal|damage|rebuild|normal
virtual drive |optimal|degraded|degraded|optimal
physical drive |online|failed –> unconfigured|rebuild| online

============================================== =

megacli common usage

2008-10-24 09:32

1. Preparation

The new version of megacli-1.01.24-0.i386.rpm will install the program under /opt. You can customize the installation directory, for example:

rpm –relocate /opt/ =/usr/sbin/ -i megacli-1.01.24-0.i386.rpm

That is, replace the installation directory /opt with /usr/sbin.

View all physical disk information

megacli -pdlist -aall

adapter #0

enclosure number: 1
slot number: 5
device id: 5
sequence number: 2
media error count: 0
other error count: 0
predictive failure count: 0
last predictive failure event seq number: 0
raw size: 140014mb [0x11177328 sectors]
non coerced size: 139502mb [0x11077328 sectors]
coerced size: 139392mb [0x11040000 sectors]
firmware state: hotspare
sas address(0): 0x5000c50008e5cca9
sas address(1): 0×0
inquiry data: seagate st3146855ss s5273ln4y1x0
…..

2. View the disk cache policy

megacli -ldgetprop -cache -l0 -a0

adapter 0-vd 0: cache policy:writeback, readaheadnone, direct

or

megacli -ldgetprop -cache - l1 -a0

adapter 0-vd 1: cache policy:writeback, readaheadnone, direct

or

megacli -ldgetprop -cache -lall -a0

adapter 0-vd 0: cache policy:writeback, readaheadnone, direct
adapter 0-vd 1: cache policy:writeback, readaheadnone, direct

or

megacli -ldgetprop -cache -lall -aall

adapter 0-vd 0: cache policy:writeback, readaheadnone, direct
adapter 0-vd 1: cache policy:writeback, readaheadnone, direct

or

megacli -ldgetprop -dskcache -lall -aall

adapter 0-vd 0: disk write cache : disk's default
adapter 0-vd 1: disk write cache : disk's default

3. Set disk cache strategy

Caching strategy explanation:

wt (write through
wb (write back)
nora (no read ahead )
ra (read ahead)
adra (adaptive read ahead)
cached
direct

Example:

megacli -ldsetprop wt|wb|nora|ra |adra -l0 -a0

or

megacli -ldsetprop -cached|-direct -l0 -a0

or

enable / disable disk cache

megacli -ldsetprop -endskcache|-disdskcache -l0 -a0

4. Create/delete array

4.1 Create a raid5 array, consisting of physical disks 2, 3, and 4. The hot spare disk of the array is physical disk 5

megacli -cfgldadd -r5 [1:2,1:3,1:4] wb direct -hsp[1:5] -a0

4.2 Create array without specifying hot standby

megacli -cfgldadd -r5 [1:2,1:3,1:4] wb direct -a0

4.3 Delete array

megacli -cfglddel -l1 -a0

4.4 Add disk online

megacli -ldrecon -start -r5 -add -physdrv[1:4] -l1 -a0

means, rebuild logical disk group 1, The raid level is 5, add the physical disk number: 1:4. After the reconstruction is completed, the newly added physical disk will automatically be in the reconstruction (synchronization) state. At this time, fdisk -l will not see the array space increasing, and it can only be seen after the system is restarted. If there is only one partition under the array, the partition will also increase directly. If there are multiple partitions, I don’t know how to allocate the new space? Give it a try when you have time, haha

5. Check the array initialization information

##5.1 After the array is created, there will be a process of initializing the synchronization block , you can check its progress.

megacli -ldinit -showprog -lall -aall

Or display it in a dynamic visual text interface

megacli -ldinit -progdsply -lall -aall

5.2 View the array background initialization progress

megacli -ldbi -showprog -lall -aall

Or display it in a dynamic visual text interface

megacli -ldbi -progdsply -lall -aall

6. Create a global hot standby

Specify the fifth disk as a global hot standby

megacli -pdhsp -set [-enclaffinity] [-nonrevertible] -physdrv[1:5] -a0

Can also be designated as a dedicated hot standby for an array

megacli -pdhsp -set [-dedicated [-array1]] [-enclaffinity] [ -nonrevertible] -physdrv[1:5] -a0

7. Delete global hot standby

megacli -pdhsp -rmv -physdrv[1:5] -a0

8. Take a physical disk offline/online

megacli -pdoffline -physdrv [1:4] -a0

megacli -pdonline -physdrv [1:4] -a0

9. Check the physical disk reconstruction progress##megacli -pdrbld -showprog -physdrv [1:5] -a0

Or display it in a dynamic visual text interface

megacli -pdrbld -progdsply -physdrv [1:5] -a0

Download address: http://gcolpart.evolix.net/ debian/misc/dell/megacli-1.01.24-0.i386.rpm

============================== ==================

Dell machines of all series, as long as they are perc raid controllers, can be detected using the megarc command line tool

megarc for windows

After decompression, it is megarc.exe

megarc for linux

After decompressing it with unzip, then chmod 700 megarc*

The parameters under windows and linux are the same:

megarc -dispcfg -a0

./megarc -dispcfg -a0


The output results are as follows:

logical drive : 0( adapter: 0 ): status: optimal

————————————————

spandepth :01 raidlevel: 5 rdahead : adaptive cache
stripsz :064kb stripes : 4 wrpolicy: writeback

logical drive 0 : spanlevel_0 disks

chnl target startblock blocks physical target st

—- —— ———- —— ——————
0 00 0×00000000 0x0887c000 online
0 01 0×00000000 0x0887c000 online
0 02 0×00000000 0x0887c000 online
0 03 0×00000000 0x0887c000 online

If you want to pass graphics To view it through the interface, you must install the big one: dell openmanage server administrator

There are more than 90 m under Linux, and more than 100 m under win.


dell has a better tool under Linux: raidmon (for win has not been found yet)

Currently supports ide / eide, scsi raid: lsi logic cerc ata 100, perc 4/dc, perc 4/di, perc 4/sc, lsi logic (formerly ami) perc3/dc, perc3/dcl, perc3/qc, perc3/sc

perc-cerc-apps-6.03-a06 .tar.gz

http://support.dell.com/support/downloads/download.aspx?c=us&l=en&s=gen&releaseid=r71524&formatcnt=2&fileid=92846

Unpack it Finally, there is megamon-4.0-0a.i386.rpm

After the installation is completed, /etc/init.d/raidmon start

# tail -f /var/log/megaserv.log You can see the test report. If there is a problem, it will be reflected in this log.

You can also edit /etc/megamon.conf and add the administrator's mailbox at the end of the file, so that when an error is detected, an email will be automatically sent.

(mail.35.cn seems to be filtered out as spam)


Therefore, it is recommended that megarc (manual) combined with raidmon (automatic) is a better solution.

Dell 1950's perc 5/i sas raid controller uses this command line tool:

megacli for linux

http://www.lsi.com/support/downloads /megaraid/miscellaneous/linux_megacli_1.01.24.zip

megacli for windows

http://www.lsi.com/support/downloads/megaraid/miscellaneous/windows_megacli_1.01.25.zip

# unzip linux_megacli_1.01.24.zip

# unzip megaclilin.zip

# rpm -ivh megacli-1.01.24-0.i386.rpm

# /opt/megacli -cfgdsply -aall

The output is as follows:

==============================================================================
adapter: 0
product name: perc 5/i integrated
memory: 256mb
bbu: present
serial no: 12345
==============================================================================

raid level: primary-1, secondary-0, raid level qualifier-0
size:285568mb
state: optimal

physical disk: 0
media error count: 0
other error count: 0
firmware state: online

physical disk: 1
media error count: 0
other error count: 0
firmware state: online

The above is the detailed content of How to check Raid disk array information in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete