Originally Posted by catkin
The dd command for simply copying the contents of one partition to another but dd is seldom the best choice if the partition contains a file system because a) if the old file system is fragmented the fragmentation is also reproduced b) if the new partition is bigger the extra space is unused c) if the new partition is smaller it fails d) if there is an error during copying, the resulting breakage can be extensive.
Is it a file system that you want to copy?
I'm interested to know if there's a better, preferably free, method besides dd
to copy a partition. I use dd
to backup my partition on the basis of this
As for item (b), above, I'm wondering if the resize2fs
command addresses this issue.
seems to indicate that it can with limitations.
I've tested these 2 commands below with flat files, and backed up, but not recovered, a partition with the 1st. I'm interested in any comments more experienced administrators might have on them.
dd if=/$dirname/$filename | gzip > /ExternalFile
/$filename.img.gz -c | dd of=/$dirname/$filename
where $dirname = dev for the entire partition
$filename = hda2 (or sda2, etc.)