LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Disk information when RAID is enabled. (https://www.linuxquestions.org/questions/linux-hardware-18/disk-information-when-raid-is-enabled-725842/)

rolverm 05-14-2009 12:38 AM

Disk information when RAID is enabled.
 
I am working on :

SUSE Linux Enterprise Server 10 (ia64)
VERSION = 10
PATCHLEVEL = 2

Example 1:If Raid is enabled on disk then the information in cat /proc/partitions is shown as :

104 0 35532720 cciss/c0d0
104 1 2104483 cciss/c0d0p1
104 2 33423232 cciss/c0d0p2
104 16 35532720 cciss/c0d1
104 32 35532720 cciss/c0d2



Example2:If normal disk is taken the output is as follows:

8 0 35566480 sda
8 1 102383 sda1
8 2 409600 sda2
8 3 210925 sda3
8 4 2104515 sda4
8 5 32739023 sda5

According to my application I need to find out the information of the disk .

Please can you tell me how can I get disk information when my system is RAID enabled(cat /proc/partitions shows the entry of the controllers in example 1).

Can we get Partitions information of the Disk when Disk are connected to system by controller ?

Any Pionters towards answers are welcomed.
Thanks
Roli

farslayer 05-14-2009 07:27 AM

Look at this post, for info on how to query the drives in the array.
http://www.linuxquestions.org/questi...06#post3295106

Code:

mail:~# cat /proc/partitions
major minor  #blocks  name

 104    0  143307832 cciss/c0d0
 104    1    240943 cciss/c0d0p1
 104    2    2931862 cciss/c0d0p2
 104    3    2931862 cciss/c0d0p3
 104    4          1 cciss/c0d0p4
 104    5  19535008 cciss/c0d0p5
 104    6    1951866 cciss/c0d0p6
 104    7    7815591 cciss/c0d0p7
 104    8    2931831 cciss/c0d0p8
 104    9  104968678 cciss/c0d0p9



mail:~# fdisk -l

Disk /dev/cciss/c0d0: 146.7 GB, 146747220480 bytes
255 heads, 63 sectors/track, 17841 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

          Device Boot      Start        End      Blocks  Id  System
/dev/cciss/c0d0p1  *          1          30      240943+  83  Linux
/dev/cciss/c0d0p2              31        395    2931862+  83  Linux
/dev/cciss/c0d0p3            396        760    2931862+  82  Linux swap / Solaris
/dev/cciss/c0d0p4            761      17841  137203132+  5  Extended
/dev/cciss/c0d0p5            761        3192    19535008+  83  Linux
/dev/cciss/c0d0p6            3193        3435    1951866  83  Linux
/dev/cciss/c0d0p7            3436        4408    7815591  83  Linux
/dev/cciss/c0d0p8            4409        4773    2931831  83  Linux
/dev/cciss/c0d0p9            4774      17841  104968678+  83  Linux


mail:~# mount
/dev/cciss/c0d0p2 on / type ext3 (rw,errors=remount-ro)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
/dev/cciss/c0d0p5 on /home type ext3 (rw)
/dev/cciss/c0d0p9 on /opt type ext3 (rw)
/dev/cciss/c0d0p6 on /tmp type ext3 (rw)
/dev/cciss/c0d0p7 on /usr type ext3 (rw)
/dev/cciss/c0d0p8 on /var type ext3 (rw)


The difference between the raid and non-raid is in the naming convention.
the list below shows how the partitions and disk naming conventions would compare.

/dev/sda1 = /dev/cciss/c0d0p1
/dev/sda2 = /dev/cciss/c0d0p2
/dev/sda3 = /dev/cciss/c0d0p3

/dev/sdb1 = /dev/cciss/c0d1p1
/dev/sdb2 = /dev/cciss/c0d1p2
/dev/sdb3 = /dev/cciss/c0d1p3

c0d0p1
c0 = Controller Number
d0 = Logical Disk Number
px = Partition number


Does that help or did I miss the mark entirely for what you were trying to figure out ?

rolverm 05-15-2009 04:45 AM

Thanks For the Information.
As far as my understanding is concerned we can see the names of controllers present on our system in /dev/cciss. But the problem that I am facing is that I see a list of only 1 controller in /dev/cciss. My concern is now to find out how many disks are connected to my system/controller is there a way we can do it in Linux.

farslayer 05-15-2009 10:07 AM

Guess maybe I should have provided a link to info about Linux management tools for the HP smartarray... For some reason I didn't even think about that when i did my last post..

http://hwraid.le-vert.net/wiki/SmartArray - hpacucli described on this page looks like it will do exactly what you want.

http://cciss.sourceforge.net/ - Scroll down to the utilities section for more tool options


hpacucli
This tool is a proprietary one created by HP. It can do both reporting and management.

List physical drives on controller in slot 0:
Code:

server:~# hpacucli ctrl slot=0 pd all show status

physicaldrive 1:0 (port 1:id 0, 36.4 GB): OK
physicaldrive 1:1 (port 1:id 1, 36.4 GB): OK
physicaldrive 1:2 (port 1:id 2, 146.8 GB): OK
physicaldrive 1:3 (port 1:id 3, 146.8 GB): OK



All times are GMT -5. The time now is 11:31 AM.