Giter Site home page Giter Site logo

hpsahba's Introduction

NAME

hpsahba - tool to enable/disable HBA mode on some HP Smart Array controllers.

SYNOPSIS

  • hpsahba -h
  • hpsahba -v
  • hpsahba -i /dev/sgN
  • hpsahba -E /dev/sgN
  • hpsahba -d /dev/sgN

DESCRIPTION

CAUTION: This tool will destroy your data and may damage your hardware!

hpsahba is able to enable or disable HBA mode on some HP Smart Array controllers on which regular tools, like 'ssacli', reports HBA mode as not supported.

When enabling or disabling HBA mode, RAID controller changes its internal configuration immediately, without requiring reboot. Any existing data may be lost after changing the HBA mode, so be extremely careful.

Some servers may not be able to boot from disks attached to controller in HBA mode. Move the /boot partition and the bootloader out of disks attached to controller onto USB flash driver or SD card to circumvent this limitation.

When HBA mode is enabled, controller usually prints some diagnostic message during boot, like "Hardware RAID support is disabled via controller NVRAM configuration settings" (example from P410i). Attempts to configure RAID arrays in this mode are expected to fail.

Options

  • hpsahba -h

    Show help message and exit.

  • hpsahba -v

    Show version and exit.

  • hpsahba -i DEVICE_PATH

    Show some information about device. This Includes HBA mode support bit (supported/not supported) and current state of HBA mode (enabled/disabled). It is recommended to run this before trying to enable or disable HBA mode.

  • hpsahba -E DEVICE_PATH

    Enable HBA mode.

  • hpsahba -d DEVICE_PATH

    Disable HBA mode.

Kernel driver support

hpsahba itself is able to work on any modern Linux system.

However, to get system actually see and use disks in HBA mode, few kernel patches required: https://github.com/im-0/hpsahba/tree/master/kernel.

This functionality is disabled by default. To enable, load module hpsa with parameter hpsa_use_nvram_hba_flag set to "1". Or set it in the kernel command line: "hpsa.hpsa_use_nvram_hba_flag=1".

Patchset changelog:

  • V1 -> V2:
    • Device visibility change properly detected if device is both updated and masked/unmasked in the same time.

This will never be upstreamed and officially supported (for P410), see the email from Don Brace: https://lkml.org/lkml/2018/12/17/618. So use at your own risk.

You can use DKMS package in https://github.com/im-0/hpsahba/tree/master/contrib/dkms to patch hpsa driver in a compiled kernel.

Supported hardware

Tested on following hardware so far:

  • HP Smart Array P410i (PCI ID: 103c:3245, board ID: 0x3245103c, firmware: 6.64)
  • HP Smart Array P812 (PCI ID: 103c:3249, board ID: 0x3249103c, firmware: 6.64)
  • Hewlett-Packard Company Smart Array G6 controllers / P410 (PCI ID: 103c:323a, board ID: 0x3243103c, firmware: 6.64)
  • Hewlett-Packard Company Smart Array G6 controllers / P212 (PCI ID: 103c:323a, board ID: 0x3241103c, firmware: 6.64)

(open an issue or a pull request if you successfully used this tool on other controllers)

Additional links

BUGS

See issues on GitHub: https://github.com/im-0/hpsahba/issues.

AUTHOR

hpsahba was written by Ivan Mironov <[email protected]>

hpsahba's People

Contributors

artizirk avatar glennschuurman avatar im-0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hpsahba's Issues

dkms install won't work

I am trying to install the dkms module for a P812 controller, it's in HBA mode fine. But when I run the following command dkms install --force hpsa-dkms/1.0 it gives me this:

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...
make -j32 KERNELRELEASE=5.15.0-78-generic...(bad exit status: 2)
ERROR (dkms apport): binary package for hpsa-dkms: 1.0 not found
Error! Bad return status for module build on kernel: 5.15.0-78-generic (x86_64)
Consult /var/lib/dkms/hpsa-dkms/1.0/build/make.log for more information.

Linux 6.0 Kernel support

First thanks for the work provided. Runs very well in a HP ProLiant DL360 G7 with disks in HBA mode.

Any chance the code get updated to work with Linux Driver 6.0. It seems that hpsa_cmd.hhas changed such that the patch is not working anymore for this file.

thanks!!

P410i /dev/sg0 report error when enabling HBA mode

Hi,

I tried to use this tool on Smart Array P410i, to enable its HBA mode, and here is my environment:
HP DL380 Gen7 server,
Ubuntu 18.04 LTS HWE, installed on a SATA SSD connected to system via the SATA port for the optical drive, which should be bypassing the P410i card.
Kernel 5.3.0-53-generic

