Forum Topic - Ram disk free space does not align with what is actually being reported by ls -l: (5 Items)
   
Ram disk free space does not align with what is actually being reported by ls -l  
Hi:

We are using QNX641 (PowerPC version) and have created a 32M ram disk using the following commands:

    devf-ram -i 2 -s0,32M &
    waitfor /dev/fs2p0
    flashctl -p /dev/fs2p0 -e -f -n /ram -m

Running 'df -kP' immediately followed by 'ls -l':
# df -kP
Filesystem           1024-blocks      Used Available Capacity  Mounted on
/dev/fs2p0                 32704     25291      7412      78%  /ram

# ls -l
total 34203
-rw-r--r--  1 1000      1000            172 Aug 29 20:36 .lldpport.conf
-rw-r--r--  1 root      0                41 Oct 18 16:35 lldp-debug
-rw-r--r--  1 root      0               953 Oct 18 16:35 plm-debug
-rw-r--r--  1 root      0           2657904 Oct 19 11:26 slc-ew-debug
-rw-r--r--  1 root      0           3145819 Oct 19 10:13 slc-ew-debug.1_2011-10-19-11-26
-rw-r--r--  1 root      0           3145816 Oct 19 06:48 slc-ew-debug.2_2011-10-19-10-13
-rw-r--r--  1 root      0           2267346 Oct 19 11:34 slc-we-debug
-rw-r--r--  1 root      0           3145728 Oct 19 10:18 slc-we-debug.1_2011-10-19-11-34
-rw-r--r--  1 root      0           3145728 Oct 19 07:03 slc-we-debug.2_2011-10-19-10-18


So 'df' reports ~25M of disk space is used yet if you tally up the contents of the directory as reported by ls -l, only 
~17M are used. Not clear why the discrepancy? I can understand that there might be some overhead for the actual 
management of the partition but 8M??

Thanks
Robert
RE: Ram disk free space does not align with what is actually being reported by ls -l  
Try ls -al to show any hidden files starting with '.' ... maybe there is more content on the disk. 

-----Original Message-----
From: Robert D'Attilio [mailto:community-noreply@qnx.com] 
Sent: October-19-11 12:41 PM
To: general-filesystems
Subject: Ram disk free space does not align with what is actually being reported by ls -l

Hi:

We are using QNX641 (PowerPC version) and have created a 32M ram disk using the following commands:

    devf-ram -i 2 -s0,32M &
    waitfor /dev/fs2p0
    flashctl -p /dev/fs2p0 -e -f -n /ram -m

Running 'df -kP' immediately followed by 'ls -l':
# df -kP
Filesystem           1024-blocks      Used Available Capacity  Mounted on
/dev/fs2p0                 32704     25291      7412      78%  /ram

# ls -l
total 34203
-rw-r--r--  1 1000      1000            172 Aug 29 20:36 .lldpport.conf
-rw-r--r--  1 root      0                41 Oct 18 16:35 lldp-debug
-rw-r--r--  1 root      0               953 Oct 18 16:35 plm-debug
-rw-r--r--  1 root      0           2657904 Oct 19 11:26 slc-ew-debug
-rw-r--r--  1 root      0           3145819 Oct 19 10:13 slc-ew-debug.1_2011-10-19-11-26
-rw-r--r--  1 root      0           3145816 Oct 19 06:48 slc-ew-debug.2_2011-10-19-10-13
-rw-r--r--  1 root      0           2267346 Oct 19 11:34 slc-we-debug
-rw-r--r--  1 root      0           3145728 Oct 19 10:18 slc-we-debug.1_2011-10-19-11-34
-rw-r--r--  1 root      0           3145728 Oct 19 07:03 slc-we-debug.2_2011-10-19-10-18


So 'df' reports ~25M of disk space is used yet if you tally up the contents of the directory as reported by ls -l, only 
~17M are used. Not clear why the discrepancy? I can understand that there might be some overhead for the actual 
management of the partition but 8M??

Thanks
Robert



_______________________________________________

General
http://community.qnx.com/sf/go/post89456
Re: RE: Ram disk free space does not align with what is actually being reported by ls -l  
Tried that already and there are no extra (hidden) files.
RE: RE: Ram disk free space does not align with what is actually being reported by ls -l  
Try flashctl -i -p /ram  to see the breakdown of free space/stale space/used space, and overhead.

> -----Original Message-----
> From: Robert D'Attilio [mailto:community-noreply@qnx.com]
> Sent: October-19-11 1:25 PM
> To: general-filesystems
> Subject: Re: RE: Ram disk free space does not align with what is
> actually being reported by ls -l
> 
> Tried that already and there are no extra (hidden) files.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post89459
Re: RE: RE: Ram disk free space does not align with what is actually being reported by ls -l  
Ok, here is what I get
# flashctl -i -p /ram
Array Info
 Total      :  0x02000000  100%
  Chip Size :  0x02000000  100%
  Unit Size :  0x00010000    0%
Part Info
 Total      :  0x02000000  100%
  Spare     :  0x00010000    0%
  Headers   :  0x007D4494   24%
  Padding   :  0x00023A55    0%
   Overhead :  0x00807EE9   25%
  Free      :  0x0004E19C    0%
  Stale     :  0x00ACE164   33%
   Avail.   :  0x00B1C300   34%
  Reserved  :  0x00000020    0%
Unit Info
 Erase Stats
  Average   :  0
  Minimum   :  0
  Maximum   :  2
  Total     :  437

And 
# df -kP
Filesystem           1024-blocks      Used Available Capacity  Mounted on
/dev/fs2p0                 32704     21325     11378      66%  /ram


Not clear to me how the breakdown from flashctl tallies up to 100% and why Free is 0%. Can you point to some docs that 
explain the breakdown?

Thanks