I am having one nfs volume, which is mounted on one of the directory of root partition. My problem is when I checked
df -ha it adds up mounted directory file content as well. Following are my observations, for security reason few names are changed
I am at / right now,
Filesystem Size Used Avail Use% Mounted on /dev/xvda1 7.9G 3.5G 4.1G 47% / /dev/xvdf 9.9G 183M 9.2G 2% /home/abcedf 10.84.29.62:/home/abvdef/pqrstuv 197G 97G 91G 52% /home/abvdef/pqrstuv
abcdef is again one mounted volume and
pqrstuv is mount point of nfs
you can see right now it is 3.5 gb consumed,
when I execute,
root@ip-10-190-133-49:/# du -sh 3.5G . root@ip-10-190-133-49:/# du -sh --exclude=home 1.3G .
When I go to
root@ip-10-190-133-49:/home# du -sh 2.6G . root@ip-10-190-133-49:/home# du -sh --exclude=abcdef 66M .
when I go to
root@ip-10-190-133-49:/home/abcdef# du -hs 2.5G . root@ip-10-190-133-49:/home/abcdef# du -sh --exclude=pqrstuv 32M .
Based on above 3 observations I am concluding that my mounted nfs also calculating in
df -ha , I want to check is this normal to happen? or I am calculating in wrong manner.
alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias ls='ls --color=auto'
More details related to this,
when I was on / and run
root@ip-10-10-221-187:/# du -shx 4.1G .
and when I run
root@ip-10-10-221-187:/# df -ha Filesystem Size Used Avail Use% Mounted on /dev/sda1 9.9G 8.2G 1.3G 87% /
Here df says root partition 8.2G occupied, but du calculating only 4.1G, now where the difference 8.2G-4.1G=4.1G is going, it looks like df calculating doubled value, not sure how? and this force me to think is my mounted file system coming into picture in calculation or something else that not coming in my eyes.
Finally I get the issue, See two snaps of
top one is before restart and other is after restart,
Before restart when
df -ha says I am 8.9G full,
top - 04:36:08 up 5 days, 16:07, 3 users, load average: 2.34, 2.46, 2.18 Tasks: 225 total, 4 running, 220 sleeping, 0 stopped, 1 zombie Cpu(s): 19.1%us, 46.0%sy, 0.0%ni, 31.5%id, 3.1%wa, 0.0%hi, 0.2%si, 0.0%st Mem: 7864548k total, 7189196k used, 675352k free, 861072k buffers Swap: 0k total, 0k used, 0k free, 4221888k cached
After restart when
df -ha says I am 5.1G full,
top - 04:39:30 up 0 min, 2 users, load average: 2.18, 0.65, 0.22 Tasks: 223 total, 4 running, 218 sleeping, 0 stopped, 1 zombie Cpu(s): 13.6%us, 13.4%sy, 0.0%ni, 39.2%id, 33.8%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 7864548k total, 677452k used, 7187096k free, 15328k buffers Swap: 0k total, 0k used, 0k free, 150392k cached
Now when I observed cached values then I realize the cached is eating the extra GB that I was not able to find, any suggestion now how can I resolve this ?