Skip to content

Latest commit

 

History

History
135 lines (97 loc) · 2.69 KB

zfs.md

File metadata and controls

135 lines (97 loc) · 2.69 KB

zfs

create filesystem

zpool create NAME DEVICE

create zfs slot

zfs create NAME/path1/path2

set acl

zfs set acltype=posix NAME

set mountpoint

zfs set mountpoint=MOUNTPOINT NAME

take snapshot

zfs snapshot NAME@TAG

list snapshots

zfs list -t snapshot

mount snapshot

mount -t zfs NAME@TAG MOUNTPOINT

destroy snapshot

zfs destroy NAME@TAG

rollback to a snapshot

zfs rollback NAME@TAG

get compression

zfs get compression NAME

set compression

zfs set compression=on NAME

get compression ratio

zfs get compressratio

send snapshots to other device

given follow example

NAME                                       USED  AVAIL  REFER  MOUNTPOINT
bk/test/current@one                         64K      -    96K  -
bk/test/current@two                         56K      -    96K  -
bk/test/current@three                        0B      -   104K  -

given a bk2 pool exists

  • send initial snapshot
zfs send bk/test/current@one | zfs recv bk2/test/current
  • this gives
NAME                                       USED  AVAIL  REFER  MOUNTPOINT
bk/test/current@one                         64K      -    96K  -
bk/test/current@two                         56K      -    96K  -
bk/test/current@three                        0B      -   104K  -
bk2/test/current@one                        64K      -    96K  -
  • update bk2 with other bk snapshots ( two, three ) by specifying from latest existing also in bk2 @one toward the latest to send @three
zfs send -I bk/test/current@one bk/test/current@three | zfs recv bk2/test/current
  • this gives
NAME                                       USED  AVAIL  REFER  MOUNTPOINT
bk/test/current@one                         64K      -    96K  -
bk/test/current@two                         56K      -    96K  -
bk/test/current@three                        0B      -   104K  -
bk2/test/current@one                        64K      -    96K  -
bk2/test/current@two                        56K      -    96K  -
bk2/test/current@three                       0B      -   104K  -