Created
June 26, 2016 18:52
-
-
Save pa-re/a6d75365bf4a849b620fda851419f671 to your computer and use it in GitHub Desktop.
Some snippets to backup a partition and restore it later or mount it as a loopback device
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
dd if=/dev/sda6 conv=sync,noerror bs=64K | pigz -c -9 | split -a3 -b2G - /media/ubuntu/b38e1e94-e09a-4f58-b252-33d65186277e/backup_sda6.img.gz | |
cat /media/ubuntu/b38e1e94-e09a-4f58-b252-33d65186277e/backup_sda6.img.gz* | pigz -d -c | dd of=/dev/sdXXXXXXX | |
dd if=/dev/sda1 of=/media/ubuntu/Data/backup_sda1.img | |
mkdir /mnt/test | |
mount -o loop,ro /media/ubuntu/Data/backup_sda1.img /mnt/test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment