[RESOLVED] zfs snapshot

Hello,

This is a quick question. If I want do do a full backup of my entire file system, do I need to run zfs snapshot -r zroot@bare-instal or zfs -r snapshot -r zroot@bare-instal? I'm not sure 'recursive' is [is what? -- mod.].

Thank you.
 
Re: zfs snapshot

The first one, the second command will result in an error.
 
Re: zfs snapshot

SirDice said:
The first one, the second command will result in an error.

Sorry I just realized that I made a mistake in my post. It should have been zfs snapshot zroot@bare-instal or zfs snapshot -r zroot@bare-instal. I'm really sorry.

Fred
 
Re: zfs snapshot

Just to be pedantic, by running the zfs snapshot command, you don't have actually have a 'backup'. Everything is still on the same disk(s), so pool or disk failure can still cause you to lose the lot. You need to send a copy of that snapshot somewhere else with zfs send -R to create a real backup (preferably to another ZFS pool).

Apologies if you're already aware of that, but some people may look at this and think "ah, that's the command to backup my full ZFS system".

In regard to your second post, the command without -r will only create a snapshot of the zroot dataset. If you have any child datasets, such as zroot/home, etc, you'll need to use the recursive option (or create separate snapshots for each dataset manually).
 
Re: zfs snapshot

fred974 said:
zfs snapshot zroot@bare-instal
This will make a snapshot of zroot
zfs snapshot -r zroot@bare-instal
This will make a snapshot of zroot and everything below it. For example zroot/BASE, zroot/some/dir etc.
 
Re: zfs snapshot

Thank you very much for clarifying, guys :)

@usdmatt, yes, I did know that I need to send the snapshot externally. But a reminder is always good :)
 
Last edited by a moderator:
Re: zfs snapshot

SirDice said:
zfs snapshot -r zroot@bare-instal
This will make a snapshot of zroot and everything below it. For example zroot/BASE, zroot/some/dir etc.
To elaborate a little further, if you have for example zroot, zroot/dir1 and zroot/dir1/dir2 a zfs snapshot -r zroot@bare-install will create zroot@bare-install, zroot/dir1@bare-install and zroot/dir1/dir2@bare-install. Without the -r only zroot@bare-install will be created.
 
Back
Top