Operating System - HP-UX
1753706 Members
4900 Online
108799 Solutions
New Discussion юеВ

Re: Why directory size are diffrent in 2 diff server having same file size.

 
SOLVED
Go to solution
GIRIJA SWAIN
Advisor

Why directory size are diffrent in 2 diff server having same file size.

I have some interesting issue. du reports widely diffrent size in diffrent servers..

I have 2 N calss HPUX 11.00 servers. I create a directory "DDD" in server-A and put a file "abc" in that. Did the exact same in server-B. File size is exactly same in both server. But when i do a #du -k ./DDD the size differes. Server-B reports 3 to 5 times more size than server-A.

I checked the VxFS filesystem block size, both are 8K.
Any help is appreciated and will give points. ?
GSS-PALO-ALTO
6 REPLIES 6
Bharat Katkar
Honored Contributor

Re: Why directory size are diffrent in 2 diff server having same file size.

HI,
See if the thread below helps. Hopefully you remove something from DDD directory of Server B but the processes are still running.
Do # fuser -cu ./DDD on both the server, you could found out something there.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=628841

Regards,
You need to know a lot to actually know how little you know
monasingh_1
Trusted Contributor

Re: Why directory size are diffrent in 2 diff server having same file size.

How about the fragment size? Also do a cksum on the file. may be do a fsck on both filesystems. how big is the abc file? Does the fstyp -v of both logical vol match? Just do du ./ddd instead of du -k and see what is the difference. can you give exact output?
GIRIJA SWAIN
Advisor

Re: Why directory size are diffrent in 2 diff server having same file size.

Hi,
following are #fstyp -v output. I can see following diffrence, What needs to be done now ?

Server-A: f_frsize: 1024
Server-B: f_frsize: 8192
GSS-PALO-ALTO
monasingh_1
Trusted Contributor

Re: Why directory size are diffrent in 2 diff server having same file size.

Usually when you newfs -F vxfs -b 8192 ..., the file fragment size gets set at 8192 also. It should not be a problem at all if you are going to have large files (like database files) in the filesystem. Otherwise you are going to have files of a size of ~1K then you should create a new filesystem again with newfs -F vxfs -b 1024 so that your block size and fragment size become 1024.

hope this helps...
monasingh_1
Trusted Contributor
Solution

Re: Why directory size are diffrent in 2 diff server having same file size.

Also, if you do just newfs -F vxfs /dev/vg/lvol then you will have
f_bsize as 8192 and f_frsize as 1024 for the new filesystem and that may server your purpose.

Just try different variation of newfs to come up with what you need. That is when you can newfs at all, otherwise you will need to go to backup/newfs/restore procedure.

And if this filesystem is going to be used for big database files, I will not worry about it at all....
Bill Hassell
Honored Contributor

Re: Why directory size are diffrent in 2 diff server having same file size.

The file you are storing may be a sparse file, very common in databases. A sparse file is one that was created with missing records, or more accurately, empty records that were never written. The sparse file will automatically supply a string of nulls when reading the missing records. If you copy the file, the string of zeros will be stored in the destination and du will show the larger space. Both files will show the same results with ll and wc, and will behave exactly the same way.


Bill Hassell, sysadmin