The output of megasasctl on a Perc5i without a backplane fails to list the disks. This works properly on a system with a backplane.
On the machine, running Debian wheezy, kernel 3.2.0, with drives plugged directly into the Perc5i:
a0 PERC 5/i Integrated bios:MT28-9 fw:1.03.50-0461 encl:4 ldrv:2 rbld:30% mem:256MiB batt:good/4071mV/23C
a0d0 19GiB RAID 5 1x4 DEGRADED
row 0: a0e65535s0 a0e65535s1 a0e65535s2 a0e65535s3
a0d1 5567GiB RAID 5 1x4 DEGRADED
row 0: a0e65535s0 a0e65535s1 a0e65535s2 a0e65535s3
The enclosure number should not be "65535", and disks should be listed.
megacli -PDList properly handles the lack of an enclosure:
Adapter #0
Enclosure Device ID: N/A
Slot Number: 0
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: N/A
Device Id: 0
WWN:
Sequence Number: 2
Media Error Count: 0
Other Error Count: 3
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
(...)
I would like to help solve this problem. If you have any gut feelings about where to experiment with the code, please let me know!
I am attaching a solution to the problem.
The root of the problem is that a lot of the logic behind building the enclosure map and printing the disk list compares directly the adapter channel list with the physical disk enclosure number, like so:
The problem is that one is a uint16_t and the other is a uint8_t. When an enclosure is not present, the value comes back as all-ones. So, the code was trying in numerous places to compare 0xffff with 0xff. Adjusting the struct so both members are uint16_t fixes this.
The patch also changes the output when no enclosure is present to put an asterisk as the enclosure ID in the output.
The output on the same machine now looks like this: