0

What happened:

My 500GB harddrive on my DELL XPS13 kept running out of space very quickly - and the problem kept occurring every few months, despite my best efforts to clean up my system (see below). I guess somehow my home directory was/is not being properly mounted, resulting in extra space being used up on my harddrive that I could not always see, depending on the tool used.

Rebooting in secure boot allowed me to see the superfluous data. Because this has happened from the start with this computer I am going to reinstall my Ubuntu completely (Ubuntu came pre-installed by DELL)...

Second version of post

It seems I am having another problem than I thought (initial post below)...

I have an SSD harddrive with 500GB available.

  df -h

tells me I am using 327GB of the 500 in my home directory (encrypted) relevant output:

  Filesystem           Size  Used Avail Use% Mounted on
  /home/gugy/.Private  435G  327G   87G  80% /home/gugy

But nautilus tells me I am only using 224.6 GB in my home/gugy directory.

Any ideas where the ca 100GB went that I am not seeing in Nautilus, how to get the two tools to agree/delete the 100GB that I do not know what they are?

I have run

  apt-get clean 
  apt-get update
  apt-get upgrade
  apt-get dist-upgrade 

to save a few GB here and there, but cannot find the culprit :/

More info baobab tells me /home and /home/gugy directories are using 244 GB (not each, but on both levels)

 ls -lsha /home/
 total 36K
 4.0K drwxr-xr-x  4 root root 4.0K Mar 21  2017 .
 4.0K drwxr-xr-x 25 root root 4.0K May  9 08:55 ..
 4.0K drwxr-xr-x  3 root root 4.0K Mar 21  2017 .ecryptfs
  24K drwx------ 70 gugy gugy  20K May  9 11:00 gugy

First version of post

