View raid information and disk information in CentOS
Sometimes you want to know how many disks are on the server. If raid is not performed, you can simply use fdisk-l to see it.
But after raid, we can't see it. So how can I check whether raid is performed on the server?
Software raid: can only be viewed in Linux
Cat/proc/mdstat
The raid level and status are displayed.
Hardware raid: the best solution is to use the installed raid vendor's management tools to check whether there is a broken line or a graphical interface. For example, the Adaptec hardware card can be viewed through the following command:
#/Usr/dpt/raidutil-L all
The detailed information is displayed.
Of course, in more cases, there is no corresponding management tool installed. If you only need to rely on Linux itself, I generally know two methods:
# Dmesg | grep-I raid
# Cat/proc/scsi
The displayed information is similar to the raid manufacturer, model, and level. However, you cannot view the information of each hard disk.
The following information is used as a case. The command is
# Fdisk-l
Disk/dev/sda: 145.9 GB, 145999527936 bytes
255 heads, 63 sectors/track, 17750 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Device BootStartEndBlocksIdSystem
/Dev/sda1*11310439183 Linux
/Dev/sda21417750142472452 + 8 eLinux LVM
# Cat/proc/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: SEAGATEModel: ST3146356SSRev: HS09
Type: Direct-AccessANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: SEAGATEModel: ST3146356SSRev: HS09
Type: Direct-AccessANSI SCSI revision: 05
Host: scsi0 Channel: 01 Id: 00 Lun: 00
Vendor: DellModel: VIRTUAL DISKRev: 1028
Type: Direct-AccessANSI SCSI revision: 05
The above information shows that the server has two disks. The brand is Seagate and the disk code is ST3146356SS. If you are familiar with the detailed disk code naming rules, you can easily determine that the disk size is 146 GB. Based on the results obtained by fdisk, we can determine that the server is raid1 made of two 146gb hard disks.