MADBU,一个专为 EXT4 卷影复制(写时复制)提供的解决方案

2021-01-03 19:12:56 +08:00
 dfc643

MADBU 的诞生

因 2020-12-03 将工作环境从 Windows 10 迁移到 UOS v20 后没有找到合适的 在线 Linux 备份 方案。
从而诞生了 MADBU 。

为什么不是他们?

1. LVM Snapshot
在 EXT4 外嵌套 LVM 虽然对当前系统影响不大,但类似 UOS 这种结构特殊的系统(包含 A/B 分区),可能导致系统后续出现其他问题。

2. ZFS / XFS
需要对当前系统进行迁移,而目标系统不一定支持此类文件系统。

3. BtrFS
关于 Btrfs 目前有较多言论表示:其可靠性不佳,存在随机丢失文件的现象。

MADBU 的必备条件

  1. 源磁盘为 EXT2 / 3 / 4 格式(可嵌套 LVM )
  2. 源磁盘不能为 XFS / ZFS / BTRFS
    although filesystems with their own block device management systems such as ZFS and BTRFS can not be supported
    
  3. Linux 内核小于 5.5.11 (dattobd 缺陷)
  4. 系统安装软件包 dialog, pv, pigz

安装必要依赖

  1. 安装依赖组件包(以 Debian 为例)
    sudo apt install -y dialog pv pigz
    
  2. 安装 dattabd 写时复制内核模块
    Debian 与 Ubuntu 家族系统
    sudo apt-key adv --fetch-keys https://cpkg.datto.com/DATTO-PKGS-GPG-KEY
    echo "deb [arch=amd64] https://cpkg.datto.com/datto-deb/public/$(lsb_release -sc) $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/datto-linux-agent.list
    sudo apt-get update
    sudo apt-get install dattobd-dkms dattobd-utils
    
    深度 Linux V20 与统信 UOS V20
    sudo apt-key adv --fetch-keys https://cpkg.datto.com/DATTO-PKGS-GPG-KEY
    echo "deb [arch=amd64] https://cpkg.datto.com/datto-deb/public/buster buster main" | sudo tee /etc/apt/sources.list.d/datto-linux-agent.list
    sudo apt-get update
    sudo apt-get install dattobd-dkms dattobd-utils
    
  3. 重启计算机后生效

MADBU 使用方法

备份当前运行中的系统

git clone https://gitlab.com/dfc643/datto-backup
cd datto-backup/
chmod +x madbu.sh
sudo bash madbu.sh

从 LiveCD 或者其他系统恢复备份

例如从 LiveCD 中恢复备份

gzip -dc /path/to/your/sda3.img.gz | dd of=/dev/sda3

缺陷反馈

Copyright

MADBU License

The MIT License (MIT)
Copyright (c) 2021 xRetia Labs
Copyright (c) 2021 MoeArt Inc. (www.acgdraw.com)

About xRetia Labs

The xRetia Labs is apart of MoeArt Inc. which working for opensource project.
Copyright (c) 2021 MoeArt Inc. (www.acgdraw.com)

dattobd kernel module and userspace applications

dattobd is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, under version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

引用

2261 次点击
所在节点    Linux
6 条回复
YouLMAO
2021-01-03 23:52:04 +08:00
啥情况,raid1 不是一样的吗
msg7086
2021-01-04 01:24:05 +08:00
@YouLMAO ??
你在说什么?这是备份怎么会扯到 RAID ?
xlibve
2021-01-04 11:58:27 +08:00
可以增量合并吗?我们春节后要切换 arm 平台,“开心”。。。。。。
dfc643
2021-01-04 23:15:55 +08:00
@xlibve dattobd 可以,但 madbu 没做这个功能,可以查看一下 dattobd 官方文档
ungrown
2021-01-05 13:19:56 +08:00
建议在添加对 borgbackup 的支持,便可在卷影快照的基础上增加增量、块去重、备份库惯例等等功能
dfc643
2021-01-07 15:33:59 +08:00
@ungrown dattobd 本身支持增量,后续我看看能不能把增量也写上吧,另外不知道 gui 版本有没有必要存在因为服务器部分不支持 gui

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/741270

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX