howtos:backup_a_partition_with_dd_and_gzip
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | howtos:backup_a_partition_with_dd_and_gzip [02/12/2018 21:34] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Pre-Backup ====== | ||
+ | If you want to increase the gzip capability you would like to fill the non-allocated space with zeros. This is done by putting zeros into a file until the file fills up all space on the drive. Then delete the file to free up space. Now you should have " | ||
+ | |||
+ | < | ||
+ | dd if=/ | ||
+ | </ | ||
+ | |||
+ | ====== Backup ====== | ||
+ | |||
+ | When I need to backup a parititon I use the dd command, so simple and so powerful. Usually a partition isn't filled out and have some free space. To avoid creating a unnecessary huge backup file I parse it through gzip: | ||
+ | |||
+ | < | ||
+ | |||
+ | root@tdd-HP-ProBook-5310m:/ | ||
+ | 32688+0 records in | ||
+ | 32688+0 records out | ||
+ | 2142240768 bytes (2,1 GB) copied, 68,0337 s, 31,5 MB/s | ||
+ | root@tdd-HP-ProBook-5310m:/ | ||
+ | total 268M | ||
+ | -rw-r--r-- 1 root root 268M 2011-04-03 15:56 HP_TOOLS.img.gz | ||
+ | root@tdd-HP-ProBook-5310m:/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | As you can see 2GB becomes a 268MB backup file. | ||
+ | |||
+ | ====== Restore ====== | ||
+ | |||
+ | To restore the backup simply parse the backup file like this: | ||
+ | |||
+ | < | ||
+ | |||
+ | gunzip -c HP_TOOLS.img.gz | dd of=/ | ||
+ | |||
+ | </ |
howtos/backup_a_partition_with_dd_and_gzip.txt · Last modified: 02/12/2018 21:34 by 127.0.0.1