Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save asrarak/e71b3ad82d1d760d1e2bd1ae4e41da8c to your computer and use it in GitHub Desktop.
Save asrarak/e71b3ad82d1d760d1e2bd1ae4e41da8c to your computer and use it in GitHub Desktop.

Revisions

  1. @pvalkone pvalkone revised this gist Mar 30, 2014. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -145,4 +145,8 @@ backup/scratch atime off inherited from backup
    $ sudo zfs set aclmode=passthrough backup/media
    $ sudo zfs set aclinherit=passthrough backup/media
    $ sudo zfs set aclmode=passthrough backup/scratch
    $ sudo zfs set aclinherit=passthrough backup/scratch
    $ sudo zfs set aclinherit=passthrough backup/scratch

    # Share media and scratch file systems via NFS
    $ sudo zfs sharenfs="-alldirs" backup/media
    $ sudo zfs sharenfs="on" backup/scratch
  2. @pvalkone pvalkone revised this gist Mar 27, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -142,7 +142,7 @@ backup/media atime off inherited from backup
    backup/scratch atime off inherited from backup

    # Set ACL mode and inheritance to passthrough for Samba
    $ sudo zfs set aclmode=passthrough tank/media
    $ sudo zfs set aclinherit=passthrough tank/media
    $ sudo zfs set aclmode=passthrough tank/scratch
    $ sudo zfs set aclinherit=passthrough tank/scratch
    $ sudo zfs set aclmode=passthrough backup/media
    $ sudo zfs set aclinherit=passthrough backup/media
    $ sudo zfs set aclmode=passthrough backup/scratch
    $ sudo zfs set aclinherit=passthrough backup/scratch
  3. @pvalkone pvalkone revised this gist Mar 27, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -141,7 +141,7 @@ backup atime off local
    backup/media atime off inherited from backup
    backup/scratch atime off inherited from backup

    # Set ACL passthrough for Samba
    # Set ACL mode and inheritance to passthrough for Samba
    $ sudo zfs set aclmode=passthrough tank/media
    $ sudo zfs set aclinherit=passthrough tank/media
    $ sudo zfs set aclmode=passthrough tank/scratch
  4. @pvalkone pvalkone revised this gist Mar 27, 2014. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -140,3 +140,9 @@ NAME PROPERTY VALUE SOURCE
    backup atime off local
    backup/media atime off inherited from backup
    backup/scratch atime off inherited from backup

    # Set ACL passthrough for Samba
    $ sudo zfs set aclmode=passthrough tank/media
    $ sudo zfs set aclinherit=passthrough tank/media
    $ sudo zfs set aclmode=passthrough tank/scratch
    $ sudo zfs set aclinherit=passthrough tank/scratch
  5. @pvalkone pvalkone revised this gist Mar 8, 2014. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -131,4 +131,12 @@ NAME PROPERTY VALUE SOURCE
    backup/scratch quota 500G local

    # Allow the pool size to be expanded without having to export and import it or reboot the system
    $ sudo zpool set autoexpand=on backup
    $ sudo zpool set autoexpand=on backup

    # Disable access time updates
    $ sudo zfs set atime=off backup
    $ zfs get atime
    NAME PROPERTY VALUE SOURCE
    backup atime off local
    backup/media atime off inherited from backup
    backup/scratch atime off inherited from backup
  6. @pvalkone pvalkone revised this gist Mar 8, 2014. No changes.
  7. @pvalkone pvalkone revised this gist Mar 1, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -130,5 +130,5 @@ $ zfs get quota backup/scratch
    NAME PROPERTY VALUE SOURCE
    backup/scratch quota 500G local

    # Allow the pool size to be expanded without having to export and import pool or reboot the system
    # Allow the pool size to be expanded without having to export and import it or reboot the system
    $ sudo zpool set autoexpand=on backup
  8. @pvalkone pvalkone revised this gist Feb 18, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -122,7 +122,7 @@ backup compression lz4 local
    backup/media compression lz4 inherited from backup
    backup/scratch compression lz4 inherited from backup

    # Set 500M quota for backup/scratch
    # Set 500G quota for backup/scratch
    $ sudo zfs set quota=500G backup/scratch

    # Check that the quota was set
  9. @pvalkone pvalkone revised this gist Feb 18, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -123,12 +123,12 @@ backup/media compression lz4 inherited from backup
    backup/scratch compression lz4 inherited from backup

    # Set 500M quota for backup/scratch
    $ sudo zfs set quota=500M backup/scratch
    $ sudo zfs set quota=500G backup/scratch

    # Check that the quota was set
    $ zfs get quota backup/scratch
    NAME PROPERTY VALUE SOURCE
    backup/scratch quota 500M local
    backup/scratch quota 500G local

    # Allow the pool size to be expanded without having to export and import pool or reboot the system
    $ sudo zpool set autoexpand=on backup
  10. @pvalkone pvalkone revised this gist Feb 14, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -128,4 +128,7 @@ $ sudo zfs set quota=500M backup/scratch
    # Check that the quota was set
    $ zfs get quota backup/scratch
    NAME PROPERTY VALUE SOURCE
    backup/scratch quota 500M local
    backup/scratch quota 500M local

    # Allow the pool size to be expanded without having to export and import pool or reboot the system
    $ sudo zpool set autoexpand=on backup
  11. @pvalkone pvalkone revised this gist Feb 12, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Create 4K gnop(8) devices for the first disk of each of the three vdevs
    # Create 4K sector gnop(8) devices for the first disk of each of the three vdevs
    $ sudo gnop create -S 4096 /dev/label/disk1 /dev/label/disk5 /dev/label/disk8

    # Create the backup pool using three RAID-Z1 vdevs
  12. @pvalkone pvalkone revised this gist Feb 12, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -78,7 +78,6 @@ config:
    errors: No known data errors

    # Add a hot spare

    $ sudo zpool add backup spare /dev/label/disk13

    $ zpool status
  13. @pvalkone pvalkone revised this gist Feb 12, 2014. 1 changed file with 33 additions and 1 deletion.
    34 changes: 33 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,39 @@ config:
    label/disk11 ONLINE 0 0 0

    errors: No known data errors


    # Add a hot spare

    $ sudo zpool add backup spare /dev/label/disk13

    $ zpool status
    pool: backup
    state: ONLINE
    scan: none requested
    config:

    NAME STATE READ WRITE CKSUM
    backup ONLINE 0 0 0
    raidz1-0 ONLINE 0 0 0
    label/disk1 ONLINE 0 0 0
    label/disk2 ONLINE 0 0 0
    label/disk3 ONLINE 0 0 0
    label/disk4 ONLINE 0 0 0
    raidz1-1 ONLINE 0 0 0
    label/disk5 ONLINE 0 0 0
    label/disk6 ONLINE 0 0 0
    label/disk7 ONLINE 0 0 0
    label/disk12 ONLINE 0 0 0
    raidz1-2 ONLINE 0 0 0
    label/disk8 ONLINE 0 0 0
    label/disk9 ONLINE 0 0 0
    label/disk10 ONLINE 0 0 0
    label/disk11 ONLINE 0 0 0
    spares
    label/disk13 AVAIL

    errors: No known data errors

    # Enable lz4 compression
    $ sudo zfs set compression=lz4 backup

  14. @pvalkone pvalkone revised this gist Feb 12, 2014. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -89,4 +89,12 @@ $ zfs get compression
    NAME PROPERTY VALUE SOURCE
    backup compression lz4 local
    backup/media compression lz4 inherited from backup
    backup/scratch compression lz4 inherited from backup
    backup/scratch compression lz4 inherited from backup

    # Set 500M quota for backup/scratch
    $ sudo zfs set quota=500M backup/scratch

    # Check that the quota was set
    $ zfs get quota backup/scratch
    NAME PROPERTY VALUE SOURCE
    backup/scratch quota 500M local
  15. @pvalkone pvalkone created this gist Feb 11, 2014.
    92 changes: 92 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,92 @@
    # Create 4K gnop(8) devices for the first disk of each of the three vdevs
    $ sudo gnop create -S 4096 /dev/label/disk1 /dev/label/disk5 /dev/label/disk8

    # Create the backup pool using three RAID-Z1 vdevs
    $ sudo zpool create backup raidz /dev/label/disk1.nop /dev/label/disk2 /dev/label/disk3 /dev/label/disk4
    $ sudo zpool add backup raidz /dev/label/disk5.nop /dev/label/disk6 /dev/label/disk7 /dev/label/disk12
    $ sudo zpool add backup raidz /dev/label/disk8.nop /dev/label/disk9 /dev/label/disk10 /dev/label/disk11

    $ zpool list
    NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
    backup 21.8T 1.29M 21.7T 0% 1.00x ONLINE -

    $ zpool status
    pool: backup
    state: ONLINE
    scan: none requested
    config:

    NAME STATE READ WRITE CKSUM
    backup ONLINE 0 0 0
    raidz1-0 ONLINE 0 0 0
    label/disk1.nop ONLINE 0 0 0
    label/disk2.nop ONLINE 0 0 0
    label/disk3.nop ONLINE 0 0 0
    label/disk4.nop ONLINE 0 0 0
    raidz1-1 ONLINE 0 0 0
    label/disk5.nop ONLINE 0 0 0
    label/disk6.nop ONLINE 0 0 0
    label/disk7.nop ONLINE 0 0 0
    label/disk12.nop ONLINE 0 0 0
    raidz1-2 ONLINE 0 0 0
    label/disk8.nop ONLINE 0 0 0
    label/disk9.nop ONLINE 0 0 0
    label/disk10.nop ONLINE 0 0 0
    label/disk11.nop ONLINE 0 0 0

    errors: No known data errors

    # Check that the vdevs are 4K-aligned (ashift = 12)
    $ zdb | grep ashift
    ashift: 12
    ashift: 12
    ashift: 12

    # Export the pool
    $ sudo zpool export backup

    # Destroy the gnop(8) devices
    $ sudo gnop destroy /dev/label/disk1.nop /dev/label/disk5.nop /dev/label/disk8.nop

    # Import the pool
    $ sudo zpool import backup

    $ zpool status
    pool: backup
    state: ONLINE
    scan: none requested
    config:

    NAME STATE READ WRITE CKSUM
    backup ONLINE 0 0 0
    raidz1-0 ONLINE 0 0 0
    label/disk1 ONLINE 0 0 0
    label/disk2 ONLINE 0 0 0
    label/disk3 ONLINE 0 0 0
    label/disk4 ONLINE 0 0 0
    raidz1-1 ONLINE 0 0 0
    label/disk5 ONLINE 0 0 0
    label/disk6 ONLINE 0 0 0
    label/disk7 ONLINE 0 0 0
    label/disk12 ONLINE 0 0 0
    raidz1-2 ONLINE 0 0 0
    label/disk8 ONLINE 0 0 0
    label/disk9 ONLINE 0 0 0
    label/disk10 ONLINE 0 0 0
    label/disk11 ONLINE 0 0 0

    errors: No known data errors

    # Enable lz4 compression
    $ sudo zfs set compression=lz4 backup

    # Create media and scratch filesets
    $ sudo zfs create backup/media
    $ sudo zfs create backup/scratch

    # Check that compression is enabled
    $ zfs get compression
    NAME PROPERTY VALUE SOURCE
    backup compression lz4 local
    backup/media compression lz4 inherited from backup
    backup/scratch compression lz4 inherited from backup