Before running "hpsahba -E", I have three relevant devices which are /dev/sg0, /dev/sg1 and /dev/sg2.

I was able to run "hpsahba -E /dev/sg1" without any error, but when I run "hpsahba -E /dev/sg0", the system gave the following error:
FATAL ERROR: /dev/sg0: ioctl(CCISS_PASSTHRU) failed with command BMIC_IDENTIFY_CONTROLLER, rc == -1: 25 Inappropriate ioctl for device
After running this, no changes are observed on the output of lsblk and the number of sgX device under /dev/

After running "hpsahba -E /dev/sg1, I noticed that two hard disks that connected to the P410i has gone from the output of lsblk command. And the sg2 device has gone under /dev/ folder.

I enabled hpsa.hpsa_use_nvram_hba_flag=1 in grub, and hpsa module is showing up in lsmod output.

What I did not do is patching the kernel patches that you provided. If the issue is with the kernel patch, could you advise how should the patching by done in my case?

Best Regards,
Terry YIN

Kernel patching for HBA

Is this necessary step to patch kernel?
I can see your git folder structure says 4.19.x.y but what about other LTS v4 kernel versions like 4.4? Can I use the same files?

I'm interested in trying your script to mess with my p410i on spare machine!

FATAL ERROR: Cancelled by user

Im trying to run this on Ubuntu 19.04, the same place I compiled it. and I am receiving this message:

root@ubuntu:/temp/hpsahba# ./hpsahba -d /dev/sg0
// CAUTION // // CAUTION // // CAUTION // // CAUTION // // CAUTION //
HBA MODE CHANGE WILL DESTROY YOU DATA!
HBA MODE CHANGE MAY DAMAGE YOUR HARDWARE!
Type uppercase "yes" to accept the risks and continue: yes
FATAL ERROR: Cancelled by user
root@ubuntu:/temp/hpsahba#

Any ideas?

dkms module will not build on Ubuntu 20.04.2 LTS

All looks good running patch.sh and I have installed dkms and the headers:

$ dpkg -l |grep -e dkms -e linux-headers-$(uname -r)
ii  dkms                                   2.8.1-5ubuntu2                      all          Dynamic Kernel Module Support Framework
ii  linux-headers-5.4.0-77-generic         5.4.0-77.86                         amd64        Linux kernel headers for version 5.4.0 on 64 bit x86 SMP

dkms add works fine, but the install fails:

$  sudo dkms add ./

Creating symlink /var/lib/dkms/hpsa-dkms/1.0/source ->
                 /usr/src/hpsa-dkms-1.0

DKMS: add completed.

$ sudo dkms install --force hpsa-dkms/1.0

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j24 KERNELRELEASE=5.4.0-77-generic...(bad exit status: 2)
ERROR (dkms apport): binary package for hpsa-dkms: 1.0 not found
Error! Bad return status for module build on kernel: 5.4.0-77-generic (x86_64)
Consult /var/lib/dkms/hpsa-dkms/1.0/build/make.log for more information.

Contents of make.log:

DKMS make.log for hpsa-dkms-1.0 for kernel 5.4.0-77-generic (x86_64)
Mon 12 Jul 2021 06:38:27 PM EDT
make -C /usr/lib/modules/5.4.0-77-generic/build M=/var/lib/dkms/hpsa-dkms/1.0/build modules
make[1]: *** /usr/lib/modules/5.4.0-77-generic/build: No such file or directory.  Stop.
make: *** [Makefile:14: default] Error 2

It seems that on Ubuntu 20.04.02 LTS there is no /usr/lib/modules directory. There is a /usr/lib/modules-load.d but there's nothing in it.

I'm very comfortable with linux but I really haven't done anything with dkms so I have no idea what to try to do here.

Tried it on HPE Smart Array P204i-b SR Gen10

[root@localhost hpsahba]# ./hpsahba -i /dev/sg1
VENDOR_ID='HPE'
PRODUCT_ID='P204i-b SR Gen10'
BOARD_ID='0x0701103c'
SOFTWARE_NAME=''
HARDWARE_NAME=''
RUNNING_FIRM_REV='4.11'
ROM_FIRM_REV='4.11'
REC_ROM_INACTIVE_REV='4.11'
YET_MORE_CONTROLLER_FLAGS='0x3a51a214'
NVRAM_FLAGS='0x00'
HBA_MODE_SUPPORTED=1
HBA_MODE_ENABLED=0

