In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to install and use MegaCli to manage disks under Ubuntu". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn "how to install and use MegaCli to manage disks under Ubuntu"!
MegaCli This command can be used to monitor raid status, disk status, etc. Recently, a batch of ubuntu systems run openstack. The problem is that MegaCli only has rpm packages on the official website, and there is no deb package. However, there is still a way to solve this problem. rpm packages can also be installed on debian& ubuntu.
You can download the latest zip package at the following link:
http://www.lsi.com/Search/Pages/results.aspx? k=MegaCLI&r=productfacet%3D%22AQxNZWdhUkFJRCBTQVMMcHJvZHVjdGZhY2V0AQJeIgIiJA%3D%3D%22%20os%3D%22AQVMaW51eAJvcwEBXgEk%22
I downloaded 8.00.48_Linux_MegaCLI.zip
Additional packages required for pre-installation:
The code is as follows:
apt-get -y install rpm2cpio libsysfs2 libsysfs-dev unzip
After installation, execute the following command:
The code is as follows:
cd /lib/x86_64-linux-gnu/
ln -s libsysfs.so.2.0.1 libsysfs.so.2.0.2
Go to the directory where the 8.00.48_Linux_MegaCLI.zip package is located and execute the following command:
The code is as follows:
unzip 8.00.48_Linux_MegaCLI.zip
unzip MegaCliLin.zip
rpm2cpio Lib_Utils-1.00-09.noarch.rpm | cpio -idmv
rpm2cpio MegaCli-8.00.48-1.i386.rpm | cpio -idmv
cp opt/MegaRAID/MegaCli/MegaCli64 /sbin/
cp opt/MegaRAID/MegaCli/MegaCli /sbin/
MegaCli can not only query the status of raid, but also set the status of raid, so it is better to master it by the administrator, so the installation is completed.
Here are a few common uses:
1. View all physical disk information
The code is as follows:
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): 0x0
Inquiry Data: SEAGATE ST3146855SS S5273LN4Y1X0
.....
2. View disk cache policy
The code is as follows:
MegaCli -LDGetProp -Cache -L0 -a0
Adapter 0-VD 0: Cache Policy:WriteBack, ReadAheadNone, Direct
or
The code is as follows:
MegaCli -LDGetProp -Cache -L1 -a0
Adapter 0-VD 1: Cache Policy:WriteBack, ReadAheadNone, Direct
or
The code is as follows:
MegaCli -LDGetProp -Cache -LALL -a0
Adapter 0-VD 0: Cache Policy:WriteBack, ReadAheadNone, Direct
Adapter 0-VD 1: Cache Policy:WriteBack, ReadAheadNone, Direct
or
The code is as follows:
MegaCli -LDGetProp -Cache -LALL -aALL
Adapter 0-VD 0: Cache Policy:WriteBack, ReadAheadNone, Direct
Adapter 0-VD 1: Cache Policy:WriteBack, ReadAheadNone, Direct
or
The code is as follows:
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
Examples:
The code is as follows:
MegaCli -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0
or
The code is as follows:
MegaCli -LDSetProp -Cached|-Direct -L0 -a0
or
The code is as follows:
enable / disable disk cache
MegaCli -LDSetProp -EnDskCache|-DisDskCache -L0 -a0
4. Create/delete arrays
4.1 Create a raid5 array consisting of physical disks 2, 3, 4, the hot spare of which is physical disk 5
The code is as follows:
MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0
4.2 Create an array without specifying a hot spare
The code is as follows:
MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0
4.3 delete pattern
The code is as follows:
MegaCli -CfgLdDel -L1 -a0
4.4 Add Disk Online
MegaCli -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0
Rebuild logical disk group 1, raid level 5, add physical disk numbers: 1:4. After the rebuild, the newly added physical disk will automatically be in the rebuild (synchronization) state. At this time, fdisk -l cannot see the increased space of the array. It can only be seen after the system restarts. If there is only one partition under the array, then the partition will also be directly increased. If there are multiple partitions, I don't know how to allocate the new space. Try it sometime, hehe
5. View array initialization information
5.1 After the array is created, there is a process to initialize the synchronization block, and you can see its progress.
The code is as follows:
MegaCli -LDInit -ShowProg -LALL -aALL
or as a dynamic visual text interface.
The code is as follows:
MegaCli -LDInit -ProgDsply -LALL -aALL
5.2 View array background initialization progress
The code is as follows:
MegaCli -LDBI -ShowProg -LALL -aALL
or as a dynamic visual text interface.
The code is as follows:
MegaCli -LDBI -ProgDsply -LALL -aALL
6. Create global hot standby
Specify disk 5 as global hot spare
The code is as follows:
MegaCli -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
You can also specify a dedicated hot spare for an array
The code is as follows:
MegaCli -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
7. Delete global hot standby
The code is as follows:
MegaCli -PDHSP -Rmv -PhysDrv[1:5] -a0
8. Take a physical disk offline/online
The code is as follows:
MegaCli -PDOffline -PhysDrv [1:4] -a0
MegaCli -PDOnline -PhysDrv [1:4] -a0
9. Check the progress of physical disk reconstruction
The code is as follows:
MegaCli -PDRbld -ShowProg -PhysDrv [1:5] -a0
or as a dynamic visual text interface.
The code is as follows:
MegaCli -PDRbld -ProgDsply -PhysDrv [1:5] -a0
Thank you for reading, the above is "how to install and use MegaCli to manage disks under Ubuntu" content, after learning this article, I believe that everyone on how to install and use MegaCli to manage disks under Ubuntu this problem has a deeper understanding, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
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.