UbuntuThis forum is for the discussion of Ubuntu 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.
Also, have in mind that normal & modern linuxes take a 10% of your partitions just to prevent them from collapse. Think, transactional partitions need more space for doing operations, so completely full partitions are unusable. So, if it is "full", you still can load your own system (no rescue/live cd needed) and free some space.
Ah! du is not at all a good solution, because if your partition is divided in 4096bytes blocks, a file with just 1 byte will be seen as 1 byte file by du, but it will be filling an entire block, so 4096 bytes will be locked.
emi
Edit: 'du' DOES count sizes by partition block size. See below.
Ah! du is not at all a good solution, because if your partition is divided in 4096bytes blocks, a file with just 1 byte will be seen as 1 byte file by du, but it will be filling an entire block, so 4096 bytes will be locked.
emi
What do you propose as the more suitable alternative?
'df' is the only one, I suppose. The only problem with 'df' is the percentage: 99,6% full will be seen as 100%, just it.
Just a trick: 'df' doesn't need root privileges to be run: it's ok to run it as a normal user (without 'sudo' or 'su').
Edit: 'du' DOES count sizes by partition block size. See below.
Sorry to all. I correct myself: 'du' DOES count sizes by block size. It's ok to use it as a real disk usage tool. Only keep in mind that numbers shown by plain 'du' are in kB. So a file with just 1 byte will show a '4' in a 4kB block size partition. I'll now correct previous posts to prevent errors to others
Edit: syg00 first post is what probably you're looking for.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.