Disk space usage problem

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
dave31175

Disk space usage problem

Post by dave31175 »

Nemo shows only 15.8GB free space in my 345GB filesystem partition.
Disk Usage Analyzer run as gksudo shows only 158GB used.
Disks shows 33GB free of 345GB (90.4% full)

Why is there such a discrepancy in reported usage, and assuming it is 90% full, how do I find out what's consuming the space when Disk Usage Analyzer shows significantly less space being used?

Linux Mint Cinnamon 17.2. Let me know what other info I can provide that would be useful.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29612
Joined: Wed Jul 06, 2011 3:58 am

Re: Disk space usage problem

Post by xenopeek »

The difference between Nemo and Disks likely is the reserved space for root. A few percent of your filesystem is reserved for root so that even when you fill up your entire filesystem, you can still boot into recovery mode and log in as root and repair the problem from there with some disk space available. Nemo would not count that as available to you. Disks doesn't distinguish between which user the space is reserved for.

The difference between Disks and Disk Usage Analyzer is that Disks counts up the filesystem blocks (commonly a filesystem is divided into atomic blocks of 4,096 bytes each) while Disk Usage Analyzer counts up at the actual file sizes. Thus if you have a thousand files of 1 byte, Disk Usage Analyzer would say that is 1,000 bytes total. But as filesystem blocks are atomic, each such file actually uses one 4,096 byte block for a total of 4,096,000 bytes. Hence this difference.

In short: many small files can eat up more disk space than a few large ones, even though the sum of the file sizes is less!
Image
dave31175

Re: Disk space usage problem

Post by dave31175 »

xenopeek wrote:The difference between Nemo and Disks likely is the reserved space for root. A few percent of your filesystem is reserved for root so that even when you fill up your entire filesystem, you can still boot into recovery mode and log in as root and repair the problem from there with some disk space available. Nemo would not count that as available to you. Disks doesn't distinguish between which user the space is reserved for.

The difference between Disks and Disk Usage Analyzer is that Disks counts up the filesystem blocks (commonly a filesystem is divided into atomic blocks of 4,096 bytes each) while Disk Usage Analyzer counts up at the actual file sizes. Thus if you have a thousand files of 1 byte, Disk Usage Analyzer would say that is 1,000 bytes total. But as filesystem blocks are atomic, each such file actually uses one 4,096 byte block for a total of 4,096,000 bytes. Hence this difference.

In short: many small files can eat up more disk space than a few large ones, even though the sum of the file sizes is less!
Thanks for that explanation! However I'm still confused just how much free space I actually have. To add to the confusion, I noticed when running Dusk Usage Analyzer with gksudo again, the opening screen shows 306.4GB used of 339.5GB. So assuming I am nearly at capacity, how can I find out what is using the space when Analyzer's "analysis" shows only 158GB used?
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Disk space usage problem

Post by austin.texas »

What is the result of

Code: Select all

inxi -p
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
User avatar
xenopeek
Level 25
Level 25
Posts: 29612
Joined: Wed Jul 06, 2011 3:58 am

Re: Disk space usage problem

Post by xenopeek »

Try to narrow down what the largest directory is across the common suspects. Common suspects are /var/log or other directories in /var and of course your own home directory.

Personally I prefer to use ncdu for this. You'd need to install it and you run it from the terminal. Run command ncdu /var to quickly find the largest directory in /var. Or ncdu ~ to quickly find the largest directory in your home directory. Which among the two is the largest and how big is it?
Image
dave31175

Re: Disk space usage problem

Post by dave31175 »

austin.texas wrote:What is the result of

Code: Select all

inxi -p

Code: Select all

Partition: ID-1: / size: 317G used: 286G (96%) fs: ext4 dev: /dev/sda5
           ID-2: /media/data size: 2.7T used: 2.1T (78%) fs: ext4 dev: /dev/sdb1
           ID-3: swap-1 size: 6.34GB used: 0.01GB (0%) fs: swap dev: /dev/sda6
Last edited by xenopeek on Mon Jun 19, 2017 4:20 pm, edited 1 time in total.
Reason: code tags added
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Disk space usage problem

Post by austin.texas »

For information on the root partition, run the command:

Code: Select all

sudo du / -xhd1 --exclude={/run,/proc,/dev,/media,/mnt,/sys,/tmp}
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Disk space usage problem

Post by Cosmo. »

dave31175 wrote:I noticed when running Dusk Usage Analyzer with gksudo again, the opening screen shows 306.4GB used of 339.5GB. So assuming I am nearly at capacity, how can I find out what is using the space when Analyzer's "analysis" shows only 158GB used?
Now you have from all information sources more or less the same result.

As you have used the Disk Usage Analyzer you should find quickly the culprit: The tool lists the folders in the order of used space. You can further into each folder to see, what inside uses the space.
Locked

Return to “Beginner Questions”