Operating System - HP-UX
1838675 Members
4959 Online
110128 Solutions
New Discussion

different bytes in HFS & VxFS

 
George Liu_2
Frequent Advisor

different bytes in HFS & VxFS

When I cpio a directory from a HFS filesystem to a new VxFS filesystem, I noticed the used bytes in the two directories differ. However, the command diff showed the two directories are identical. Is that normal?

Please see the following example:

# mount /dev/vgbroot/lvol6 /mnt
# cd /opt
# find . -xdev -depth -print|cpio -pxdm /mnt
# diff /opt /mnt
Common subdirectories: /opt/ansic and /mnt/ansic
Common subdirectories: /opt/lost+found and /mnt/lost+found
# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol6 656715 539776 51267 91% /opt
/dev/vgbroot/lvol6 1638400 534728 1034694 34% /mnt

2 REPLIES 2
James R. Ferguson
Acclaimed Contributor

Re: different bytes in HFS & VxFS

Hi George:

A difference is expected and is normal. The structure of a vxfs (JFS) filesystem is quite different than an HFS one.

Also, regardless of filesystem type, once space for inodes are allocated in a filesystem, the space is not returned. You can see this for the size of a directory. Create a directory and create a large number of files beneath it. Examine the size of the directory with 'ls'. Now delete all of the directories files but one. Exampine the size of the directory again, and you will see it is unchanged. Lastly, copy the contents of this directory to a new directory. You will see that the new directory is substantially smaller.

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: different bytes in HFS & VxFS

Hi George,

Yes, that is very common and one way that it happens (in addition to the differing data structures of the directories for VxFS and HFS) is this:

Suppose that the original directory had 4000 files in it and that you then removed 3900 of them. The directory itself was not shrunk but only the entries were marked unused. The directory itself is still quite large. When you copy the directory over to the new location, the directory now only needs to be big enough to hold 100 entries.

If you are really concerned about the accuracy of the copy, a better test is to use sum or cksum to compare each file in the source and destination. I wouldn't worry; this is perfectly normal.

Clay
If it ain't broke, I can fix that.