Last active
August 13, 2020 13:38
-
-
Save mboyar/cf83870c07eeeb2cd42402f0e1b3cb68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~~~ | |
#Backup | |
$ sudo dd if=/dev/sdX | gzip -c > /path/to/backup.img.gz & | |
$ while((1)); do sudo kill -SIGUSR1 $(pidof dd); sleep 1; if [[ $(pidof dd) == "" ]]; then break; fi; done | |
~~~ | |
#Restore | |
$ gunzip -c /path/to/backup.img.gz | dd of=/dev/sdY | |
$ while((1)); do sudo kill -SIGUSR1 $(pidof dd); sleep 1; if [[ $(pidof dd) == "" ]]; then break; fi; done | |
~~~ | |
#See https://wiki.archlinux.org/index.php/Dd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment