|
1 | 1 | # HP SMART ARRAY RAID READER |
| 2 | +<p align="center"> |
| 3 | + <img src="./assets/smartarrayreader.jpg" alt="Cover image"/> |
| 4 | + <i>Wait, since when does P420 have a fan? Since I used a superglue!</i> |
| 5 | +</p> |
| 6 | + |
2 | 7 | > I hope you and I will never have to use this program. |
3 | 8 |
|
4 | 9 | > Everything was implemented and tested using HP Smart Array P420 with 8.00-0 firmware version. I don't know if it will work correctly for arrays operated with different controller or firmware version. |
5 | 10 |
|
6 | | -You had very nice Hardware RAID 6 array operated with HP Smart Array Controller but the controller have died? Now you have to buy new controller and wait 'til it arrives and pray for it to work in order to recover your precious data? **NOT ANYMORE**. Here it is brand new tool to read smart drive arrays, all you need to do is to `modprobe nbd` kernel module and provide drives in the correct order with raid level: |
7 | | -```sh |
8 | | -sudo modprobe nbd |
9 | | -sudo ./hewlett-read --raid=6 /dev/sdb /dev/sdc /dev/sdd /dev/sde |
10 | | -``` |
11 | | -And now you have it under `/dev/nbd0`! If you had partions there you can mount it: |
12 | | -``` |
13 | | -sudo mount -o ro /dev/nbd0p1 /mnt/cool |
14 | | -``` |
15 | | -You must remember to mount it as readonly `-o ro`, otherwise it will fail. |
| 11 | +You had very nice Hardware RAID 6 array operated with HP Smart Array Controller but the controller have died? Now you have to buy new controller and wait 'til it arrives and pray for it to work in order to recover your precious data? **NOT ANYMORE**. Here it is brand new tool to read smart drive arrays on Linux! |
16 | 12 |
|
17 | | -And here you go, you can now safely copy all your data without buying another Smart Array Controller. |
| 13 | +## Compiling |
| 14 | +You need to install `nbd` client, at least BUSE documentation says you have to. On Arch Linux it's `pacman -S nbd`. |
18 | 15 |
|
19 | | -But wait! What if you have forgotten the order of the drives? Don't worry, just use `packard-tell`! |
| 16 | +Sorry, I can't into `make`, so to compile you just do |
20 | 17 | ```sh |
21 | | -sudo ./packard-tell /dev/sdd /dev/sdb /dev/sdc /dev/sde |
| 18 | +./build.sh |
22 | 19 | ``` |
23 | | -and this what packard-tell will tell you: |
| 20 | +and wait for ages for it to compile. |
| 21 | + |
| 22 | +## Usage |
| 23 | +First load `nbd` kernel module: |
| 24 | +```sh |
| 25 | +sudo modprobe nbd |
24 | 26 | ``` |
25 | | -The correct order is: |
26 | | -/dev/sdb /dev/sdc /dev/sdd /dev/sde |
| 27 | +Then use `packard-tell` to identify logical drives on the array: |
| 28 | +```sh |
| 29 | +./packard-tell /dev/sdb /dev/sdc /dev/sdd /dev/sde |
27 | 30 | ``` |
| 31 | +If some of your drives failed you don't have to provide them, packard-tell will figure out which drives are missing. Example: |
| 32 | + |
| 33 | + |
| 34 | +> Note: If some property returned from `packard-tell` is followed by `?` for example `Serial?` then that means I am not sure if it's 100% correct. For my case it was correct ^^ |
28 | 35 |
|
29 | | -And if you have missing drive for RAID 5 or two\* missing drives for RAID 6 you can replace drive with `X`, for example: |
| 36 | +After you found logical drive that you want to mount use command provided by `packard-tell` |
| 37 | +It will assemble the array and expose it on `/dev/nbd0`. This is readonly. Use lsblk to identify if there are any partitions. Now you can mount with `mount -o ro`, for example: |
30 | 38 | ```sh |
31 | | -sudo ./hewlett-read /dev/sdb /dev/sdc X /dev/sde |
| 39 | +mount -o ro /dev/nbd0p1 /mnt/d1 --mkdir |
32 | 40 | ``` |
| 41 | +Remember to include `-o ro`, otherwise you will get an error as `hewlett-read` exposes raid array as readonly. |
33 | 42 |
|
34 | | -> \* *For RAID 6 only 1 missing drive recovery works at this moment.* |
| 43 | +If you want to use other `nbd` target then you can use `--out` option on `hewlett-read` command, for example `--out /dev/nbd1`. |
35 | 44 |
|
36 | | -## Compiling |
37 | | -Sorry, I can't into `make`, so to compile you just do |
| 45 | +If your metadata are destroyed you can use `hewlett-read` directly, if you don't provide size it will use maximum size possible. It won't read last `32MB` from drives tho, coz metadata lays there and I just ignore that section. Example: |
38 | 46 | ```sh |
39 | | -./build.sh |
| 47 | +./hewlett-read --raid=5 /dev/sdc /dev/sdd /dev/sdf |
40 | 48 | ``` |
41 | | -and wait for ages for it to compile. |
| 49 | +If one drive has failed replace it's path with `X`: |
| 50 | +```sh |
| 51 | +./hewlett-read --raid=5 /dev/sdc X /dev/sdf |
| 52 | +``` |
| 53 | + |
| 54 | +Of course you have to remember, RAID 0 can't have failed drives, RAID 5 only one, RAID 6 only two\* |
| 55 | + |
| 56 | +> \* *For RAID 6 only 1 missing drive recovery works at this moment. - see [Raid 6 problem](./raid-6-problem)* |
| 57 | +
|
| 58 | +## Features |
| 59 | +- Reading and parsing controller metadata |
| 60 | +- Assembling RAID 0, 1, 5, 6, 10, 50, 60 |
| 61 | +- Supports multiple logical drives on single array |
| 62 | +- Supports recovery in case of failed drive in RAID 1, 5 and 6 |
| 63 | +- Supports recovery in case of failed drive for each mirror group in RAID 10 |
| 64 | +- Supports recovery in case of failed drive for each pairty group in RAID 50 and 60 |
| 65 | + |
| 66 | +## Caveats |
| 67 | +- Sometimes it doesn't read correctly very end of drive, last full stripe to be precise. I don't really know why, sorry. This shouldn't be a problem until you filled up your RAID array to the very last megabyte. |
42 | 68 |
|
43 | 69 | ## TODO |
44 | 70 | - [ ] RAID 6 with 2 missing drives - see [Raid 6 problem](./raid-6-problem) |
45 | | -- [x] RAID 10 |
46 | | -- [x] RAID 50 |
47 | | -- [x] RAID 60 |
48 | | -- [x] Better error handling |
49 | | -- [x] Code cleanup |
50 | | -- [x] Reading metadata from drives with `packard-tell` |
51 | | -- [ ] Writing blogpost about everything that I know about P420 controller |
52 | 71 |
|
53 | 72 | ## Libraries used |
54 | 73 | [BUSE](https://github.com/acozzette/BUSE) - :purple_heart: |
|
0 commit comments