Operating System - Linux
1756379 Members
3073 Online
108847 Solutions
New Discussion юеВ

On linux how to know the disk details(disk type,raidlevel) for hardware raid

 
Taranisen
New Member

On linux how to know the disk details(disk type,raidlevel) for hardware raid

Hi,
I have a linux server and different JBODs are connected to it i.e SAS enclouser, SATA enclouser ,FC enclouser , SCSI enclouser and SAS enclouser SAS and SATA drives are mixed. All the disks are in hardware raid (raid-1 or raid-6 or raid-5).

(1) I want to know the hard disk type- SATA ,SAS, FC etc.
In linux the device I am seeing as /dev/sda where 6 disks are there. The output I need as follows
/dev/sda disk serial no disk type size raid_type
/dev/sda ABCD121 SATA 1TB raid-5
/dev/sda ABCD122 SAS 1TB raid-5
/dev/sda ABCD123 FC 1TB raid-5
/dev/sda ABCD124 SCSI 1TB raid-5
/dev/sda ABCD125 IDE 1TB raid-5
/dev/sda ABCD126 SATA 1TB raid-5

I am planning to write the passthrough and ventor independent solution is required.
Any help on it.

Thanks in advance..

Thanks & Regds,
tmohanta

5 REPLIES 5
TwoProc
Honored Contributor

Re: On linux how to know the disk details(disk type,raidlevel) for hardware raid

In most cases, the details of the hardware mirroring representation is simply not visible to the OS. Even on large high end array systems, you can't see it. Keep a spreadsheet.
We are the people our parents warned us about --Jimmy Buffett
Tim Nelson
Honored Contributor

Re: On linux how to know the disk details(disk type,raidlevel) for hardware raid

typically the vendor of the storage unit will provide a utility.

e.g. HP's P4xxx internal raid controller provides the hpacucli utility which can be found on the bizsupport website. (click "download drivers, software..." in left nav of this website.



Alzhy
Honored Contributor

Re: On linux how to know the disk details(disk type,raidlevel) for hardware raid

JBODs - hmmm -- that indicates you are using Linux's software RAID mechanism -- md.

I guess you can write a script parsing the output of mdadm sir.

mdadm --detail /dev/mdNN

will give out details of your RAIDs.

I am assuming too you are using md+LVM in your storage configuration -- no?
Hakuna Matata.
Alzhy
Honored Contributor

Re: On linux how to know the disk details(disk type,raidlevel) for hardware raid

Oh so you have a mix of JBODs and HW raided disks.

In that case, yeah -- you need to have the corresponding raid controller utility to list the details and members of your RAID sets for ya. And it depends largely on the server you have... for HP Proliants -- they provide hpacutil on the PSP for ya and it supports all Smart Array Controllers...

If a home-brew, generic server -- download the Linux utility from the vendor's web site -- I have RocketRaid and MegaRAID - the Linux utils are freely downloadable from their web sites.

Hakuna Matata.
Taranisen
New Member

Re: On linux how to know the disk details(disk type,raidlevel) for hardware raid

From the sysfs I am getting the raid levels but for the particular disk which raid level I am not getting.

for DSK in `ls /sys/block/`
do
if [ -e "/sys/block/${DSK}/device/vendor" ]
then
VENDOR=`cat /sys/block/${DSK}/device/vendor`
LEVEL=`cat /sys/block/${DSK}/device/level`
echo "${DSK} ${VENDOR} ${MODEL}"
fi
done

Any suggestion on it.