ZFS 发送单个快照,包括后代文件系统
有没有办法发送包括后代文件系统的单个快照?即使快照是使用“-r”创建的,“zfs send”也仅发送顶级文件系统。 “zfs send -R”发送后代文件系统,但包括所有以前的快照,如果灾难恢复池中不需要以前的快照,则出于灾难恢复目的,这会消耗不必要的空间。
猫 /sys/模块/zfs/版本 0.8.3-1ubuntu12.5
Is there a way to send a single snapshot including descendant file systems? 'zfs send' only sends the the top level file system even if the snapshot was created using '-r'. 'zfs send -R' sends the descendant file systems but includes all the previous snapshots, which for disaster recovery purposes consumes unnecessary space if the previous snapshots are not needed in the disaster recovery pool.
cat /sys/module/zfs/version
0.8.3-1ubuntu12.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我完全理解你的用例。尽管我通常面临相反的情况,即我有一个远程备份池,我想从中恢复本地系统上的最新快照。
无论如何,虽然你无法直接达到你想要的目的,但你可以达到想要的状态。这个想法是修剪您的恢复集,使其仅包含最新的快照。
首先发送初始快照:
这将发送所有降序文件系统,并将发送
initial_snapshot
以及在其之前创建的所有文件系统。如果您之前创建了任何快照,则可以删除它们:
然后发送增量更新并进行修剪,
假设
LATEST_LOCAL_SNAPSHOT
和LATEST_REMOTE_SNAPSHOT
已正确设置。请注意,这是一个最小的无安全带示例。您应该关心您的发送接收是否成功。如果意外达到恢复池没有任何与源匹配的快照的状态,您将无法再发送增量,因此需要重新开始。
I perfectly understand your use case. Although I for one am usually faced with the oppositie situation where I have a remote backup pool from which I want to restore the latest snapshot on a local system.
In any case, while you cannot achieve what you want in a direct way, you can reach the desired state. The idea is to prune your recovery set so that it only has the latest snapshot.
You start by sending an initial snapshot:
This will send all descending file systems, and will send the
initial_snapshot
and all those created before it.If you thus had created any snapshots prior, you can delete them:
Then you send incremental updates and prune,
assuming that
LATEST_LOCAL_SNAPSHOT
andLATEST_REMOTE_SNAPSHOT
are appropriately set.Please mind that this is a minimal seatbelt-less example. You should care about whether your send-receives are successful. If accidently reach the state where your recovery pool does not have any snapshots that match your source, you can no longer send increments and will thus need to start anew.
不。
如果您想要整个文件系统进行灾难恢复,则需要整个文件系统。
ZFS 快照不是完整的文件系统。它实际上是它与前一个快照之间的区别,并且该链一直延续到所有快照到文件系统的“基本”副本。
您可以发送增量快照,这仅发送差异。根据 Oracle ZFS 文档:
第一个
zfs
命令发送整个文件系统。
这只是发送差异:
然后可以是
No.
If you want the entire filesystem for disaster recovery, you need the entire filesystem.
A ZFS snapshot is not a complete filesystem. It's effectively the difference between it and the previous snapshot, and that chain continues all the way back through all the snapshots to the "base" copy of the filesystem.
You can send incremental snapshots, which only send the differences. Per Oracle ZFS documentation:
The first
zfs
commandSends the entire filesystem.
This one just sends the differences:
Which can then be followed by