Use Your Storage Space More Effectively with ZFS: Exploring Datasets

Manage ZFS Filesystems

zfs list
root@ubuntu:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
fourth 67K 38.5G 19K /fourth
zfs create fourth/images
zfs list
root@ubuntu:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
fourth 129K 38.5G 19K /fourth
fourth/images 19K 38.5G 19K /fourth/images
zfs create -p fourth/customers/1
zfs set quota=5G fourth/customers/1
root@ubuntu:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
fourth 180K 38.5G 19K /fourth
fourth/customers 38K 38.5G 19K /fourth/customers
fourth/customers/1 19K 5.00G 19K /fourth/customers/1
fourth/images 19K 38.5G 19K /fourth/images
zfs create fourth/text
zfs set compression=on fourth/text
zfs get all

Manage ZFS Snapshots

touch /fourth/customers/1/importantdata{1..100}
ls /fourth/customers/1/
zfs snapshot fourth/customers/1@firstsnapshot
rm /fourth/customers/1/importantdata{1..50}
zfs diff fourth/customers/1@firstsnapshot
ls /fourth/customers/1/.zfs/snapshot/
ls /fourth/customers/1/
zfs rollback fourth/customers/1@firstsnapshot
ls /fourth/customers/1/
zfs list -t snapshot
zfs list -t all
zfs destroy fourth/customers/1@firstsnapshot

Manage ZFS Clones

zfs snapshot fourth/customers/1@firstsnapshot
zfs clone fourth/customers/1@firstsnapshot fourth/customers/cloneof1
rm /fourth/customers/cloneof1/importantdata{1..99}
zfs promote fourth/customers/cloneof1
zfs destroy fourth/customers/1
zfs rename fourth/customers/cloneof1 fourth/customers/1

Manage ZFS Volumes

zfs create -V 10G fourth/virtualdisk
mkfs.ext4 /dev/zvol/fourth/virtualdisk
zfs set compression=on fourth/virtualdisk
mount /dev/zvol/fourth/virtualdisk /mnt
df -h /mnt
zfs set volsize=20G fourth/virtualdisk
resize2fs /dev/zvol/fourth/virtualdisk
df -h /mnt
zfs list
root@ubuntu:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
fourth 20.6G 17.9G 19K /fourth
fourth/customers 54K 17.9G 19K /fourth/customers
fourth/customers/1 35K 17.9G 20K /fourth/customers/1
fourth/images 19K 17.9G 19K /fourth/images
fourth/text 19K 17.9G 19K /fourth/text
fourth/virtualdisk 20.6G 38.4G 126M -
zfs set refreservation=none fourth/virtualdisk
zfs list
root@ubuntu:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
fourth 127M 38.4G 19K /fourth
fourth/customers 54K 38.4G 19K /fourth/customers
fourth/customers/1 35K 38.4G 20K /fourth/customers/1
fourth/images 19K 38.4G 19K /fourth/images
fourth/text 19K 38.4G 19K /fourth/text
fourth/virtualdisk 126M 38.4G 126M -
dd if=/dev/zero of=/mnt/test status=progress bs=1M count=1024
ls -lh /mnt/
zfs list

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How SAS Custom Macro make feature engineering easier

DBSCAN Clustering for Trading

Analyzing Starbucks Offers Data Set

D&d 5e Dmg Starting Point

PWiC at Women in Analytics, 2019

Covid-19: The Algorithm killer?

The Hidden Data Story Behind Super Bowl Tickets

Prove Your Awesomeness with Data: The CDO DataOps Dashboard

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Monitor Linux logs with ELK and rsyslog in Open Telekom Cloud

Editing your github commits for Kubernetes contributors

Getting started with Prometheus Federation in Docker

Generation and installation of SSL certificates for dependencies