Comments on How to use snapshots, clones and replication in ZFS on Linux
In the previous tutorial, we learned how to create zpool's and a ZFS filesystem or dataset. In this tutorial, I will show you step by step how to work with ZFS snapshots, clones, and replication. Snapshot, clone and replication are the most powerful features of the ZFS filesystem.
16 Comment(s)
Comments
This article ........ Didnt bother reading it beyond first two line. Linux doesnt come with ZFS.
ZFS exists for Linux off course, not in the Kernel but as a separate package. If you would have read the tutorial then you would have seen the link in the first line to the first part of this series that describes how to install ZFS on Linux: https://www.howtoforge.com/tutorial/how-to-install-and-configure-zfs-on-debian-8-jessie/
http://zfsonlinux.org
Nice articles, thanks.
I think you forgot to make "pool: backuppool" etc a code block.
Found some links for Ubuntu:
https://wiki.ubuntu.com/ZFS
https://github.com/zfsonlinux/pkg-zfs/wiki/HOWTO-install-Ubuntu-to-a-Native-ZFS-Root-Filesystem
I will give it a try when I have more time.
how safe is run a server on ZFS and snapshot/clone when running ?
there will NO sql / mail data missed ?
Snapshot is point-in-time copy , it is a mirrored copy of the state of the filesystem at the time you took the snapshot.
For database, you can put database in the backup state before doing snapshot.
Hi,
I'm not sure how old this post is at this point, but I was wondering - if you've done a push of the zfs snapshot to a remote server, is there a straight-forward method to pull the data back? For example, you've pushed the docs@today, a day later the main drive fails - you rebuild the system and the ZFS devices and you're ready to restore the data - do you just copy from the snapshots or is there a way to recover from snapshots on a different drive (or preferrably from a remote/different server)?
I've also been using ZFS for a while now on linux. You can push or pull:
[code]
zfs send pool/Dataset@snapshot | ssh root@remote "zfs receive otherPool/Dataset"
[/code]
or
[code]
ssh root@remote "zfs send pool/Dataset@snapshot" | zfs receive otherPool/Dataset
[/code]
It works both ways.
Would love to be proven wrong, but I think the last step, zfs sending to a remote backup server is not functional in ZOL at this time. Perhaps in a 0.7.0 package via unstable package but see https://github.com/zfsonlinux/zfs/issues/434
I'm trying to do this very thing and recieving the same problems as here: https://superuser.com/questions/877186/zfs-send-recieve-over-ssh-on-linux-without-allowing-root-login
A shame.
Hi,
Didn't find any info about the date of the article, I'm assuming it's quite old but I just wanted to add something. You CAN browse a snapshot in read-only, even with ZFS on Linux. At the mounting point of each dataset, there's a .zfs folder which will contain a snapshot subfolder for each of them. They are read-only, of course.
Note that you WON'T see this folder, even with ls -a. You can cd into it though. Yup, you have to know it's there, but it is. :D
I think this saves a lot of headache when recovering files.
This tutorial is not very understandable
What does
"Now, we have a pool called datapool, next we have to create one ZFS filesystem to simulate the snapshot feature."
mean?
What is
# zfs create datapool/docs -o mountpoint=/docs
doing exactly?
How am I doing this when I already have pools?
Do I need to create new directories for that?
Can the directories be put in another pool?
ect
ZFS pools are used to store datasets. It's the datasets that get mounted - think of a dataset like an LVM volume, or a partition with a traditional filesystem on it.
So with ZFS first you create a pool which consists of one or more vdevd (a vdev can be a single disk, a mirror, or a raid of disks) - personally I have several machines running multiple mirror vdevs in a single pool. Then you create datasets on the pool, giving each dataset a mountpoint.
The command "zfs create datapool/docs -o mountpoint=/docs" will create a dataset called "docs" under the "datapool" pool, and set it's mount point to be "/docs" if the mountpoint doesn't exist it will be created.
Sorry to say but you have not made a back up of your data, you have made a back up of a snapshot, a snapshot is only the data that has changed in the original set sinds the snapshot
If you loose your original data, a snap shot will not save you !! , a replication of a snapshot wil lalso not save you
Look at the amount of data you are saving DataPool 527k vs Backup Pool 83k
This mistake is so widespread that i cant find a good tutorila in howto propperly Back up the original dataset anywhere on internet, even Oracle thinks the original dataset will never die...
please spread this dangorous pitfall
Exactly. I'm still digging through man pages to find out how to replicate the entire pool, not just the snapshot, on a different drive/machine.
What if you create a datapool and then before putting it to use you create a snapshot? Would this be enough to have a 1:1 copy of your data right?
I know it’s not feasible for existing pools, but in theory it should work...
Take a look at ZFS autobackup if you need a complete solution that also can display the executed shell commands: https://github.com/psy0rz/zfs_autobackup