1831406 Members
3651 Online
110025 Solutions
New Discussion

Data move

 
SOLVED
Go to solution
Jeffrey F. Goldsmith
Super Advisor

Data move

I have to move a set of directories from server A to server B. I created a transfer directory (LV) on the server B and and mounted it on server A to help with the copy. Then I performed a copy (cp -R /year-end/fy01 /G_sharedfiles/year-end/fy01). Once the directory and files were copied I noticed that the folder size was not the same.

There are the same number of files in both directories but the total file size is different. Is there a way for me to compaire the files in both directories to see what files don't match?

Here is the information from the steps that I performed.

root: /G_sharedfiles/year-end ==> ll
total 360
drwxr-xr-x 2 65534 sys 62464 Jun 5 09:40 fy01

root: /year-end ==> ll
total 1384
drwxr-xr-x 2 root sys 63488 May 11 14:19 fy01

Then I did files and size:

root: /year-end/fy01 ==> du -sk
80372 .
root: /year-end/fy01 ==> find . -type f -print | wc -l
2903

root: /G_sharedfiles/year-end/fy01 ==> du -sk
80371 .
root: /G_sharedfiles/year-end/fy01 ==> find . -type f -print | wc -l
2903


If you need any other information let me know.
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Data move

This is very typical and you have nothing to worry about. The "problem" is directories. When a file is unlink()'ed (the system call that underlies the rm command), the corresponding directory entry is marked free but the size of the directory in not reduced. These "free" slots are then available for reuse. When you copied the filetrees, the directories were brand spanking new and contained no "holes" so that the directories are smaller (for now).

The behavior you are seeing is normal and expected.
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: Data move

If you really want to check each file you can write a script that will go through your file list and do a cksum on each file.

Do that in each directory tree, send the output to files, and then diff the files. Ideally you should have no differences.
Jeffrey F. Goldsmith
Super Advisor

Re: Data move

Thanks for the info.