Resizing partitions on a RAID 0 Array by command line
Solution 1:
Ext2, ext3 and ext4 are evolutions of the same filesystem; in fact an ext4 filesystem with none of the newer features activated is an ext3 filesystem, and an ext3 filesystem with none of the newer features activated is an ext2 filesystem. That's why there's no separate set of programs for ext3 and ext4: it's the same set of tools, e2fsprogs, that's been gradually enhanced to cope with ext3 and ext4.
A limitation of resize2fs
(“ext2/ext3/ext4 file system resizer”) is that it can shrink a filesystem only while it's unmounted. So if you want to shrink /home
, you'll need to unmount it first. You can enlarge a mounted filesystem, that won't be a problem for /
.
Your bigger problem will be resizing the RAID-0 array. The one tool to manage RAID arrays is mdadm
. As far as I know, it's not possible to resize a RAID-0 array.
As far as I can see, you're stuck with this configuration unless you're willing to copy all the data off /home
and /
for the duration of the maintenance. (You could get away with copying only the data off /home
and creating a larger root partition encroaching on its space.) You could use that unpartitioned space at the beginning of the disk to store the current contents of /home
. This is not very difficult, but it is error-prone. That's not something I'd attempt without physical access (it's especially easy to screw up the bootloader when you're shuffling the root partition around). Your lack of familiarity with the tools makes it all the more likely that you'll make a tiny mistake that's easily fixed but only by inserting a boot CD.
My recommendation would be to move a large chunk of /
to /home
and create a symbolic link, until such time as someone can attend that server physically.
For the future, I recommend not using md-RAID's RAID-0 and using LVM stripping instead. LVM volumes can be resized, even stripped volumes. LVM is slightly slower here, but easier to manage (as the issue you're having now illustrates). Use RAID for mirroring (RAID-1) and for other RAID modes.
Also, should you decide to stick to RAID-0 for that 5% performance boost, it would have been easier if you'd had a single RAID-0 array.