clonezilla再生龙命令行模式备份和还原

Table of Contents

备份

备份到远程ssh目录

# 挂载远程ssh目录
sudo sshfs [email protected]:/home/kali /home/partimag
# 备份
sudo /usr/sbin/ocs-sr -q2 -c -j2 -z9p -i 0 -sfsck -senc -p choose savedisk 2024-03-02-13-img sda

image-20240302214941071

备份到本地磁盘

# 挂载保存镜像文件的磁盘目录到本地目录/home/partimag
sudo mount /dev/sdb1 /tmp/xxx
sudo mount --bind -o noatime /tmp/xxx/xxxx /home/partimag
# 备份
sudo /usr/sbin/ocs-sr -q2 -c -j2 -z9p -i 0 -sfsck -senc -p poweroff savedisk autoname sda

image-20240302232645389

image-20240302225913194

还原

从远程ssh目录中的镜像还原到磁盘

# 挂载远程ssh目录
sudo sshfs [email protected]:/home/kali /home/partimag
# 恢复系统
sudo /usr/sbin/ocs-sr -g auto -e1 auto -e2 -r -j2 -c -k0 -p reboot restoredisk 2024-03-02--13-img sda

image-20240302224153050

从本地磁盘镜像文件恢复

# 挂载保存镜像文件的磁盘目录到本地目录/home/partimag
sudo mount /dev/sdb1 /tmp/xxx
sudo mount --bind -o noatime /tmp/xxx/xxxx /home/partimag
# 恢复系统
sudo /usr/sbin/ocs-sr -g auto -e1 auto -e2 -r -j2 -c -k0 -p reboot restoredisk 2024-03-02--13-img sda

参考资料

https://ezlost.com/2023/12/19/clonezilla-ocs-sr-%E5%92%8C-osc-onthefly-%E4%B8%AD%E6%96%87%E6%89%8B%E5%86%8C%EF%BC%88%E9%9D%9E%E5%AE%98%E6%96%B9%E7%BF%BB%E8%AF%91%EF%BC%89/

https://clonezilla.org/advanced/reserved-word-ocs-sr.php