Weird Mount Problem...
Smoot Carl-Mitchell
smoot at tic.com
Sun Jul 29 15:46:58 UTC 2007
On Sun, 2007-07-29 at 18:10 +0300, Amichai Rotman wrote:
> Now I want to transfer the data I have on the suspiciously bad HDD to
> it. When I try to transfer a 23Gb directory, it moves about 80% and
> then says there's not enough room on target. When I check the target
> drive (the new one) it shows as full...
>
> What did I do wrong?
It is possible that you had files on the old drive with "holes" in them
which got expanded when you made the copy. As an optimization, a file
block of all zeros may not get stored on the disk. Such files have a
"hole" in the allocation. Also if you have device files or symlinks in
the old tree, a normal copy operation will copy the contents of the
device or the symlink to the new directory tree which is not what you
want to do.
My favorite tool for bulk copying files is rsync. With the proper
oprions it handles devices, file with holes and symlinks correctly and
efficiently.
For example if you are moving a directory called /mnt/oldrive
to /mnt/newdrive use this command:
sudo rsync -av /mnt/olddrive/ /mnt/newdrive
Note the trailing slash in the source directory. This tells rsync to
place the files in olddrive into the directory called newdrive. Leaving
the / off results in the creation of a subdirectory called oldrive under
the newdrive directory. Run this command using sudo so all the
permissions and ownerships are handled correctly.
You can also do the same bulk copying with a tar or dump/restore
pipeline. I find the rsync method much simpler and you can also restart
the command if it fails and rsync will start up where it left of doing
the copying.
See the rsync manual page for details on command options and usage.
--
Smoot Carl-Mitchell
System/Network Architect
email: smoot at tic.com
cell: +1 602 421 9005
home: +1 480 922 7313
More information about the ubuntu-users
mailing list