The three primary goals of ZFS are:
- Highly scalable (128-bit) data repository
- Ease of administration
- Guaranteed on disk data integrity
Sample ZFS commands and usage
What You Do and See | Why |
$ man zpool | Get familiar with command structure and options |
$ su | Create some “virtual devices” or vdevs as described in the zpool documentation. These can also be real disk slices if you have them available. |
# zpool create myzfs /disk1 /disk2 | Create a storage pool and check the size and usage. |
# zpool status -v | Get more detailed status of the zfs storage pool. |
# zpool destroy myzfs | Destroy a zfs storage pool |
# zpool create myzfs mirror /disk1 /disk4 | Attempt to create a zfs pool with different size vdevs fails. Using -f options forces it to occur but only uses space allowed by smallest device. |
# zpool create myzfs mirror /disk1 /disk2 | Create a mirrored pool. I’m not sure at this time why it is labeled as faulted. |
# zpool iostat 5 | Get I/O statistics for the pool |
# zfs create myzfs/jim | Create a file system and check it with standard df -k command. Note the size is 83.5 MB from a 100 MB zpool (mirrored). File systems are automatically mounted by default under the /zfs location. See the Mountpoints section of the zfs man page for more details. |
# zfs list | List current zfs file systems. |
# zpool add myzfs /disk3 | Attempt to add a single vdev to a mirrored set fails |
# zpool add myzfs mirror /disk3 /disk5 | Add a mirrored set of vdevs |
# zfs create myzfs/jim2 | Create a second file system. Note that both file system show 156M available because no quotas are set. Each “could” grow to file the pool. |
# zfs set reservation=20m myzfs/jim | Reserve a specified amount of space for a file system ensuring that other users don’t take up all the space. |
# zfs set quota=20m myzfs/jim2 | Set and view quotas |
# zfs set compression=on myzfs/jim2 | Turn on compression |
# zfs snapshot myzfs/jim@test | Create a snapshot called test. |
# zfs rollback myzfs/jim@test | Rollback to a snapshot. |
# zfs clone myzfs/jim@test myzfs/jim3 | A snapshot is not directly addressable. A clone must be made.The target dataset can be located anywhere in the ZFS hierarchy, and will be created as the same type as the original. |
# zfs destroy myzfs/jim2 | Destroy a filesystem |
# zpool destroy myzfs | Can’t destroy a pool with active filesystems. |
# zfs unmount myzfs/jim | Unmount a ZFS file system |
# zpool destroy -f myzfs | Use the -f option to destroy a pool with files systems created. |
No comments:
Post a Comment