5

Today I noticed a strange issue on my Debian Jessie Laptop. Apparently I've ran out of space.

df shows that /dev/dm-1 is full, but I am not sure why. I have been downloading a couple of ISO's using Firefox when I noticed this happening.

My downloads should be under /home so I am not sure what part /dev/dm-1 plays in this. I don't even know what /dev/dm-1 is used for.

Filesystem                       Size  Used Avail Use% Mounted on
/dev/dm-1                        9.1G  9.0G     0 100% /
udev                              10M     0   10M   0% /dev
tmpfs                            769M  9.1M  760M   2% /run
tmpfs                            1.9G  208K  1.9G   1% /dev/shm
tmpfs                            5.0M  4.0K  5.0M   1% /run/lock
tmpfs                            1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1                        236M   33M  191M  15% /boot
/dev/mapper/enterprise--vg-home  277G   92G  171G  35% /home
tmpfs                            385M  8.0K  385M   1% /run/user/1000

Any ideas what's going on? This is stopping me doing anything and if I restart I will be unable to run startx due to there being no space left.

3 Answers 3

4

As the last column shows, that device (apparently a LVM volume) corresponds to /, the main filesystem on which the OS is stored. The largest parts are likely to be:

  • /usr, installed software;
  • /var/log, system logs;
  • /var/cache, cached files.

Often a lot of space is occupied by /var/cache/apt, which contains packages temporarily downloaded by apt-get before installing them. Try sudo apt-get clean to remove them all.

Also take a look at /var/log – if necessary, sudo rm /var/log/*.gz* will delete all the old logs (which are probably useless on a laptop).

Once you clean up some disk space, install ncdu and run sudo ncdu -x / to check what other directories take up space in the / filesystem.

Since this is LVM, you could also shrink the /home volume a bit and give some 10–15 GB to /.

1
  • ncdu is exactly what I was looking for, thank you!
    – Lucas
    Jul 29, 2017 at 23:30
2

@grawity's answer is good, and starting cleanup in /var/log/ is also good, but I'd like to add some things.

Without installing anything you can do

sudo du -x --max-depth=1 / | sort -n

to show you in the second-to-last line what branch of the directory tree is taking up most place. If it is, say, /var, then change / to /var in the command above and repeat.

Another place that could be taking up space is /boot, with lots of old kernels. Use uname -r to see which kernel version you are running (probably the latest one), then (once you have a bare minimum of space free...) you can use your package management software to remove older versions.

For completeness you could also execute pvs and check what you have in the "PFree" column. That is very probably 0, but if you have some other value it means you have unused space available that you could maybe assign to your / filesystem -- except that it is /dev/dm-1 and not something like /dev/mapper/enterprise--vg-root, which makes me think it might be a little more complicated than just an lvextend and a resize2fs.

1
  • /dev/mapper/ just contains symlinks to /dev/dm-* usually, so this is probably just an odd mtab entry. (In particular if the system still uses a static mtab instead of letting the kernel manage it, that tends to happen. The kernel itself would probably show /dev/dm* for all volumes.)
    – user1686
    Mar 14, 2016 at 0:12
-3

Make sure to check /boot directory to see if there are files which are useless. I had compiled Linux kernel on my dev machine and my /boot occupies a lot of space.

1
  • 1
    You can clearly see /boot is only 33M in the df output. May 2, 2017 at 7:04

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.