V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
dfc643
V2EX  ›  Linux

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

  •  1
     
  •   dfc643 · 2021-01-03 19:12:56 +08:00 · 2248 次点击
    这是一个创建于 1208 天前的主题,其中的信息可能已经有所发展或是发生改变。

    MADBU 的诞生

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

    为什么不是他们?

    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/.

    引用

    6 条回复    2021-01-07 15:33:59 +08:00
    YouLMAO
        1
    YouLMAO  
       2021-01-03 23:52:04 +08:00 via Android
    啥情况,raid1 不是一样的吗
    msg7086
        2
    msg7086  
       2021-01-04 01:24:05 +08:00 via Android   ❤️ 2
    @YouLMAO ??
    你在说什么?这是备份怎么会扯到 RAID ?
    xlibve
        3
    xlibve  
       2021-01-04 11:58:27 +08:00
    可以增量合并吗?我们春节后要切换 arm 平台,“开心”。。。。。。
    dfc643
        4
    dfc643  
    OP
       2021-01-04 23:15:55 +08:00 via Android
    @xlibve dattobd 可以,但 madbu 没做这个功能,可以查看一下 dattobd 官方文档
    ungrown
        5
    ungrown  
       2021-01-05 13:19:56 +08:00   ❤️ 1
    建议在添加对 borgbackup 的支持,便可在卷影快照的基础上增加增量、块去重、备份库惯例等等功能
    dfc643
        6
    dfc643  
    OP
       2021-01-07 15:33:59 +08:00 via Android
    @ungrown dattobd 本身支持增量,后续我看看能不能把增量也写上吧,另外不知道 gui 版本有没有必要存在因为服务器部分不支持 gui
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1797 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 16:37 · PVG 00:37 · LAX 09:37 · JFK 12:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.