![실행 중인 Linux 배포판을 .img 또는 .iso로 백업하는 방법](https://linux55.com/image/123688/%EC%8B%A4%ED%96%89%20%EC%A4%91%EC%9D%B8%20Linux%20%EB%B0%B0%ED%8F%AC%ED%8C%90%EC%9D%84%20.img%20%EB%98%90%EB%8A%94%20.iso%EB%A1%9C%20%EB%B0%B1%EC%97%85%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
아치 기반 배포판을 사용하고 있습니다만자로 리눅스. 전체 파일 시스템은 약 6GB입니다. img나 iso로 백업하고 싶습니다.
지금까지 내가 찾은 것은
클로니즈라. 하지만 지금까지 내가 발견한 것은 clonezilla가 실행 중인 시스템에서 백업할 수 없다는 것입니다.
dd - dd는 한 블록에서 다른 블록으로 복사합니다. 250GB를 모두 백업하고 싶지 않습니다. 사용한 6GB만 백업하고 싶습니다.
나는 노력했다이 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로는 부족하다고 하더군요. 왜 10GB가 6GB를 백업하기에 충분하지 않은지 모르겠습니다. ˙\_(ツ)_/˙
옵션이 있습니다시스템 배경이러한 문제를 해결하기 위해 우분투를 사용합니다. 아치 기반 배포를 위한 솔루션이 있습니까?