Solved ZFS backup, some guidance needed.

rigoletto@

Developer
Hello,

I have a FreeBSD desktop with two drives, both zfs:

Code:
1 - SSD: zroot pool [/]
2 - HDD: zdata pool [/home]

I want to backup the zdata pool to a jail in my FreeBSD server since it seem to be a failing drive, what have five hdds:

Code:
1 - UFS (/)
2, 3, 4, 5 - ZFS: zfsdata pool [/usr/jails/]

Looking on ZFS documentation it seem I can backup to a another pool with the same name, or to a file.

As far I know I cannot create a new pool on the server, with all ZFS disks being used by the zfsdata pool. So, it would need to be to a backup file, I think.

Is there anything I am missing, or a better solution?

PS. I do not have any snapshot created yet. Do I need to first create the snapshot locally or can I send it directly to the backup?

Thank you!
 
One very important detail though: you cannot back up whole pools, only the filesystems which reside in those pools. Your best option here is to utilize # zfs send to dump the filesystem(s) to stdout after which you can redirect the stream anywhere you'd like; from storing it all in a single (optionally compressed) file right down to adding it to another pool (using zfs receive).
 
Thanks. I think it can work this way then:

Code:
zfs snapshot zdata@backup
zfs send zdata/zdata@backup | ssh {server} zfs receive zfsdata/zdata@backup

And do not even using a jail...
 
I bought a new disk and sent the stream directly to it. :)

Even so, I will start to make backups to the server anyway.

Thank you.
 
Back
Top