Small file taking up lots of disk space

Small file taking up lots of disk space

Post by Jason Willia » Thu, 27 Mar 2003 07:06:13



Hello,

I have a server running RH 7.2 with kernel 2.4.7-10smp.
We are running postgresql 7.2.1 and it has generated a log file.

"ls -l" reports this file to be of 9531465 (9.5MB) bytes in size.
"du" reports this file to be using 17833520 1K blocks (18GB) of disk
space.

I realize there will be some discrepancy between du and ls, but this
is several orders of magnitude.  Just to be sure, I ran "wc -c" on the
file and it reports 9531465 characters in the file.  I then copied the
file to the /tmp directory and then du reports only 9347 1K blocks in
use.  What??!!?

Postgresql is still running while I'm looking at this file, but I
don't think that would cause this.

Anybody have a clue what is going on here?

Thanks,

Jason

 
 
 

Small file taking up lots of disk space

Post by Chri » Fri, 28 Mar 2003 04:55:08



> Hello,

> I have a server running RH 7.2 with kernel 2.4.7-10smp.
> We are running postgresql 7.2.1 and it has generated a log file.

> "ls -l" reports this file to be of 9531465 (9.5MB) bytes in size.
> "du" reports this file to be using 17833520 1K blocks (18GB) of disk
> space.

> I realize there will be some discrepancy between du and ls, but this
> is several orders of magnitude.  Just to be sure, I ran "wc -c" on the
> file and it reports 9531465 characters in the file.  I then copied the
> file to the /tmp directory and then du reports only 9347 1K blocks in
> use.  What??!!?

> Postgresql is still running while I'm looking at this file, but I
> don't think that would cause this.

> Anybody have a clue what is going on here?

> Thanks,

> Jason

Actually, Postgresql could cause this.  It's not uncommon for a file
or filesystem to misreport its size/usage if you delete/copy/empty a
file that has a process attached to it.

I would try restarting Postgresql and looking at the file size.

Regards,
Chris

 
 
 

1. Small files/lots of directories consuming disk space.

I set up an imaging system where I store small images in numeric
subdirectories. 0/0/0/1/0/3 stores all of the images for number 103, for
example. The problem is I'm using about 10 times the disk space I expected.
I suspect it's the space for the subdirectories, but even there it doesn't
seem to add up.

Any ideas on the cause, and any way to tweak SCO to not waste so much space?

Thanks!

Doug

2. Memory Leak? Redhat/Apache

3. AIX 3.2 and lots of small files

4. Need help please

5. Disk space, where are my files, where is my free space?

6. ppp-2.2.0e and kernel 1.3.89 again

7. How much disk space a specific directory takes?

8. Where is mkimage???

9. disk space strategy suggestion for small groups

10. paging space for large memory/small disk

11. we're having a lot of problems with mutual file corrupting on the disk

12. Shape Ups,Men's Shape Ups,Men's Skechers Shape Ups - new styles!

13. Solaris rpc.nisd taking lots o' memory