I have an encrypted home directory on my Ubuntu 16.04, my built in SSD harddrive has 500 GB of space totally available. I have been running out of space faster than expected (466.7 GB used, all of it in /home, but when I check my /home/USER directory, its only 224.6 GB big) and now I have finally figured out what is going wrong: ncdu (version 1.11) is showing me this as the output for my /home directory:

     --- /home ----------------------------------------------------------------------
    . 227.4 GiB [##########] /.ecryptfs
    . 227.4 GiB [######### ] /USER

I would now very much like to delete something, my data are all backed up but I am not sure how to proceed. I would like to keep my home directory encrypted, but I do not just want to delete stuff without understanding how this situation came to be. Did not properly unmounting the encrypted home directory cause this somehow (I have no clue how this could have happened...)? I have a virtual machine with windows on it and shared folders between the guest and host, could this have cause such an issue? Any tips, hints, ideas, suggestions are very welcome.

more info: as requested by comments:

 df -h

 Filesystem           Size  Used Avail Use% Mounted on
 udev                 7.8G     0  7.8G   0% /dev
 tmpfs                1.6G   26M  1.6G   2% /run
 /dev/nvme0n1p3       435G  327G   87G  80% /
 tmpfs                7.8G   65M  7.8G   1% /dev/shm
 tmpfs                5.0M  4.0K  5.0M   1% /run/lock
 tmpfs                7.8G     0  7.8G   0% /sys/fs/cgroup
 /dev/loop2            87M   87M     0 100% /snap/core/4407
 /dev/loop1            87M   87M     0 100% /snap/core/4571
 /dev/loop0            87M   87M     0 100% /snap/core/4486
 /dev/loop3            60M   60M     0 100% /snap/notes/4
 /dev/nvme0n1p1       496M   28M  469M   6% /boot/efi
 tmpfs                1.6G  100K  1.6G   1% /run/user/1001
 /home/gugy/.Private  435G  327G   87G  80% /home/gugy
 tmpfs                1.6G     0  1.6G   0% /run/user/0

PS: gugy is my user...

output of

     du -h /home/

runs over too many pages to print

  • I don't have an answer, but it looks like .encryptfs is important when reading EncryptedHome. Could you provide df -h and du -h /home/ outputs? Check Avail, it could just be an illusion. Have you tried baobab? – earthmeLon May 12 '18 at 19:33
  • I have used K4DirStat and Disk usage analyser, they all tell me I am only using 240 GB in my /home/USER/ directory. But I am still running out of space, (root filesystem running out of space etc) and nautilus also tells me I have only ca 92 GB left... – gugy May 12 '18 at 22:03
  • Possible duplicate of askubuntu.com/q/860884/295286 – Sergiy Kolodyazhnyy May 12 '18 at 22:56
  • Why are there two "before edit" sections in your text? Please condense your post into one single text incorporating all changes instead of a tree of changes. We can see what changed in the revision history, so "updates" and "before edits" are unnecessary and confusing. – muru May 15 '18 at 8:25
0

Encryption does not double your disk usage, removing the encryption would make no difference. Some disk usage apps report encrypted data wrongly or confusingly, the best way to view your actual usage is with:

df -h

0

On Linux, you have disk which have partitions. These partitions are mounted to various mountpoints, or directories, on the system.

This is interesting because it means you can have a relatively simple system, or you can break out different directories onto different disks. For example, your / (root) and your /home/ directories could live on separate disks. This provides separation of concerns, and greater flexibility with future changes.

In addition, the filesystems themselves can contain links. Links are generated by ln, and are either hard or soft links. When you create a link, you are telling the system that the file lives in one place, but you want it accessible from another location. When you edit either reference, the other is updated.

Using a combination of these two features, you can store your Linux distribution on your SSD, with limited space and you could first break out /home/ onto another SSD or HDD, but why stop there? You could get a third drive, and put it at /mnt/data/, and store larger files. You could imagine a scenario where you have something like /mnt/data/some/long/path/Videos, and you want to be able to access them more easily. You could link that directory to somewhere in your home directory:

ln -s /mnt/data/some/long/path/Videos /home/user/Videos

Now, if add a file to either directory, they both have the file, but only the source stores the actual data when you have a symbolic link, like the one created using the -s flag.

This means that, instead of literally copying all of the data into two places (hard-link), we only store the data in one place, and reference, or point to it. However, if you look at the files, they will report that they have sizes, and the links duplicate the reported total used space, with some tools.


This is why we're telling you do look at the output of df -h, specifically, the Avail column:

Filesystem                    Size  Used Avail Use% Mounted on
/dev/sda1                     1.0G  100M  0.8G  16% /boot

Here, we see my /boot partition, and the Used percentage. That's the actual use, and is a value that you can trust. Even if I create a bunch of symbolic links, the size doesn't change:

$ sudo ln -s /boot/initrd.img-4.4.0-47-generic /boot/${N}
$ ls -lsha /boot
total 102M
4.0K drwxr-xr-x  4 root root 4.0K May 12 15:18 .
4.0K drwxr-xr-x 25 root root 4.0K Oct 22  2017 ..
   0 lrwxrwxrwx  1 root root   33 May 12 15:18 1 -> /boot/initrd.img-4.4.0-47-generic
   0 lrwxrwxrwx  1 root root   33 May 12 15:18 2 -> /boot/initrd.img-4.4.0-47-generic
   0 lrwxrwxrwx  1 root root   33 May 12 15:18 3 -> /boot/initrd.img-4.4.0-47-generic

Once you understand this, you can use tools such as baobab to visually inspect your disks, which helps you to quickly find where large files are located.


Update

It's possible that /home/gugy/ was written to before the file-system was mounted. This would result in files being 'hidden' to most tools, and can be checked by restarting into recovery mode and dropping to root prompt.

/home/gugy/ should exist, but there should be no files found in that directory, when using Encrypted Home. The encrypted data should be found, and left alone, in /home/.ecryptfs/gugy.

  • Thanks, I understand much better what is NOT going on now :) The problem that I am apparently using ca 100GB somewhere that I do not know what they are remains though... df -h says I am using 435GB, nautilus 224.6 I would not mind a difference of a few GB and could understand that it is due to different programs counting differently, but 100GB is a bit too much, don't you think? – gugy May 12 '18 at 22:27
  • see update, hope I am making sense and understand what you mean... baobab tells me home and gugy directories are using 244 GB.. – gugy May 12 '18 at 22:36
  • Great updates. Can you give us ls -lsha /home/? baobab is saying it's not duplicated, so, are you seeing anything else that's taking up 100GB? – earthmeLon May 12 '18 at 22:40
  • I am getting a permission error with baobab: Error opening directory '/home/gugy/.cache/dconf': Permission denied, running as sudo now to see if that helps, slow so far... – gugy May 12 '18 at 22:43
  • I created this chat if you'd like some help real quick. – earthmeLon May 12 '18 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.