📜 ⬆️ ⬇️

Converting RAID 10 of 4 drives to RAID 6 of 8 drives on HP Proliant servers

image

We will perform the conversion on the HP Proliant DL160 G8 server with the usual partitioning into sections (not lvm). Those. drives sda1 ... sda8, each of which is mounted in a specific directory. In the case of lvm, the process is slightly easier and more convenient. The article should be suitable for any hp-server that uses the official utility hpacucli. In this example, we have CentOS 6.5, but any Linux supported by hpacucli will do.

In the process of conversion, to add space to CentOS, you will have to unmount the directory to which we will add free space (the last one in the partitioned table is parted - sda8), and also make a reboot, unless all sections of sda1..sda8 are used by any process.

Add wheels

Check what kind of RAID we have, how many disks there are, as well as how many disks are not used:
#hpacucli ctrl all show config
In our case, the team will show 4 disks in RAID 10 and 4 unused disks that we just inserted.
')
Add unused drives to RAID 10:
#hpacucli ctrl slot=2 ld 1 add drives=allunassigned

Convert RAID 10 to RAID 6

Convert with the command:
#hpacucli ctrl slot=2 ld 1 modify raid=6
Check that we now have RAID 6 out of 8 disks:
#hpacucli ctrl all show config
Smart Array P420 in Slot 2 (sn: PDSXK0BRH5S1AY)
array A (SAS, Unused Space: 1525708 MB)
logicaldrive 1 (558.7 GB, RAID 6 (ADG), OK)
physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 300 GB, OK)
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 300 GB, OK)
physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 300 GB, OK)
physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 300 GB, OK)
physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 300 GB, OK)
physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 300 GB, OK)
physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 300 GB, OK)
physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 300 GB, OK)
Expand the resulting RAID to the maximum size:
#hpacucli ctrl slot=2 ld 1 modify size=max
array A (SAS, Unused Space: 0 MB)

Adding space to CentOS


Making CentOS re-scan RAID:
#echo 1 > /sys/block/sda/device/rescan
We look that physically the place appeared:
#fdisk -l

Adding free space to the last section in the partition table

Let's look at the current partition table by converting units of measurement into sectors:
#parted /dev/sda
(parted) unit s
(parted) print
Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sda: 3515228764s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 2048s 1026047s 1024000s primary ext4 boot
2 1026048s 84912127s 83886080s primary ext4
3 84912128s 168798207s 83886080s primary ext4
4 168798208s 1171743323s 1002945116s extended
5 168800256s 252686335s 83886080s logical ext4
6 252688384s 294631423s 41943040s logical ext4
7 294633472s 303022079s 8388608s logical linux-swap(v1)
8 303025152s 1171743323s 868718172s logical ext4
We see that the last section is the 8th. Remember the beginning of the 8th section (303025152s). We look where it is mounted:
#mount |grep sda8
/dev/sda8 on /var/lib type ext4 (rw)
We are looking for whether anyone uses the / var / lib directory:
#lsof /var/lib
Turn off all services / processes that this utility has shown.
Now you can unmount the directory:
#umount /var/lib
If we have only one partition where the root of the system is located, then we are not lucky, and we will have to boot into rescue mode, after which we can continue on.
We can add a place only to the last (8th) section.
First, increase the 4th extended partition, because All sections with more than four numbers are essentially contained inside the 4th:
#parted
(parted) resize 4 168798208s -1s
We delete the 8th section (nothing will happen to the data) and create a new one using the memorized sector number of the beginning of this section.
(parted) rm 8
(parted) mkpart logical ext4 303024128s -1s

Now in order for CentOS to see the modified partition table, if no process uses the sda1..sda8 partitions, then we simply do partprobe / dev / sda, otherwise (more likely) we simply reboot the server.
After this, we increase the partition's file system (if we managed to avoid a reboot, then you need to remember to mount the partition back with the command mount / dev / sda8 / var / lib):
#resize2fs /dev/sda8

Checking:
#df -h
/dev/sda8 1.5T 229M 1.4T 1% /var/lib
PS
Why did we convert RAID 10 to RAID 6?
Because it is much faster for 8 disks. This fact is verified and tested by me personally.
Useful links:

Hpacucli Utility for Linux - All Commands Guide .

Source: https://habr.com/ru/post/217967/


All Articles