Re: ext4 - 52.2% non-contiguous
On Mon, Jul 06, 2009 at 06:49:09PM -0400, Daryl Styrk wrote:
> After initially building the filesystem I ran fsck which showed
> something like 0.7% if I remember correctly. I then copied about 60GB
> from an ext3 via rsync after which the fragmentation showed up.
by default, rsync copies a file in small chunks, so copying an entire
filesystem to a drive that is actively in use could certainly cause
fragmentation. If you have to use rsync, and have enough space for the
tar file on the remote side, you can try something like this:
tar cvf - /home | rsync -PSauve ssh - host:/path/to/copied/tarfile
AFAIK, you'd have to do some real gymnastics with named pipes or process
substitution to treat an rsync transfer as a pipeline to untarring, so
I'd suggest this instead:
# From the root directory of the host on which you want to unpack
# the copied filesystem.
ssh -c 'sudo tar cvSf - /home' remote | sudo tar xvSpf -
Really, the main reasons to use rsync are:
- to enable resume on really large files (e.g. an entire filesystem
tarred as home.tar.gz)
- to transfer file deltas rather than entire files
For what you're doing, I don't think rsync is the right tool unless
you're trying to copy home.tar.gz over an unreliable network connection.
If it's on a LAN, just use SSH and tar.
"Oh, look: rocks!"
-- Doctor Who, "Destiny of the Daleks"