# [RESOLVED] zfs snapshot



## fred974 (Jul 17, 2014)

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*.*


----------



## SirDice (Jul 17, 2014)

*Re: zfs snapshot*

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


----------



## fred974 (Jul 17, 2014)

*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


----------



## usdmatt (Jul 17, 2014)

*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).


----------



## SirDice (Jul 17, 2014)

*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.


----------



## fred974 (Jul 17, 2014)

*Re: zfs snapshot*

Thank you very much for clarifying, guys 

@usdmatt, yes, I did _k_now that I need to send the snapshot externally. But a reminder is always good


----------



## SirDice (Jul 17, 2014)

*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.


----------



## fred974 (Jul 17, 2014)

*Re: zfs snapshot*

Thank you for your additional input @SirDice*.*


----------

