Disk space usage problem

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
dave31175
Level 1
Level 1
Posts: 44
Joined: Sun Nov 29, 2015 3:54 pm

Disk space usage problem

Postby dave31175 » Mon Jun 19, 2017 2:53 pm

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.

User avatar
xenopeek
Level 24
Level 24
Posts: 21292
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Disk space usage problem

Postby xenopeek » Mon Jun 19, 2017 3:08 pm

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
Level 1
Level 1
Posts: 44
Joined: Sun Nov 29, 2015 3:54 pm

Re: Disk space usage problem

Postby dave31175 » Mon Jun 19, 2017 3:21 pm

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: 11630
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Disk space usage problem

Postby austin.texas » Mon Jun 19, 2017 3:31 pm

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 2017

User avatar
xenopeek
Level 24
Level 24
Posts: 21292
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Disk space usage problem

Postby xenopeek » Mon Jun 19, 2017 3:32 pm

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
Level 1
Level 1
Posts: 44
Joined: Sun Nov 29, 2015 3:54 pm

Re: Disk space usage problem

Postby dave31175 » Mon Jun 19, 2017 3:32 pm

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: 11630
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Disk space usage problem

Postby austin.texas » Mon Jun 19, 2017 3:36 pm

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 2017

Cosmo.
Level 22
Level 22
Posts: 15431
Joined: Sat Dec 06, 2014 7:34 am

Re: Disk space usage problem

Postby Cosmo. » Mon Jun 19, 2017 4:46 pm

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.


Return to “Newbie Questions”

Who is online

Users browsing this forum: Google [Bot], Linux_User157, michael louwe, Mute Ant and 8 guests