I have a 8 TB EBS drive on Amazon (ext4, directly mounted without partitions)
I didn't use sw-raid for ages, so my assumption might be wrong that I can shrink the disk that way.
I want to shrink this EBS drive live in a production system down to 5TB (-3TB)
The drive will be constantly written at 100-200mb/sec (production database and tools)
Amazon doesn't offer shrinking of EBS, the only solutions I could find (and used in the past) involved creating a second EBS and copying everything over, typically using 'rsync'.
That's not an option, EBS is slow and given that I have a system that permanently changes files that are larger than 2TB in size (database files) rsync could never ever catch up on the changes.
Idea I thought about "converting" my EXT4 8TB disk into a RAID-1 (initially with a missing second disk). I'd use a metadata version that adds the metadata at the end of my disk (I can just shrink the filesystem for that).
When creating md0 of my 8TB disk, is there anything that stops me from mounting it again as EXT4 and ignoring that it's a raid disk ?
As I understood it the only change is actually that the 'metadata' is added (appended) so it should still "legally" be a normal ext4 disk ?
Is that true ? And is it still true when mounting it as MD0 and writing to it ?
Given that's riskless I'd now create the md0 with a missing 2nd disk, mount it (so a few minutes downtime of the server involved)
Now I want to resize2fs the fileysystem down by 3TB and then I want to mdadm --grow (shrink) md0 down to 5TB total size.
Now I want to add a second EBS drive (5TB) to the raid as second disk and have it synced.
Second question Can I do that ? adding a 5TB disk that way ?
I'd remove the original 8TB disk now and either keep using single-disk md0 or just mount the ext4 of md0 directly and not use raid anymore at all.
If mdadm isn't suitable, is LVM capable ? (I came to mdadm because it seems to stay compatible with ext4 so I can just go back to direct mount after it's done. With LVM that's not possible)
That's it, sorry for the long text. I guess I missed something. Can't be that easy as no other article or answer mentioned using mdadm to solve that problem.