Difference between revisions of "ZFS"

From wikieduonline
Jump to navigation Jump to search
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[w:ZFS|ZFS]] is a combined [[file Systems|file system]] and [[volume manager]] included in [[Operating Systems/Solaris|Solaris]] 10 update 2 (06/2006) and [[Ubuntu]] 16.04 LTS onwards. ZFS support advances features such as
+
[[wikipedia:ZFS|ZFS]] ([[2006]]) is a combined [[file Systems|file system]] and [[volume manager]] included in [[Solaris]] 10 update 2 (06/2006) and [[Ubuntu]] 16.04 LTS onwards. ZFS support advances features such as
* [[Linux Administration/Devices and Filesystems/Integrity|Data integrity]]
+
* [[Data integrity]]
 
* Integrated [[volume management]] – zpool (pooled storage)
 
* Integrated [[volume management]] – zpool (pooled storage)
 
* [[Copy on Write]] (CoW) <ref>https://en.wikipedia.org/wiki/Copy-on-write</ref>
 
* [[Copy on Write]] (CoW) <ref>https://en.wikipedia.org/wiki/Copy-on-write</ref>
* Compression
+
* Compression (<code>[[zfs set compression]]=off your_pool/filesystem (or just zfs set compression=off your_pool</code>, <code>[[zpool get all]]</code>)
* Snapshots and clones
+
* [[Snapshots]] and clones
* [[Deduplication]]<ref>https://wiki.ubuntu.com/Kernel/Reference/ZFS</ref>
+
* [[Deduplication]]<ref>https://wiki.ubuntu.com/Kernel/Reference/ZFS</ref>: <code>[[ZFS deduplication|zfs set dedup=on POOL_NAME/FS_NAME]]</code>
* [[Operating Systems/Solaris|Solaris]]: Online shrink <code>zpool remove</code> in Solaris 11.4 released in August 2018 <ref>https://docs.oracle.com/cd/E37838_01/html/E60974/dmgmt.html#scrolltoc</ref>
+
* [[Quotas]]: <code>[[zfs set quota]]</code>
 +
* [[Solaris]]: Online shrink <code>zpool remove</code> in Solaris 11.4 released in August 2018 <ref>https://docs.oracle.com/cd/E37838_01/html/E60974/dmgmt.html#scrolltoc</ref>
 +
* [[Encryption]]:  integrated into OpenZFS 0.8.0 available for Debian and Ubuntu Linux distributions
  
Commands: <code>zfs</code>, <code>zpool</code>, <code>zdb</code>
+
Commands: <code>zfs</code>, <code>[[zpool]]</code>, <code>zdb</code>
  
  
* Installation: <code>sudo apt install zfsutils-linux</code>
+
* Ubuntu Installation: <code>sudo apt install zfsutils-linux</code>
  
  
Line 20: Line 22:
 
* List your block/disk devices: <code>[[lsblk]]</code> or <code>lsblk -f</code> or <code>[[fdisk]] -l</code>
 
* List your block/disk devices: <code>[[lsblk]]</code> or <code>lsblk -f</code> or <code>[[fdisk]] -l</code>
  
* Show pool status: <code>zpool status</code>
+
* Show pool status: <code>[[zpool status]]</code>
* List ZFS pools : <code>[[/zpool list/]]</code>
+
* List ZFS pools : <code>[[zpool list]]</code>
:: <code>[[/zpool list/]] -v</code>
+
:: <code>[[zpool list]] -v</code>
  
* <code>zfs mount -a</code>
+
* <code>[[zfs mount]] -a</code>
 
* <code>zfs umount</code>
 
* <code>zfs umount</code>
  
Create a new pool:
+
* Create a new pool: <code>[[zpool create]]</code>
* Create a new pool: <code>sudo [[zpool create]] DATA /dev/sdbbbbbbb11</code>
 
* Create a new stripped pool: <code>sudo zpool create MY-NEW-STRIPPED-POOL /dev/sdb /dev/sdc</code>
 
* Create a new mirrored pool: <code>sudo zpool create MY-NEW-MIRROR-POOL mirror /dev/sdb /dev/sdc</code>
 
  
 
To Modify Disk identification to use  disk/by-id:
 
To Modify Disk identification to use  disk/by-id:
Line 39: Line 38:
 
=== Pools ===
 
=== Pools ===
 
* <code>zpool destroy YOUR_POOL</code>
 
* <code>zpool destroy YOUR_POOL</code>
* Show pool status: <code>zpool status</code>
+
* Show pool status: <code>[[zpool status]]</code>
* List ZFS pools : <code>[[/zpool list/]]</code>
+
* List ZFS pools : <code>[[zpool list]]</code>
  
 
=== Filesystems ===
 
=== Filesystems ===
* Create a new filesystem: <code>sudo zfs create DATA/datafs</code><ref>http://manpages.ubuntu.com/manpages/bionic/man8/zfs.8.html#subcommands</ref>
+
* Create a new filesystem: <code>sudo [[zfs create]] DATA/datafs</code><ref>http://manpages.ubuntu.com/manpages/bionic/man8/zfs.8.html#subcommands</ref>
 
* Destroy a zfs filesystem: <code>sudo zfs destroy DATA/datafs_TO_DESTROY</code> (Warning: no confirmation requested<ref>https://www.reddit.com/r/zfs/comments/7l4e4p/zfs_destroy_why_doesnt_it_have_any_confirmation/</ref>)
 
* Destroy a zfs filesystem: <code>sudo zfs destroy DATA/datafs_TO_DESTROY</code> (Warning: no confirmation requested<ref>https://www.reddit.com/r/zfs/comments/7l4e4p/zfs_destroy_why_doesnt_it_have_any_confirmation/</ref>)
 
**<code>sudo zfs destroy -r DATA/datafs_TO_DESTROY</code>  
 
**<code>sudo zfs destroy -r DATA/datafs_TO_DESTROY</code>  
* Set a quota to a filesystems: <code>zfs set quota=50G pool/home/bob</code><ref>https://docs.oracle.com/cd/E19253-01/819-5461/gazud/index.html</ref>
+
* Set a quota to a filesystems: <code>[[zfs set quota]]=50G pool/home/bob</code><ref>https://docs.oracle.com/cd/E19253-01/819-5461/gazud/index.html</ref>
 
* Check zfs service status: <code>systemctl status "zfs*" "zpool*"</code>
 
* Check zfs service status: <code>systemctl status "zfs*" "zpool*"</code>
 
* Display configuration information: <code>zdb -C</code>
 
* Display configuration information: <code>zdb -C</code>
Line 53: Line 52:
 
* Show pool status: <code>zpool status</code>
 
* Show pool status: <code>zpool status</code>
 
* List ZFS pools : <code>zpool list</code>
 
* List ZFS pools : <code>zpool list</code>
* List FS/Volumens/snapshots: <code>[[/zfs list/]]</code>
+
* List FS/Volumens/snapshots: <code>[[zfs list]]</code>
* <code>zfs get all</code>
+
* <code>[[zpool get all]]</code>
 +
* <code>[[zfs get all]]</code>
 
::<code>zfs get all | grep mountpoint</code>
 
::<code>zfs get all | grep mountpoint</code>
 +
::<code>zfs get all | grep dedup</code>
  
 
=== Advanced ===
 
=== Advanced ===
* <code>zpool import</code>
+
* <code>[[zpool import]]</code>
  
 
== Activities ==
 
== Activities ==
Line 65: Line 66:
 
# Follow Ubuntu Tutorial about Setup a ZFS storage pool: https://tutorials.ubuntu.com/tutorial/setup-zfs-storage-pool#0
 
# Follow Ubuntu Tutorial about Setup a ZFS storage pool: https://tutorials.ubuntu.com/tutorial/setup-zfs-storage-pool#0
 
# Create you first ZFS pool: <code>zpool create</code>
 
# Create you first ZFS pool: <code>zpool create</code>
 +
 +
=== Medium ===
 +
# Read about [[ZFS]] <code>rm</code> "expensive" operations: https://serverfault.com/a/801080, even more so if [[deduplication]] is enabled.
 +
 +
== Related terms ==
 +
* <code>[[z_fr_iss]]</code>
 +
* [[snapshotter]]
  
 
== See also ==
 
== See also ==
* [[Linux Administration/Devices and Filesystems/LVM|LVM]]
+
* {{ZFS}}
* [[System administration/ProLiant|Proliant]]
+
* [[LVM]]
 +
* [[Proliant]]
 
* <code>[[smartctl]]</code>
 
* <code>[[smartctl]]</code>
 
* {{fs}}
 
* {{fs}}
* [[Solaris]] Operating System
+
* {{Solaris}}
  
 
[[Category:Technology courses]]
 
[[Category:Technology courses]]

Latest revision as of 10:57, 6 September 2023

ZFS (2006) is a combined file system and volume manager included in Solaris 10 update 2 (06/2006) and Ubuntu 16.04 LTS onwards. ZFS support advances features such as

Commands: zfs, zpool, zdb


  • Ubuntu Installation: sudo apt install zfsutils-linux


Configuration files[edit]

  • /etc/default/zfs

Commands[edit]

  • List your block/disk devices: lsblk or lsblk -f or fdisk -l
zpool list -v

To Modify Disk identification to use disk/by-id:

  • zpool export DATA
  • zpool import -d /dev/disk/by-id DATA
  • Verify: zdb -C

Pools[edit]

Filesystems[edit]

  • Create a new filesystem: sudo zfs create DATA/datafs[4]
  • Destroy a zfs filesystem: sudo zfs destroy DATA/datafs_TO_DESTROY (Warning: no confirmation requested[5])
    • sudo zfs destroy -r DATA/datafs_TO_DESTROY
  • Set a quota to a filesystems: zfs set quota=50G pool/home/bob[6]
  • Check zfs service status: systemctl status "zfs*" "zpool*"
  • Display configuration information: zdb -C

List information[edit]

zfs get all | grep mountpoint
zfs get all | grep dedup

Advanced[edit]

Activities[edit]

  1. Read selecting dev names when creating a pool before you create your first ZFS pool: https://github.com/zfsonlinux/zfs/wiki/FAQ#selecting-dev-names-when-creating-a-pool and https://wiki.archlinux.org/index.php/Persistent_block_device_naming
  2. Read ArchLinux documentation about ZFS: https://wiki.archlinux.org/index.php/ZFS#Creating_a_storage_pool
  3. Follow Ubuntu Tutorial about Setup a ZFS storage pool: https://tutorials.ubuntu.com/tutorial/setup-zfs-storage-pool#0
  4. Create you first ZFS pool: zpool create

Medium[edit]

  1. Read about ZFS rm "expensive" operations: https://serverfault.com/a/801080, even more so if deduplication is enabled.

Related terms[edit]

See also[edit]


Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Original Source: https://en.wikiversity.org/wiki/Linux_Administration/Devices_and_Filesystems/ZFS

Advertising: