Topic: Easily making compressed partition backups:
Hi, just a suggestion of a feature which I think could be very simply and quickly added to gparted...
I make compressed images of my various types of partitions using the following script (which I modified slightly from one I found on the net):-
dd if=/dev/hda1 bs=512 | gzip -c | split -b 100m - backups.img.gz.&
Then, to restore it to a partition:-
cat backups.img.gz.* | gzip dc | dd of=/dev/hda1&
This creates a consecutively named set of 100MB compressed files, which are automatically and perfectly rejoined when the files are copied back to a partition.
I find this advantageous in the following ways:
1. It's much smaller than the copied partition;
2. You don't need a special partition to put the backup in;
3. It can be stored on other filesystems;
4. It can be copied to cd's, dvd's or anything else at all;
5. It seems very stable;
6. It's quite quick;
It can be further optimized by first mounting the relevant filesystem, then filling any unused space with zero-filled files, eg:
(do this inside a loop, till "no space left" type of error)
dd if=/dev/zero of=TempZeros/File_001 bs=1000000 count=500
dd if=/dev/zero of=TempZeros/File_002 bs=1000000 count=500
(loop ends here at error)
rm TempZeros (and whatever option removes contents, too)
If the empty space in the partiton is not zero'd this way, the compression will not work as well, and will take longer, as it has to compress everything which was on the partiton, even old, leftover deleted files. (but it will still work well, though...)
I envision that this could be added to gparted as a simple menu item, eg:-
1. You could select a partition to backup from the gparted main screen;
2. Then right-click it and choose "Make Compressed Backup" option;
3. Then from a list-box, select a destination partition (which would then be mounted, at /tmp/dest and a folder created in it like: <date>_<time>_backups;
4. A zeroing script could optionally be run at this point, first mounting the partiton to be copied, filling unused space with zeros, then unmounting it again.
5. The copying script would now be run;
6. Another script would then be run which made a copy of the MBR sectors and saved them to a file as well;
7. Lastly, the relevant line of output of "fdisk -l" would be redirected to a text-file and saved as well, so anyone looking at the backups later could determine the partition size, type, number etc., (and a restoring script could find out info from this file as well).
To restore partitions, you would right-click on a partition, then choose "Restore Compressed Backup", and then choose the partition (which would be mounted for you) and directory where the backups were stored.
Alternatively, you could include a script with the saved backups which would automate the backup process, giving some options along the way (like restoring to another suitable partition).
I hope this suggestion is appropriate, I have already mentioned some of these techniques/ideas before this, but thought I would go to the trouble of trying to put it down in a more complete way for the forum, as I thought it might be of some use perhaps?
All the best everyone, great program! -rl