MADBU,一个专为 EXT4 卷影复制(写时复制)提供的解决方案
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 的必备条件
- 源磁盘为 EXT2 / 3 / 4 格式(可嵌套 LVM )
- 源磁盘不能为 XFS / ZFS / BTRFS
although filesystems with their own block device management systems such as ZFS and BTRFS can not be supported - Linux 内核小于 5.5.11 (dattobd 缺陷)
- datto/dattobd 缺陷#221
- datto/dattobd 提交#229 (未合并)
- 系统安装软件包 dialog, pv, pigz
安装必要依赖
- 安装依赖组件包(以 Debian 为例)
sudo apt install -y dialog pv pigz - 安装
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 - 重启计算机后生效
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
缺陷反馈
- 界面缺陷: https://gitlab.com/dfc643/datto-backup/-/issues
- 内核模块缺陷: https://github.com/datto/dattobd/issues
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/.
引用
- Linux 在线系统完整备份方案?
- Datto Block Driver