Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here's an example of a snapshot using the recursive (-r) flag...it will also create a snapshot of each sub-dataset using the same snapshot name.

----------

#

...

zfs

...

snapshot

...

-r

...

mypool/usr/ports@firstsnapshot

...

#

...

zfs

...

list

...

-t

...

all

...

-o

...

name,used,refer,written

...

NAME

...

USED

...

REFER

...

WRITTEN

...

mypool

...

10.5M

...

44.9K

...

44.9K

...

mypool/usr

...

10.1M

...

44.9K

...

44.9K

...

mypool/usr/ports

...

10.1M

...

10.0M

...

0

...

mypool/usr/ports@firstsnapshot

...

0

...

10.0M

...

10.0M

...

mypool/usr/ports/distfiles

...

43.4K

...

43.4K

...

0

...

mypool/usr/ports/distfiles@firstsnapshot

...

0

...

43.4K

...

43.4K

--------

As

...

you

...

can

...

see,

...

the

...

snapshots

...

initially

...

take

...

no

...

additional

...

space,

...

as

...

they

...

only

...

contain

...

the

...

data

...

that

...

already

...

exists

...

in

...

the

...

dataset

...

the

...

snapshot

...

belongs

...

to.
ZFS

...

snapshots

...

are

...

read-only,

...

but

...

they

...

can

...

be

...

accessed

...

via

...

a

...

hidden

...

".zfs"

...

directory.

...

This

...

allows

...

you

...

to

...

easily

...

restore

...

a

...

single

...

file

...

that

...

was

...

accidentally

...

modified

...

or

...

deleted:


--------

# ls -lh /mypool/usr/ports/.zfs/snapshot/firstsnapshot/  total 10247 -rw-r--r-- 1 root wheel 10M Nov 29 15:01 somefile
---------

...