zfs存储池的块级备份
是否可以对 zfs 存储池进行备份? 如果FS位于原始磁盘上,我们可以打开并读取字符设备接口,以将磁盘复制到文件。我们可以使用循环设备接口挂载文件。是否可以使用 open、read 系统调用以编程方式在 zpool 中执行此操作?
Is possible to take a backup of zfs storage pool ?
If the FS is on a raw disk, we can open and read the character device interface to replicate the disk to a file.We can mount the file using the loop device interface. Is it possible to do this in zpool programatically using open, read system calls?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议研究 ZFS 复制功能,它使用
send
和receive
子命令。使用这些工具,您可以生成特定数据集的块级数据流并将该流保存到文件中。如果您为根数据集生成流并包含所有子数据集,则这将捕获池中的所有数据。请注意,zfs send
对快照进行操作,因此您需要事先拍摄递归快照:然后当您想要恢复数据时:
I'd recommend looking into the ZFS replication feature, which uses the
send
andreceive
subcommands. With those tools, you can generate a block-level data stream of a particular dataset and save that stream to a file. If you generate a stream for the root dataset and include all child datasets, that will capture all data in the pool. Note thatzfs send
operates on a snapshot, so you will need to take a recursive snapshot beforehand:Then when you want to restore your data: