JS Ext
Thursday, August 29, 2013
ZFS and dynamic sized volumes
ZFS has an interesting way of handing volume sizes that took me a bit to figure out. In a normal volume management system, you create a virtual block device (volume) of a fixed size. You can create multiple volumes, but the total disk size of all the volumes cannot exceed the total pool size. In ZFS, things are a bit different. Since volume management is built into ZFS, a volume can have a variable size. For example, lets create am imaginary 2GB pool in ZFS and LVM. Now, create a volume in each called "photos". In LVM, you have to give it a size of 1GB, then format it as EXT3. Now you add 250MB of pictures onto the volume. Next, you want to create a volume for "videos". In the LVM world, you can only create a 1GB volume. If you want more space, you have to grow your pool first. In the ZFS world, the "photos" volume wasn't created with a fixed size (unless you accidentally create it in legacy mode like I did). The df command will report that the "photos" volume started out with 2GB free. Once you add the 250MB of photos, then it would be reported as 1.75GB free. Once you create the "videos" volume, df will report it as having 1.75GB free as well. This means you have the full 2GB of disk space available for files. There is no dead space at the end of volumes!
Labels:
Filesystems,
Hard Disks,
Linux
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.