In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to view Raid disk array information under linux". In daily operation, I believe that many people have doubts about how to view Raid disk array information under linux. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubt of "how to view Raid disk array information under linux". Next, please follow the editor to study!
The method of viewing raid disk Array Information under linux
The following is the information found when setting up the server raid. Take notes. If you are not interested, please ignore it.
The method of viewing soft and hard raid information under linux.
Software raid: can only be viewed 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 view it through the installed raid vendor's management tools, including cmdline and a graphical interface. For example, the hardware card of adaptec can be viewed by the following command:
# / usr/dpt/raidutil-l all
You can see very detailed information.
Of course, more often than not, there are no corresponding management tools installed, so we can only rely on linux itself. Generally speaking, there are two ways I know:
# dmesg | grep-I raid
# cat / proc/scsi/scsi
The information displayed is about the same, raid manufacturer, model, level, but can not view the information of each hard drive.
In addition, after the actual test, the server of dell can be displayed through the command, while the server of hp, ibm and so on can not be displayed by the command above. Dell can only be viewed by installing the hardware manufacturer's management tools. Bmc can be viewed.
Cat / proc/scsi/scsi
You can see that it is a device on the scsi. You can generally see the raid level. Lspci can see the model of the raid card.
=
Rpm-ivh megacli-1.01.09-0.i386.rpm
The command uses:
Megacli-ldinfo-lall-aall check raid level
Megacli-adpallinfo-aall to check raid card information
Megacli-pdlist-aall to view hard disk information
Megacli-adpbbucmd-aall to view battery information
Megacli-fwtermlog-dsply-aall View raid card log
Introduction of common parameters of megacli
Megacli-adpcount [displays the number of adapters]
Megacli-adpgettime-aall [display adapter time]
Megacli-adpallinfo-aall [shows all adapter information]
Megacli-ldinfo-lall-aall [displays all logical disk group information]
Megacli-pdlist-aall [displays all physical information]
Megacli-adpbbucmd-getbbustatus-aall | grep 'charger status' [check 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 [Show current bbu properties]
Megacli-cfgdsply-aall [displays raid card model, raid settings, disk related information]
The change in the state of the tape, from pulling the disk to inserting the disk.
Device | normal | damage | rebuild | normal
Virtual drive | optimal | degraded | degraded | optimal
Physical drive | online | failed-> unconfigured | rebuild | online
=
Common usage of megacli
2008-10-24 09:32
1. Prepare
The new version of megacli-1.01.24-0.i386.rpm installs the program under / opt, and you can customize the installation directory, such as:
Rpm-relocate / opt/=/usr/sbin/-I megacli-1.01.24-0.i386.rpm
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 disk cache policy
Megacli-ldgetprop-cache-10-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 policy
Cache policy 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-10-a0
Or
Enable / disable disk cache
Megacli-ldsetprop-endskcache |-disdskcache-10-a0
4. Create / delete arrays
4.1Create a raid5 array consisting of physical disk 2meme 3j4. The hot spare of this array is physical disk 5.
Megacli-cfgldadd-R5 [1wb direct-hsp [1:5]-a0
4.2 create an array without specifying a hot backup
Megacli-cfgldadd-R5 [1wb direct-a0
4.3 remove Array
Megacli-cfglddel-L1-a0
4.4 add disks online
Megacli-ldrecon-start-R5-add-physdrv [1:4]-L1-a0
This means that the rebuild logical disk group 1 Magi raid level is 5, and add the physical disk number: 1:4. After the reconstruction, the newly added physical disk is automatically rebuilt (synchronized). At this time, fdisk-l cannot see the larger space of the array and can only be seen after the system is rebooted. If there is only one partition under the array, then the partition also directly increases, if there are multiple partitions, do not know how to allocate the new space? Try it sometime, hehe
5. View array initialization information
5.1 after the array is created, there will be a process of initializing the synchronization block, and you can see 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 progress of array background initialization
Megacli-ldbi-showprog-lall-aall
Or display it in a dynamic visual text interface.
Megacli-ldbi-progdsply-lall-aall
6. Create a global hot backup
Specify the fifth disk as the global hot backup
Megacli-pdhsp-set [- enclaffinity] [- nonrevertible]-physdrv [1:5]-a0
It can also be designated as a dedicated hot backup for an array
Megacli-pdhsp-set [- dedicated [- array1]] [- enclaffinity] [- nonrevertible]-physdrv [1:5]-a0
7. Delete the global hot backup
Megacli-pdhsp-rmv-physdrv [1:5]-a0
8. Offline / online a physical disk
Megacli-pdoffline-physdrv [1:4]-a0
Megacli-pdonline-physdrv [1:4]-a0
9. Check the progress of physical disk reconstruction
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
=
All series of dell machines, as long as they are perc raid controllers, can be detected by megarc as a command line tool.
Megarc for windows
After unzipping, it is megarc.exe
Megarc for linux
After unzipped with unzip, chmod 700megarc*
The parameters under windows and linux are the same:
Megarc-dispcfg-a0
. / megarc-dispcfg-a0
The output is 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
00000 × 00000000 0x0887c000 online
0 01 0 × 0 00000000 0x0887c000 online
0 02 0 × 0 00000000 0x0887c000 online
0 03 0 × 0 00000000 0x0887c000 online
If you want to view it through a graphical interface, you have to install the big guy: dell openmanage server administrator
There are more than 90 m under linux and more than 100m under win.
Dell has a better tool under linux: raidmon (for win's hasn't 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
After unpacking, there is a megamon-4.0-0a.i386.rpm
After installation / etc/init.d/raidmon start
# tail-f / var/log/megaserv.log can see the test report. When there are problems, it will be reflected in this log.
You can also edit / etc/megamon.conf to add the administrator's mailbox to the end of the file, so that when an error is detected, the message will be sent automatically.
(mail.35.cn seems to be filtered out as spam.)
Therefore, it is suggested that megarc (manual) with raidmon (automatic) is a better solution.
The perc 5gami sas raid controller of dell 1950 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
At this point, the study on "how to view Raid disk array information under linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.