Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 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
For this part what I can think is your usbflash drive is not mounted with sync mode on. What I mean to say is when you deleted the files the changes were not written to it. If you would have tried umounting and then remounting I am quite sure you would have got the correct disk space usage.
Quote:
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.
For this part I need to understand what exactly you are trying to put forward. Are you trying to say that du and df values differ and du shows the current statistics and df shows old stats when drive mounted in async mode?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.