I have a situation where I need dynamically expandable storage space on a Linux machine running in Amazon EC2, and ZFS came to mind. If I remember properly, ZFS supports a way to dynamically expand a non-redundant JBOD-like array.
I have a few requirements for a project I'm working on:
- I should be able to move the array to another EC2 instance if need be.
- I should be able to dynamically expand the ZFS array, adding new "drives" to the ZFS volume without any downtime.
Is this possible? If ZFS provides the ability to dynamically expand the array, I should be able to run a script which would dynamically create new EBS volumes, attach them to the EC2 instance, and have ZFS add them to its pool, all dynamically without downtime.
Best Answer
ZFS on Linux does not have a critical mass following, whatever that may be. ZFS will effectively lock you in. The underlying format is incompatible with rescue disks, and distributions for which you will find ZFS is rare.
I would tend to overlook these limits due to my bias towards ZFS. You may want to google for a service provider that provides SmartOS/ZFS based Cloud housting.
Linux file systems ext3/ext4 and probably various others do allow for dynamic growing. The volume manager built into Linux, LVM, also allows you to dynamically expand volumes onto new disks. For anything other than experimentation this would have to be the current best Linux recommendation, though that would change once ZFS got a critical mass following on Linux.
The process for Linux + LVM + ext3 is:
Example: LVM volume group myvg, mounted volume name uservol1, and disk device in Linux is /dev/sdf
fdisk / sfdisk
pvcreate /dev/sdf
vgextend myvg /dev/sdf
lvextend -L +1024G /dev/myvg/uservol1
resize2fs /dev/myvg/uservol1
df -h
) and you should see that the mounted file system now have more space.QED.