Scared to try enable HBA mode on this, since this was only tried on old controllers... really surprised it was even able to get that info dump on Gen10 hardware

Success: P410i FW6.60 w/ Ubuntu 22.04 ILO2 Remote Media Boot

I used ILO2 (VSP or FirefoxESR55+Java8) and the current Ubuntu Jammy ISO to do some data recovery after a FWBC battery and cache replacement resulted in a reboot into what looked like an empty logical volume.

The 5.15 Ubuntu kernel only liked this patched repo, which doesn't need any module flags

https://github.com/mashuptwice/hpsahba

I was able to remote dd the entire logical volume first, then switch to HBA mode and dd the individual raw disks. So I have everything I need to reconstruct the 4 disk 1+0 array in 4 different ways to compare data and resolve some corruption. I can already see a clean partition table block on one of the raw disks, that is incomplete in the logical volume. ADU had nothing bad to say, but HBA mode is going to help me sort this out.

After setting up another SSH tunnel to connect local 222 directly to the HP DL360 G6 running the live Ubuntu iso mounted remotely through ILO2 I just pulled down a few packages with apt, built the dkms module, and a few dd commands later had images of the full volume, and the raw disks right in front of me.

Super pleased. Beers on me if you are ever in Toronto.

Already I can see complete and simple data blocks, like the protective MBR, on [2 of] the raw disks that are for some reason is mangled in the logical volume.

On My Local Laptop:
ssh -p222 [email protected] "sudo dd if=/dev/sda bs=512 | gzip -1 -" | pv -s 273G | dd of=sda.bin.gz
On P410i via ILO:
hpsahba -E /dev/sda
On My Local Laptop:

 ssh -p222 [email protected] "sudo dd if=/dev/sdc bs=512 | gzip -1 -" | pv -s 146G | dd of=sdc.bin.gz 
 ssh -p222 [email protected] "sudo dd if=/dev/sdd bs=512 | gzip -1 -" | pv -s 146G | dd of=sdd.bin.gz 
 ssh -p222 [email protected] "sudo dd if=/dev/sde bs=512 | gzip -1 -" | pv -s 146G | dd of=sde.bin.gz 
 ssh -p222 [email protected] "sudo dd if=/dev/sdf bs=512 | gzip -1 -" | pv -s 146G | dd of=sdf.bin.gz
root@ubuntu:~/hpsahba# ./hpsahba -i /dev/sda
VENDOR_ID='HP'
PRODUCT_ID='P410i'
BOARD_ID='0x3245103c'
SOFTWARE_NAME=
HARDWARE_NAME=
RUNNING_FIRM_REV='6.60'
ROM_FIRM_REV='6.60'
REC_ROM_INACTIVE_REV='6.60'
YET_MORE_CONTROLLER_FLAGS='0xfa71a216'
NVRAM_FLAGS='0x00'
HBA_MODE_SUPPORTED=1

PSA: Drive failure mai result in controller crash (P410i)

I've been using this project for more than one year already, and it's been rock solid on multiple platforms. However, recently I had a drive failure on a converted P410i, and the whole system froze. I had two ZFS arrays on those drives, one RAID1 and a RAID5. The drive that failed was part of the RAID5, but I noticed this when the whole system became unresponsive. Upon checking iLO, it seems that this caused the controller to crash (or the driver, the system did not work enough to check) and this brought down the RAID1 array as well. The root of that system was located on the RAID1 array, which is why the system froze.

The important note to take here is that drive failures may result in the controller completely freezing, bringing down any other arrays attached to it. Upon restarting, on POST, the controller informed me that "A controller failure event occurred, previous lock up code = 0xab" but worked fine afterward, including replacing the failed disk.

How to make drives unmasked

Hello,

What is the proper way of making drives visible in the OS?

I've tried to use hpssacli to create a logical volume (the usual process to make drives usable by the OS – before enabling HBA mode that is), but it ends with error, just like the Readme warned :)

Here's the output of hpssacli ctrl all show config:

Smart Array P410i in Slot 0 (Embedded)    (sn: 500???????1F5EF0)

   Port Name: 1I

   Port Name: 2I

   Internal Drive Cage at Port 1I, Box 1, OK

   Internal Drive Cage at Port 2I, Box 1, OK


   unassigned

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK)

   unassigned

      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 500 GB, OK)

   unassigned

      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 500 GB, OK)

   unassigned

      physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 500 GB, OK)

   unassigned

      physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 500 GB, OK)

   SEP (Vendor ID PMCSIERA, Model  SRC 8x6G) 250  (WWID: 5001???????F)

