ZFS backup FreeBSD10

Hello,

I just install FreeBSD 10 on a new test system and I have a very basic question.
Which of thetwo syntax bellow should I be using to perform a clean snapshopt of the system before I start doing anything to it?

Code:
zfs snapshot -r zroot@bare-install
or
Code:
zfs snapshot zroot@bare-install

Thank you
Fred
 
They both make a snapshot of the zroot filesystem. The addition of -r simply tells it to also make snapshots of the filesystems below zroot, i.e. zroot/data.
 
fred974 said:
So if I don't include the -r, I'll still be able to recover data in zroot/home/someuser?
Only if you actually made a snapshot of zroot/home/someuser. The command zfs snapshot zroot@bare-install creates a snapshot of the zroot filesystem and nothing else. It will not snapshot zroot/home and zroot/home/someuser. If you want to snapshot those either do them one by one or do a recursive snapshot with -r.
 
The command zfs snapshot zroot@bare-install creates a snapshot of the zroot filesystem and nothing else. It will not snapshot zroot/home and zroot/home/someuser.

Just to be clear, if you only have one ZFS filesystem, like the example below, you only need to create a snapshot of that filesystem. If /home and /home/someuser are just directories, they will be part of the snapshot.

Code:
# zfs list
NAME               USED  AVAIL  REFER  MOUNTPOINT
zroot               1.35G  12.3G    31K  legacy
#
# zfs snapshot zroot@bare-install

Snapshots are done on a per-filesystem level ('dataset' in ZFS terminology) so if you have any sub-datasets, such as in the example below, you will need to snapshot them separately or use -r

Code:
# zfs list
NAME               USED  AVAIL  REFER  MOUNTPOINT
zroot               1.35G  12.3G    31K  legacy
zroot/home     1.35G  12.3G    31K  /home
#
# zfs snapshot zroot@bare-install

The snapshot of zroot above would not include any data inside the zroot/home dataset. You'd have to snapshot both:

Code:
# zfs snapshot zroot@bare-install
# zfs snapshot zroot/home@bare-install
or better -
# zfs snapshot -r zroot@bare-install
 
OK thank you for the clarification.
I have only one ZFS filesystem called ZROOT and /home is a directory in my filesystem.
So from what I understand the syntax below should be OK as a full backup.
Code:
zfs snapshot zroot@bare-install
 
Back
Top