【问题标题】:Storing locally encrypted incremental ZFS snapshots in Amazon Glacier在 Amazon Glacier 中存储本地加密的增量 ZFS 快照
【发布时间】:2018-01-28 21:08:52
【问题描述】:

为了对我的 ZFS 池进行真正的异地和持久备份,我想将 zfs 快照存储在 Amazon Glacier 中。数据需要在本地加密,独立于亚马逊,以确保隐私。我怎么能做到这一点?

【问题讨论】:

  • 从版本 0.8 开始,Linux 上的 ZFS 支持本机加密。也许zfs send -Rw 命令正是您想要的

标签: linux encryption amazon-s3 amazon-glacier zfs


【解决方案1】:

可以将现有快照发送到 S3 存储桶,如下所示:

zfs send -R <pool name>@<snapshot name> | gzip | gpg --no-use-agent  --no-tty --passphrase-file ./passphrase -c - | aws s3 cp - s3://<bucketname>/<filename>.zfs.gz.gpg

或用于增量备份:

zfs send -R -I <pool name>@<snapshot to do incremental backup from> <pool name>@<snapshot name> | gzip | gpg --no-use-agent  --no-tty --passphrase-file ./passphrase -c - | aws s3 cp - s3://<bucketname>/<filename>.zfs.gz.gpg

此命令将获取现有快照,使用 zfs send 对其进行序列化,对其进行压缩,然后使用 gpg 使用密码对其进行加密。密码必须在 ./passphrase 文件的第一行可读。

请记住在多个位置分别备份您的密码文件! - 如果您无法访问它,您将永远无法再次访问您的数据!

这需要:

  • 预先创建的 Amazon s3 存储桶
  • 已安装 (pip install awscli) 并配置 (aws configure) 的 awscli。
  • gpg 已安装

最后,S3 生命周期规则可用于在预设时间后(或立即)将 S3 对象转换为冰川。


用于恢复:

aws s3 cp s3://<bucketname>/<filename>.zfs.gz.gpg - | gpg --no-use-agent --passphrase-file ./passphrase -d - | gunzip | sudo zfs receive <new dataset name> 

【讨论】:

  • 我建议使用gzip -9bzip2。根据数据,这可能会更好地压缩。压缩不会成为这里的瓶颈 - 网络副本会。
  • 请修复 For restore: section, in s3 cp src and targert 中的错误
  • 很抱歉,现在已修复。
猜你喜欢
  • 2021-05-01
  • 2011-09-22
  • 2017-12-08
  • 2018-10-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-24
  • 2018-07-28
相关资源
最近更新 更多