


How to check Raid disk array information in Linux
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
6. Create a global hot standby
Specify the fifth disk as a global hot standbymegacli -pdhsp -set [-enclaffinity] [-nonrevertible] -physdrv[1:5] -a0Can also be designated as a dedicated hot standby for an arraymegacli -pdhsp -set [-dedicated [-array1]] [-enclaffinity] [ -nonrevertible] -physdrv[1:5] -a07. Delete global hot standby
megacli -pdhsp -rmv -physdrv[1:5] -a08. Take a physical disk offline/online
megacli -pdoffline -physdrv [1:4] -a0megacli -pdonline -physdrv [1:4] -a09. 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
—- —— ———- —— ——————
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
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

Docker process viewing method: 1. Docker CLI command: docker ps; 2. Systemd CLI command: systemctl status docker; 3. Docker Compose CLI command: docker-compose ps; 4. Process Explorer (Windows); 5. /proc directory (Linux).

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

Troubleshooting steps for failed Docker image build: Check Dockerfile syntax and dependency version. Check if the build context contains the required source code and dependencies. View the build log for error details. Use the --target option to build a hierarchical phase to identify failure points. Make sure to use the latest version of Docker engine. Build the image with --t [image-name]:debug mode to debug the problem. Check disk space and make sure it is sufficient. Disable SELinux to prevent interference with the build process. Ask community platforms for help, provide Dockerfiles and build log descriptions for more specific suggestions.

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

Docker uses Linux kernel features to provide an efficient and isolated application running environment. Its working principle is as follows: 1. The mirror is used as a read-only template, which contains everything you need to run the application; 2. The Union File System (UnionFS) stacks multiple file systems, only storing the differences, saving space and speeding up; 3. The daemon manages the mirrors and containers, and the client uses them for interaction; 4. Namespaces and cgroups implement container isolation and resource limitations; 5. Multiple network modes support container interconnection. Only by understanding these core concepts can you better utilize Docker.

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

VS Code is the full name Visual Studio Code, which is a free and open source cross-platform code editor and development environment developed by Microsoft. It supports a wide range of programming languages and provides syntax highlighting, code automatic completion, code snippets and smart prompts to improve development efficiency. Through a rich extension ecosystem, users can add extensions to specific needs and languages, such as debuggers, code formatting tools, and Git integrations. VS Code also includes an intuitive debugger that helps quickly find and resolve bugs in your code.
