df vs du discrepancy
I have a usbflash drive and via df it was showing size 3.8G with 258M free. I deleted the only couple of files on it and it then shows 268M free even though it was empty. It's formatted to FAT32 so I formatted it in my windows pc and put it back in the linux box and this time it showed correctly of
/dev/sdc1 3.8G 4.0K 3.8G 1% /mnt/usbflash what has happened here? as I think it's done the same for my usb hard disk df shows /dev/sdd1 466G 466G 0 100% /mnt/usbdisk but du shows 415G used I believe du is what's actually physically in use on the disk but df accounts for other allocated stuff waiting to go on it is this right. I did lsof | grep deleted mysqld 2157 mysql 4u REG 9,0 0 94076933 /tmp/ibODLTNW (deleted) mysqld 2157 mysql 5u REG 9,0 0 94076934 /tmp/ibzVf00G (deleted) mysqld 2157 mysql 6u REG 9,0 0 94076935 /tmp/ibfy36dr (deleted) mysqld 2157 mysql 7u REG 9,0 0 94076936 /tmp/ibZufItb (deleted) mysqld 2157 mysql 11u REG 9,0 0 94076937 /tmp/ib3VuYdW (deleted) if this means anything? I'm running Debian 2.6.26-2-686 |
Quote:
Quote:
Please explain. |
I tried remounting the usbflash drive before I formatted it and it still showed the incorrect sizes.
Yes the fact that the sizes from df and du differ and how to rectify it. How do I mount in async mode? |
@ Reply
Alright. I have tested it myself and I found the same discrepancy. I tested on my SLES system and Ubuntu system with the same results that is there was a difference between the output of df and du.
And yes df output is greater than du output. After a bit of digging I found: http://www.cyberciti.biz/tips/freebs...nt-output.html The above link explains the concept of open file descriptor which is the reason behind mis-match. When you mount a flash drive if I am not wrong it always mount in async mode. I hope this helps. |
All times are GMT -5. The time now is 06:42 PM. |