dd'ing the disk device would generate an image of the filesystem, which includes information about how large the filesystem is. Which means that if you were copying it to a partition that was exactly the same size, then it would work. Otherwise, it wouldn't work[1]. However, there's still not a lot of point in doing that, since it'll also copy over all of the unused space in the filesystem. That is, if you had a 10GB filesystem but only 10MB of it was in use, you'd still be copying over 10GB of data (although it would probably compress pretty well ).

If you were using a filesystem that had a robust dump/restore implementation, I'd suggest using that, but I don't think any Linux filesystem does[2]. So go with tar or cpio.

That was longwinded, huh?

[1] Actually, it would work if the destination partition were larger, but you'd be throwing away the use of the extra space. So it would either not work or be inefficient.

[2] Looks like XFS does, if you're using that. I think that that's it, though. ext2 has one, but it doesn't work too well in my experience, and ReiserFS doesn't have one at all, and if there was ever a filesystem that needed a good backup utility, it's Reiser.


Edited by wfaulk (20/11/2002 13:41)
_________________________
Bitt Faulk