Memo/migrate-btrfs-volumes-over-ssh

1 分钟阅读

通过 SSH 迁移 btrfs volumes

通过 SSH 发送只读快照,迁移 Btrfs 子卷。

配置 SSH 免密:

ssh-copy-id -i ~/.ssh/id_ed25519.pub <user>@<host>

在目标端配置 sudo 免密:

https://serverfault.com/questions/160581/how-to-setup-passwordless-sudo-on-linux

%wheel ALL=(ALL:ALL) NOPASSWD: ALL

The key is to add it after the last line which says

#includedir /etc/sudoers.d

创建快照:

# sudo btrfs subvolume snapshot -r <fs-path> <snapshot-path>
sudo btrfs subvolume snapshot -r / /sysfs_ro

发送:

sudo pacman -S pv
# sudo btrfs send <snapshot-path> | pv | ssh <target-machine> "sudo btrfs receive <target-fs-path>"
sudo btrfs send /sysfs_ro | pv | ssh target-host "sudo btrfs receive /mnt/arc"

# 发送完成后,路径是 /mnt/arc/sysfs_ro

相关阅读

Memo把 ArchLinux 当成无线路由器用Memo网络与 DNS 资料Memo使用 nftables 模拟丢包

讨论

邮箱用于身份识别和回复通知,并由 Waline 存储。