Operating System - HP-UX
1848590 Members
5168 Online
104033 Solutions
New Discussion

what causes this difference ?

 
MARREEL Chris_1
Regular Advisor

what causes this difference ?

I have used cpio to copy a lot of files from one logical volume to another.
The command I used :
cd /swd/cocreate
find . -print | cpio -pdumvxa /pc/uxdata/es/software

After this copy-operation I used du -sk to check if the copy and the source were equal in size (which I expected) :
- the source-directory :
server-2:/swd # du -sk cocreate
244745 cocreate
server-2:/swd #

- the destination-directory :

server-2:/pc/uxdata/es # du -sk software
244568 software
server-2:/pc/uxdata/es #

What causes the difference in size ?
I have manualy checked the source and destination and they seems to contain the same files.
Can anybody explain me what causes the difference in size ?

Greetings,
Chris MARREEL
3 REPLIES 3
Patrick Wallek
Honored Contributor

Re: what causes this difference ?

When copying files, the sizes will NEVER (or very rarely) be absolutely identical.

The biggest reason for this is the size of the directory itself. As files are added to the directory the size (do an ll -d on the directories) of the directory will grow and grow, but if files are deleted it will never shrink. When you copy everything from a directory, all directory sizes grow as needed during the copy so that space is reclaimed.

Make sense?
Darrell Allen
Honored Contributor

Re: what causes this difference ?

Hi Chris,

Maybe this thread will help.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5cc89200caded5118ff40090279cd0f9,00.html

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
James R. Ferguson
Acclaimed Contributor

Re: what causes this difference ?

Hi Chris:

This is the norm. This question periodically comes up. See Bill Hassell's comments here:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5cc89200caded5118ff40090279cd0f9,00.html

Regards!

...JRF...