I have read that other HP controllers that officially support HBA mode need drives formatted to erase the hp-raid configuration off them before they can be passed-through to the OS. I've tried it with one of my drives, but it appears exactly as before, unassigned.

What do I do?

Thanks!

SUCCESS: HP P411

HW Used: HP P411 1024MB cache firmware v6.64
Computer: HP DL360 G7
Worked as described, only shell needed tweaking a bit to recognize correct headers.
Another problem I ran into was debian not wanting to pick up the module, so as a quick fix, instead of figuring out dkms, just copied the hpsa.ko from dkms to kernel modules folder.

Commande not found

Hello I am in the process of changing my p410i to hba but when I use the command sudo hpsahba -i / dev / sg1 I get this result sudo: hpsahba: command not found do you have a solution.

Thank you

DKMS Make error. Proxmox 7 (Kernel 5.13.19)

Hey all just wondering if anyone would know how to fix this error when trying to patch the kernel for this to work.

DKMS make.log for hpsa-dkms-1.0 for kernel 5.13.19-1-pve (x86_64) Sun 28 Nov 2021 11:08:57 PM AEDT make -C /usr/lib/modules/5.13.19-1-pve/build M=/var/lib/dkms/hpsa-dkms/1.0/build modules make[1]: Entering directory '/usr/src/linux-headers-5.13.19-1-pve' CC [M] /var/lib/dkms/hpsa-dkms/1.0/build/hpsa.o /var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:82:25: error: expected declaration specifiers or ‘...’ before string constant 82 | MODULE_SUPPORTED_DEVICE("HP Smart Array Controllers"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ make[2]: *** [scripts/Makefile.build:281: /var/lib/dkms/hpsa-dkms/1.0/build/hpsa.o] Error 1 make[1]: *** [Makefile:1879: /var/lib/dkms/hpsa-dkms/1.0/build] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.13.19-1-pve' make: *** [Makefile:14: default] Error 2

This is on a HP ProLiant DL380 G7 with the P410i.

Working on HP P410 / Desktop Motherboard / D2700 Enclosure.

Took a bit of effort but work wonderfully now. Thank you for sharing your efforts.
Motherboard: HP Angelica2
Controller: HP P410
Enclosure: HP D2700 (x2)
OS: Ubuntu Server 20.04 as well as TrueNAS SCALE both working

Other Details:
Smart Array P410 in Slot 1
Bus Interface: PCI
Slot: 1
Serial Number: PACCRCN80ZG1TQA
Cache Serial Number: PBCDF0CRH0C1Y5
RAID 6 (ADG) Status: Disabled
Controller Status: OK
Hardware Revision: C
Firmware Version: 6.64
Wait for Cache Room: Disabled
Surface Analysis Inconsistency Notification: Disabled
Post Prompt Timeout: 0 secs
Cache Board Present: True
Cache Status: Not Configured
Drive Write Cache: Disabled
Total Cache Size: 1024 MB
Total Cache Memory Available: 912 MB
No-Battery Write Cache: Disabled
Cache Backup Power Source: Capacitors
Battery/Capacitor Count: 1
Battery/Capacitor Status: OK
SATA NCQ Supported: True

Expander 250
Device Number: 250
Firmware Version: 0144
WWID: 5001438001A68FBF
Port: 2I
Box: 1
Vendor ID: HP

Enclosure SEP (Vendor ID HP, Model D2700 SAS AJ840A) 248
Device Number: 248
Firmware Version: 0144
WWID: 5001438001A68FBE
Port: 2I
Box: 1
Vendor ID: HP
Model: D2700 SAS AJ840A

SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 249
Device Number: 249
Firmware Version: RevC
WWID: 50014380092FF5AF
Vendor ID: PMCSIERA
Model: SRC 8x6G

P410i TRIM

Has anyone managed to get TRIM working?

[ 4572.111874] EXT4-fs (sda1): mounting with "discard" option, but the device does not support discard
[ 4572.111970] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: discard

lsblk -D
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda 0 0B 0B 0
└─sda1 0 0B 0B 0
sdb 0 0B 0B 0
├─sdb1 0 0B 0B 0
└─sdb2 0 0B 0B 0

fstrim -v /mnt
fstrim: /mnt: the discard operation is not supported

=== START OF INFORMATION SECTION ===
Device Model: Crucial_CT750MX300SSD1
Serial Number: 162412F8XXXX
LU WWN Device Id: 5 00a075 112f81a58
Firmware Version: M0CR050
User Capacity: 750,156,374,016 bytes [750 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Sun Aug 4 00:00:55 2019 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

Issue with P812 after having it workin

I had my P812 controller working for like 2 weeks, no issues. I ran the directions here:
https://github.com/im-0/hpsahba/tree/master/contrib/dkms

I am running Ubuntu 22 on kernel v 5.15.0-83. After editing patch.sh it worked with my 5.15 kernel. I added the line hpsa hpsa_use_nvram_hba_flag=1 to my modprobe file so it keeps after reboot. I rebooted multiple times in 2 weeks time period of it working, kept working, drives were there, I could access them, it worked.

Then one day all drives on that adapter just disappeared. I have rebooted, still won't come back. The controller see's them, they are just masked. HBA mode is enabled according to the tool:

./hpsahba -i /dev/sg0
VENDOR_ID='HP'
PRODUCT_ID='P812'
BOARD_ID='0x3249103c'
SOFTWARE_NAME=''
HARDWARE_NAME=''
RUNNING_FIRM_REV='3.66'
ROM_FIRM_REV='3.66'
REC_ROM_INACTIVE_REV='3.66'
YET_MORE_CONTROLLER_FLAGS='0xfa53a216'
NVRAM_FLAGS='0x08'
HBA_MODE_SUPPORTED=1
HBA_MODE_ENABLED=1

But yet, they are not there. I checked dmesg and this is what it gave me:

$ dmesg | grep masked
[    4.554241] hpsa 0000:42:00.0: scsi 1:0:1:0: masked Direct-Access     ATA      SSD 2TB          PHYS DRV SSDSmartPathCap- En- Exp=0
[    4.568580] hpsa 0000:42:00.0: scsi 1:0:2:0: masked Direct-Access     ATA      SSD 2TB          PHYS DRV SSDSmartPathCap- En- Exp=0
[    4.583223] hpsa 0000:42:00.0: scsi 1:0:3:0: masked Direct-Access     ATA      SSD 2TB          PHYS DRV SSDSmartPathCap- En- Exp=0
[    4.597927] hpsa 0000:42:00.0: scsi 1:0:4:0: masked Direct-Access     ATA      SSD 2TB          PHYS DRV SSDSmartPathCap- En- Exp=0
[    4.612871] hpsa 0000:42:00.0: scsi 1:0:5:0: masked Enclosure         HP       MSA70            enclosure SSDSmartPathCap- En- Exp=0
[    4.628075] hpsa 0000:42:00.0: scsi 1:0:6:0: masked Enclosure         HP       P812 INT EXP     enclosure SSDSmartPathCap- En- Exp=0
[    4.643197] hpsa 0000:42:00.0: scsi 1:0:7:0: masked Enclosure         PMCSIERA  SRC 8x6G        enclosure SSDSmartPathCap- En- Exp=0

So it seems they are there, it sees them, they are masked. If I check ssacli it gives me this:

$ ssacli ctrl all show detail

Smart Array P812 in Slot 4
   Bus Interface: PCI
   Slot: 4
   Serial Number: PAGXQ0ARHZY04W
   Cache Serial Number: PBCDF0CRH0D5U9
   RAID 6 Status: Enabled
   Controller Status: OK
   Hardware Revision: C
   Firmware Version: 3.66
   Firmware Supports Online Firmware Activation: False
   Cache Board Present: True
   Cache Status: Not Configured
   Total Cache Size: 1.0
   Total Cache Memory Available: 0.9
   Battery Backed Cache Size: 0.9
   Cache Backup Power Source: Capacitors
   Battery/Capacitor Count: 1
   Battery/Capacitor Status: OK
   Number of Ports: 6 (2 Internal / 4 External )
   Driver Name: hpsa
   Driver Version: 3.4.20
   WWN Port: 50014380132301B0
   HBA Mode Enabled: True
   PCI Address (Domain:Bus:Device.Function): 0000:42:00.0
   Port Max Phy Rate Limiting Supported: False
   Sanitize Erase Supported: False
   Primary Boot Volume: None
   Secondary Boot Volume: None
   SPDM Supports Get Slot Certificate Chain: no
   SPDM Supports Get Controller Info       : no
   SPDM Supports Get Slot Info             : no
   SPDM Supports Set Import Certificate    : no
   SPDM Supports Set Invalidate Slot       : no
   Surface Scan Completion Supported: False
   Persistent Event Log Policy Change Supported: False

$ cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: HP       Model: P812             Rev: 3.66
  Type:   RAID                             ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: SEAGATE  Model: ST3146356SS      Rev: HS0F
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: WD       Model: WD3001FYYG-01SL3 Rev: VR07
  Type:   Direct-Access                    ANSI  SCSI revision: 06
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: WD       Model: WD3001FYYG-01SL3 Rev: VR07
  Type:   Direct-Access                    ANSI  SCSI revision: 06
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: WD       Model: WD3001FYYG-01SL3 Rev: VR07
  Type:   Direct-Access                    ANSI  SCSI revision: 06
Host: scsi0 Channel: 00 Id: 04 Lun: 00
  Vendor: SEAGATE  Model: ST3146356SS      Rev: HS0F
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 05 Lun: 00
  Vendor: WD       Model: WD3001FYYG-01SL3 Rev: VR07
  Type:   Direct-Access                    ANSI  SCSI revision: 06
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: WD       Model: WD3001FYYG-01SL3 Rev: VR07
$ ssacli ctrl slot=4 pd all show detail

Smart Array P812 in Slot 4

   HBA Drives

      physicaldrive 4E:1:1
         Port: 4E
         Box: 1
         Bay: 1
         Status: OK
         Drive Type: HBA Mode Drive
         Interface Type: Solid State SATA
         Size: 2 TB
         Drive exposed to OS: False
         Logical/Physical Block Size: 512/512
         Firmware Revision: U1014A0
         Serial Number: AA202300002100001831
         WWID: 50014380042BA501
         Model: ATA     SSD 2TB
         SATA NCQ Capable: True
         SATA NCQ Enabled: True
         SSD Smart Trip Wearout: Not Supported
         PHY Count: 1
         PHY Transfer Rate: 1.5Gbps
         PHY Physical Link Rate: Unknown
         PHY Maximum Link Rate: Unknown
         Sanitize Erase Supported: False
         Shingled Magnetic Recording Support: None

So I swapped the drives out and rebooted, thinking maybe something happened to the drives. Still the same thing, won't show up. So then I re-ran modprobe to see if I could get them to re-show:

$ modprobe -r hpsa
$ modprobe hpsa hpsa_use_nvram_hba_flag=1

Still don't show up and below is what dmesg shows me:

[ 1128.665648] hpsa: unknown parameter 'hpsa_use_nvram_hba_flag' ignored
[ 1128.665655] hpsa: unknown parameter 'hpsa_use_nvram_hba_flag' ignored
[ 1128.665811] HP HPSA Driver (v 3.4.20-200)
[ 1128.665853] hpsa 0000:42:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 1128.666674] hpsa 0000:42:00.0: Logical aborts not supported
[ 1128.666679] hpsa 0000:42:00.0: HP SSD Smart Path aborts not supported
[ 1128.708189] scsi host0: hpsa
[ 1128.708832] hpsa can't handle SMP requests
[ 1130.092220] hpsa 0000:42:00.0: scsi 0:0:0:0: added RAID              HP       P812             controller SSDSmartPathCap- En- Exp=1
[ 1130.092227] hpsa 0000:42:00.0: scsi 0:0:1:0: masked Direct-Access     ATA      WDC WD20SPZX-22U PHYS DRV SSDSmartPathCap- En- Exp=0
[ 1130.092230] hpsa 0000:42:00.0: scsi 0:0:2:0: masked Direct-Access     ATA      WDC WD20SPZX-22U PHYS DRV SSDSmartPathCap- En- Exp=0
[ 1130.092233] hpsa 0000:42:00.0: scsi 0:0:3:0: masked Direct-Access     ATA      WDC WD20SPZX-22U PHYS DRV SSDSmartPathCap- En- Exp=0
[ 1130.092236] hpsa 0000:42:00.0: scsi 0:0:4:0: masked Direct-Access     ATA      WDC WD20SPZX-22U PHYS DRV SSDSmartPathCap- En- Exp=0
[ 1130.092239] hpsa 0000:42:00.0: scsi 0:0:5:0: masked Direct-Access     ATA      WDC WD20SPZX-22U PHYS DRV SSDSmartPathCap- En- Exp=0
[ 1130.092241] hpsa 0000:42:00.0: scsi 0:0:6:0: masked Enclosure         HP       MSA70            enclosure SSDSmartPathCap- En- Exp=0
[ 1130.092244] hpsa 0000:42:00.0: scsi 0:0:7:0: masked Enclosure         HP       P812 INT EXP     enclosure SSDSmartPathCap- En- Exp=0
[ 1130.092246] hpsa 0000:42:00.0: scsi 0:0:8:0: masked Enclosure         PMCSIERA  SRC 8x6G        enclosure SSDSmartPathCap- En- Exp=0
[ 1130.092336] hpsa can't handle SMP requests
[ 1130.092823] scsi 0:0:0:0: RAID              HP       P812             3.66 PQ: 0 ANSI: 5
[ 1130.093612] scsi 0:0:0:0: Attached scsi generic sg0 type 12

I know the drives are good, if I plug them into another computer they work fine.

Like I said, this worked for 2 whole weeks, then just stopped one day 2 or 3 weeks ago and I have not been able to get them back up since then. Nothing has changed in the server since it worked, I haven't upgraded anything, kernel still the same version.

hpsahba: command not found

When testing the hpsahba command I get:
~/hpsahba$ hpsahba -i hpsahba: command not found

I'm confused. It's a fresh install. Surely it should have no issues, right?

P212 4TB Drive

Hey,
do you know why the p212 dont recognize 4TB HDDs in HBA mode?
The drives only work in raid mode (now i have a raid 0 setup..)

P410 SMART Support for Drives

Hi,
do you have any experiences with trying to gather SMART values from the drives in the controller?
I tried it, but get the following error: /dev/sdc: requires option '-d cciss,N'
Is there anything additional useful I can provide to you?

I'am running this on a the following (yeah I know not supported) kernel:
Linux proxmox-test 5.4.78-2-pve #1 SMP PVE 5.4.78-2 (Thu, 03 Dec 2020 14:26:17 +0100) x86_64 GNU/Linux
I'm going to validate this behaviour on a regular debian buster.

Thank you for this project.
I'am migrating about a dozen of server at the moment to native zfs thanks to this solution.

Documenting PSU Explosion

Running gentoo on 1.10 kernel my PSU exploded on a Proliant DL380 G7 while mounting the hpsahba drives during the initramfs! Thankfully, nothing was harmed and that was a new server, with no data on it. All is well

Two things:

  1. Be very careful when using this! I am not blaming this project for what happened. But, it happened nonetheless
  2. IF YOU ARE USING OLD HARDWARE FOR THE LOVE OF GOD CHANGE OUT THE OLD PSU WITH SOMETHING NEW AND HIGH QUALITY. These servers are very cheap, don't skimp out on important stuff

dkms module will not build on Ubuntu 22.04.3 LTS

make.log

DKMS make.log for hpsa-dkms-1.0 for kernel 5.15.0-86-generic (x86_64)
Wed Oct 18 02:17:36 PM UTC 2023
make -C /usr/lib/modules/5.15.0-86-generic/build M=/var/lib/dkms/hpsa-dkms/1.0/build modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-86-generic'
CC [M] /var/lib/dkms/hpsa-dkms/1.0/build/hpsa.o
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:82:25: error: expected declaration specifiers or ‘...’ before string constant
82 | MODULE_SUPPORTED_DEVICE("HP Smart Array Controllers");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from ./include/linux/list.h:9,
from ./include/linux/module.h:12,
from /var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:20:
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c: In function ‘hpsa_scsi_queue_command’:
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5777:19: error: ‘struct scsi_cmnd’ has no member named ‘request’
5777 | BUG_ON(cmd->request->tag < 0);
| ^~
./include/linux/compiler.h:78:45: note: in definition of macro ‘unlikely’
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5777:9: note: in expansion of macro ‘BUG_ON’
5777 | BUG_ON(cmd->request->tag < 0);
| ^~~~~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5816:51: error: ‘struct scsi_cmnd’ has no member named ‘request’
5816 | !blk_rq_is_passthrough(cmd->request) &&
| ^~
./include/linux/compiler.h:77:45: note: in definition of macro ‘likely’
77 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c: In function ‘hpsa_get_cmd_index’:
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5980:23: error: ‘struct scsi_cmnd’ has no member named ‘request’
5980 | int idx = scmd->request->tag;
| ^~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c: In function ‘hpsa_scsi_ioaccel_raid_map’:
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5247:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
5247 | is_write = 1;
| ~~~~~~~~~^~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5249:9: note: here
5249 | case READ_6:
| ^~~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5258:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
5258 | is_write = 1;
| ~~~~~~~~~^~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5260:9: note: here
5260 | case READ_10:
| ^~~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5271:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
5271 | is_write = 1;
| ~~~~~~~~~^~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5273:9: note: here
5273 | case READ_12:
| ^~~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5286:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
5286 | is_write = 1;
| ~~~~~~~~~^~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:5288:9: note: here
5288 | case READ_16:
| ^~~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c: In function ‘fixup_ioaccel_cdb’:
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:4797:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
4797 | is_write = 1;
| ~~~~~~~~~^~~
/var/lib/dkms/hpsa-dkms/1.0/build/hpsa.c:4799:9: note: here
4799 | case READ_6:
| ^~~~
make[2]: *** [scripts/Makefile.build:297: /var/lib/dkms/hpsa-dkms/1.0/build/hpsa.o] Error 1
make[1]: *** [Makefile:1909: /var/lib/dkms/hpsa-dkms/1.0/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-86-generic'
make: *** [Makefile:14: default] Error 2

P410 or P410i?

Will this work on integrated P410 module? or is it only for external P410i card

Tested and working on HP P212 controller

I got my hands on a HP P212 card for cheap and used it for testing, it has been running for about three weeks now:

Kernel: Linux 4.19.144-hba #1 SMP Thu Sep 10 11:30:31 CEST 2020 x86_64 GNU/Linux
with hpsa.hpsa_use_nvram_hba_flag=1

lspci -nn -vv | grep Hewlett
02:00.0 RAID bus controller [0104]: Hewlett-Packard Company Smart Array G6 controllers [103c:323a] (rev 01)
        Subsystem: Hewlett-Packard Company Smart Array P212 [103c:3241]
./hpsahba -i /dev/sg18
VENDOR_ID='HP'
PRODUCT_ID='P212'
BOARD_ID='0x3241103c'
SOFTWARE_NAME=''
HARDWARE_NAME=''
RUNNING_FIRM_REV='6.64'
ROM_FIRM_REV='6.63'
REC_ROM_INACTIVE_REV='6.63'
YET_MORE_CONTROLLER_FLAGS='0xfa55a216'
NVRAM_FLAGS='0x08'
HBA_MODE_SUPPORTED=1
HBA_MODE_ENABLED=1

Currently running with two disks, both working fine and at rated speed and no errors (HGST 3TB SAS drives).

hpsa-dkms doesn't patch kenerl during kernel update

The hpsa-dkms doesn't generate hpsa module with hpsa_use_nvram_hba_flag during kernel upgrade. It suggests that the hpsa is not been patched. If I remove hpsa-dkms by dkms remove hpsa-dkms/1.0 --all and patch the kernel again, it works again.

I don't know the reason, but I post here for others who may have similiar case.

Test on: Proxmox 7.2 with kernel PVE 5.15.39-3.

CentOS 8 kernel support

Hi,

the switch to HBA mode and back was successful on HP SE316M1 system with P410i card.

But I was not able to adapt your kernel patches to build a CentOS 4.18.0 custom kernel or kernel-ml 5.6.x from elrepo-kernel. As I've seen on the kernel mailing list hpsahba will not accepted. You are able to provide patches to build the custom kernel?

Thanks.

Success - DL380G5 & P400 - Debian 11 (Kernel 5.10)

First and foremost let me thank you for this amazing piece of software. I have a HP DL380 G5 with a P400 running firmware 7.24.

Call me crazy, but I'm doing the tests via iLO of all things. I've used the DKMS installation for the driver, applied the kernel arguments as specified and rebooted. Much to my surprise, it says it's supported! So I bit the bullet, turned on HBA mode. Amazingly, doing a ls afterwards showed Input/Output error! I could not believe it.

Rebooted via iLO and I do indeed see the message that "Raid is disabled from NVRAM ..."

I could not resist reporting, so here we are. I nuked my system but it was a kamikaze install, so no losses there.

I'll be back with more info once I installed a pre-patched system on the drives. Stay tuned!

EDIT: Controller details

VENDOR_ID='HP'
PRODUCT_ID='P400'
BOARD_ID='0x3234103c'
SOFTWARE_NAME=''
HARDWARE_NAME=''
RUNNING_FIRM_REV='7.24'
ROM_FIRM_REV='7.24'
REC_ROM_INACTIVE_REV='7.24'
YET_MORE_CONTROLLER_FLAGS='0x5a51a206'
NVRAM_FLAGS='0x00'
HBA_MODE_SUPPORTED=1
HBA_MODE_ENABLED=0

Please rename kernel module

Reusing the original kernel module name seems to be source of several issues. For us whenever new kernel is installed we end up with non-bootable system.

I would recommend using new name for the patched module and blacklisting the original one

Succes creating HBA on P410 but...

I have successfully put in HBA mode my P410 on DL160 G6, but when I try to install TrueNas, doesn't appear any disk. Any configuration after HBA mode? Any suggestion?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.