我正在使用基于 arch 的发行版Manjaro Linux。完整的文件系统约为 6 GB。我想将其备份到 img 或 iso。
到目前为止我发现的是
克隆尼兹拉。但到目前为止我发现,clonezilla 无法从正在运行的系统进行备份。
dd - dd 从一个块复制到另一个块。我不想备份所有 250 GB 的空间。我只想备份已用的 6 GB。
我试过这个syncFilesystemToImage.sh git片段
# source - https://gist.github.com/geoffreyanderson/1004950 imageFile=${1:-"awsImage-$(date +%m%d%y-%H%M).img"} imageMountPoint=${2:-'/mnt/image'} echo "Creating empty 10GB image in ${imageFile}" # Create an empty 10GB image file dd if=/dev/zero of=${imageFile} bs=1M count=10240 echo "Creating filesystem in ${imageFile}" # Create a filesystem on the image file /sbin/mke2fs -F -j ${imageFile} echo "Mounting ${imageFile} loopback at ${imageMountPoint}" # Create the directories needed for imaging mkdir -p ${imageMountPoint} mount -o loop ${imageFile} ${imageMountPoint} echo "Beginning rsync..." rsync --stats -av --exclude=/root/.bash_history --exclude=/home/*/.bash_history --exclude=/etc/ssh/ssh_host_* --exclude=/etc/ssh/moduli --exclude=/etc/udev/rules.d/*persistent-net.rules --exclude=/mnt/* --exclude=/proc/* --exclude=/tmp/* --exclude=/sys/* --exclude=/dev/* / ${imageMountPoint} echo "rsync finished. Flushing copied log data..." #clear out any remaining log data cd ${imageMountPoint}/var/log for i in `ls ./**/*`; do echo $i && echo -n> $i done # Create base devices (console, null, zero) under the completed image for i in console null zero ; do MAKEDEV -d ${imageMountPoint}/dev -x $i ; done # get out of the image mount point so we can successfully unmount cd / # Sync changes and unmount the image sync umount ${imageMountPoint} rmdir ${imageMountPoint}
但该脚本在 处失败
rsync
。说10GB不够。我不知道为什么 10 GB 不足以备份 6 GB。 ˙\_(ツ)_/˙
有一个选项系统后台ubuntu来解决这样的问题。基于 arch 的发行版有什么解决方案吗?