add a device in raid-array
Needs ReviewPublic

Authored by devkantk on Apr 7 2019, 1:29 PM.

Details

Diff Detail

Repository
R16 KPMCore
Branch
resize-raid (branched from raid-support)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10576
Build 10594: arc lint + arc unit
devkantk requested review of this revision.Apr 7 2019, 1:29 PM
devkantk created this revision.
cjlcarvalho requested changes to this revision.EditedApr 8 2019, 5:56 AM

I think that maybe you are trying to grow arrays in a wrong way. Use the complete command with "--manage --add" instead of only using "--add".

You may also need to run

mdadm --grow --raid-devices=[new quantity of devices] path

before finishing the operation.

And mdadm does not update the configuration file after growing an array, so you should include the modification of it to update the number of devices in the array, otherwise udev will not locate the array devices properly after reboot.

Also take a look if you may need to resize the file system of the active array to take advantage of the added device.

src/core/raid/softwareraid.cpp
91

Missing semicolon

91

Use

mdadm --manage --add path args

instead of

mdadm path --add args
99

Please indent

This revision now requires changes to proceed.Apr 8 2019, 5:56 AM
devkantk updated this revision to Diff 55843.Apr 9 2019, 5:28 PM
devkantk marked 3 inline comments as done.

added grow command

cjlcarvalho added a comment.EditedApr 10 2019, 4:02 AM

Good! Another thing that you still need to do is edit the mdadm configuration file with the new quantity of devices in the array.

After fixing that, you will need to do two more things to allow the growing process of RAID devices in partitionmanager.

The first thing is adapting ResizeVolumeGroupJob (src/jobs/resizevolumegroupjob) and ResizeVolumeGroupOperation (src/ops/resizevolumegroupoperation) in kpmcore to allow the process of growing RAID devices, using the Job to call your SoftwareRAID::growArray method. Now they are only allowing kpmcore to resize LVM. You can take a look at CreateVolumeGroupJob and CreateVolumeGroupOperation to see how I have adapted them to create RAID devices, because they only allowed LVM before that.

The second thing is basically to modify the ResizeVolumeGroupDialog in partitionmanager to enable the resize of RAID devices. Then you can do the operation through this GUI and test if the arrays are growing properly.