Just a few clarifications, pre-chewed wisdom for weak teeth. Like a lot of Linux documentation this helpful tutorial assumes a little more knowledge than some regular users may have.
You can figure out what your RAID array is called by looking at the /dev directory, it will be md#, e.g. md0 or md1, etc. To get more details about the RAID arrays so you can pick the right one try this command:
mdadm -D /dev/md#
with # being the number of the array. It will give you info like this:
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Name : we:0 (local to host we)
UUID : 94777f33ltjj97
Events : 136
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
2 8 34 2 active sync /dev/sdc2
4 8 50 3 active sync /dev/sdd2
No quotation marks are present in the command to grow the RAID file system and the "-n" refers to the new total number of drives in the array. So if you are expanding a RAID 5 array from 4 to five drives you might use this:
mdadm --grow -n 5 /dev/md2
Run this command to see how the RAID incorporation is going:
With a big drive and a slow system the resizing the RAID could take a very long time, even days. When it reaches 100% you are ready for the next step. If you have LVM partitioning over a LUKS encrypted partition first you need to resize the encrypted volume. To figure it out you can look at the /dev/mapper folder. Select the encrypted volume, not any of the LVM logical volumes.Since my system was running I apparently didn't need to do the first of the commands the tutorial gives:
cryptsetup luksOpen /dev/md0 md0_crypt
*Device md0_crypt already exists*
If the second command works it will not give any output, like so many Linux commands:
cryptsetup resize md0_crypt
Next it is time to resize the LVM scheme. I figured out what to run the pvresize command on with this command: pvs -o +tags
pvs -o +tags
*PV VG Fmt Attr PSize PFree PV Tags
/dev/dm-0 vg0 lvm2 a-- 1.02g 0*
So I ran the pvresize command on the physical volume, and it told me it had succeeded.
*Physical volume "/dev/dm-0" changed
1 physical volume(s) resized / 0 physical volume(s) not resized*
Next decide which logical volume you wish to expand with the lvdisplay command. That will tell you what your logical volumes are called. The name of your volume group will be in the /dev folder. In my case I used:
Look at the fields that say "LV Name"
I decided to add all the new space to one of my logical volumes using this command:
lvresize -l +100%FREE /dev/mapper/vg0-system
Extending logical volume system to 7.17 GiB
Logical volume system successfully resized
Finally, you can resize the LVM so the changes take effect using the resize2fs command.
*resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mapper/vg0-system is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mapper/vg0-system to 1879040 (4k) blocks.
The filesystem on /dev/mapper/vg0-system is now 1879040 blocks long.*
After that process finishes (which may take a while) you can use the 'df -h' command to see the new size of your file system. I found the whole process a little scary, so I wanted to spell out the commands to reduce anxiety for others.