The volume "filesystem root" has only 0 bytes disk space remaining?

51,700

Solution 1

This is almost certainly due to being actually out of space on the root filesystem. If you have lots of free space on your drive, then you likely have a separate filesystem for your user data. This is a common setup.

To find the amount of free space on all your partitions, run the "disk free" command, df. You do not need to be root. You'll get something like the following:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              9614116   8382396   1134048  89% /
none                   1541244       284   1540960   1% /dev
none                   1546180      4804   1541376   1% /dev/shm
none                   1546180       372   1545808   1% /var/run
none                   1546180         0   1546180   0% /var/lock
none                   1546180         0   1546180   0% /lib/init/rw
none                   9614116   8382396   1134048  89% /var/lib/ureadahead/debugfs
/dev/sda3             32218292  12333212  19885080  39% /home

As you can see, I have a separate root filesystem (the first one listed) and user data filesystem (the last one listed), and my root partition is pretty close to full. If your df output shows you that your root filesystem is actually full, you need to delete some files (careful which ones!), or resize your partitions.

A useful terminal command for finding what's eating up all the space is the "disk usage" command, du. Invoked without any parameters, it starts listing the sizes of every file in the current directory, and in every directory below. More useful for tracking down usage is in your scenario is sudo du -s -h -x /*, which will give you the total amount of space used (-s) by each file or directory at the top of your root filesystem (/*), without looking at other filesystems (-x), in human-readable numbers like "124M" (-h). Don't worry if it takes a while to complete, it will take on the order of minutes the first run through.

Don't delete files without first knowing what they are, of course. But, in general, you won't break your system if you delete files in the following directories:

  • /tmp (user temp data -- these are commonly all deleted every reboot anyway)
  • /var/tmp (print spools, and other system temporary data)
  • /var/cache/* (this one can be dangerous, research first!)
  • /root (the root user's home directory)

In addition to the locations above, the following locations are common culprits:

  • /opt (many third-party apps install here, and don't clean up after themselves)
  • /var/log (log files can eat up a lot of space if there are repetitive errors)

So, check those first. If it turns out that things look correct and your root partition is simply too small, you'll need to resize your partitions to fit. There are a myriad of ways to do that, but likely the easiest is to boot from an Ubuntu LiveCD (get it from the Ubuntu site's download page) and run the GNOME partition editor gparted. You may have to install the gparted package first (from within the LiveCD environment, run sudo apt-get install gparted or use the software center). In any case, it is a graphical utility that will allow you to right-click on the partition and select "resize".

N.B. -- do not have any operating systems hibernated as you resize partitions, or it will either not work, or do terrible things to your hibernated OS.

Solution 2

According to your df listing, you have plenty of free space on /. After you get one of these messages, check df again and if it still shows plenty of free space, check the output of dmesg for errors. It is possible that you are getting an error that is causing the filesystem to be remounted read only, and that might be confusing the free space notifier. From the livecd, you should open the disk utility and check the drive's SMART status to make sure it doesn't have any bad sectors or anything. Running the long self test might be a good idea too, and checking the filesystem after that.

Share:
51,700

Related videos on Youtube

radek
Author by

radek

Working with data, mainly in R, mainly on (spatial) population and health issues. Currently @ School of Earth and Environmental Sciences, The University of Queensland. Publications: Google Scholar

Updated on September 18, 2022

Comments

  • radek
    radek almost 2 years

    I installed 11.10 ~two weeks ago and run into some strange troubles recently.

    Installation was on brand new laptop with clear 160GB SSD. I opted for encrypting home directory. Apart from that I accepted defaults during the installation. There is no other OS on my laptop.

    I had circa 40GB in use when (for the third time) I got to see this very unpleasant window:

    enter image description here

    Twice situation was pretty bad and whole system slowed down considerably. After reboot I could not login to graphical interface (with an error message informing about insufficient space) and had to remove some files from command line first.

    Third time I still managed to quickly delete some files and it helped.

    My laptop is mainly work environment: so no torrents, games, just two movies. Only media filling space are ~20GB of pictures, and bunch of pdfs. Working mostly on PostgreSQL & PostGIS, GeoServer and QGIS recently.

    Although I had lots of opportunities to test and practice my backups I would be extremely grateful if somebody could point me to any potential solutions to this problem.

    My laptop has been bought just before I installed Ubuntu, and it came without OS. Could that be hardware issue?

    Or is the encrypted home causing me headaches?

    Thanks for help!


    Update 1: As suggested by @maniat1k, here is current output of fdisk -l:

    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
    
    
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1   312581807   156290903+  ee  GPT
    

    Update 2: As suggested by zanfur, output of df:

    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sda2            149802648  31411456 110781576  23% /
    udev                   1959764         4   1959760   1% /dev
    tmpfs                   788276       992    787284   1% /run
    none                      5120         0      5120   0% /run/lock
    none                   1970684      2716   1967968   1% /run/shm
    /dev/sda1                19363       129     19234   1% /boot/efi
    /home/rdk/.Private   149802648  31411456 110781576  23% /home/rdk
    

    And sudo parted -l:

    Model: ATA INTEL SSDSA2BW16 (scsi)
    Disk /dev/sda: 160GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name  Flags
     1      17.4kB  20.0MB  20.0MB  fat16              boot
     2      20.0MB  156GB   156GB   ext4
     3      156GB   160GB   4177MB
    

    Update 3:

    Yet another window with low memory message :/

    Working recently mostly on VirtualBox and using Remmina.

    Following this information I deleted virtually everything from my home directory. Rebooted. There was ~20GB in use after that [~10GB for VirtualBox disk image which I wanted to keep if possible]. Following SarveshLad comment I was trying to recover more space and running Bleachbit application when I got another error of low space on HD. Then the system froze. How on earth can my Ubuntu fill up HD with over 100GB within minutes?

    • Uri Herrera
      Uri Herrera over 12 years
      Have you actually checked if you still have remaining space in /
    • radek
      radek over 12 years
      @UriHerrera: There were definitely GBs of free space before odd behavior started. And after that I wasn't able to run anything constructive and had to reboot :/ I doubt if I manage to fill them so quickly.
    • Eliah Kagan
      Eliah Kagan over 12 years
      In Nautilus (the graphical file browser), or if you prefer from the command line, check what folders are big. In particular, see if anything outside of /home is big. You should report what you find by editing your question to include the new information. If you're using Nautilus for this and you cannot find where the space-consuming folders are, press Ctrl+H (or View > Show Hidden Files).
    • radek
      radek over 12 years
      @EliahKagan: Thanks. I removed biggest files from my home now. Pre-crash state of the drive was very close to image posted in my other question.
    • Jason Southwell
      Jason Southwell over 12 years
      Have you run a disk check (sudo e2fsck -f -a)?
    • radek
      radek over 12 years
      @RolandTaylor: Thanks. Haven't done that. On which device should I run e2fsck?
    • sarvesh.lad
      sarvesh.lad over 12 years
      may be its the thumbnails for your huge collection of pic and pdf taking up space .... just a observation
    • radek
      radek over 12 years
      @SarveshLad: Thanks. Is there any way to check/control that?
    • Jason Southwell
      Jason Southwell over 12 years
      @radek on which ever partition you have ubuntu installed.
    • maniat1k13
      maniat1k13 over 12 years
      @radek can U do us a favor and do fdisk -l on your terminal
    • user5950
      user5950 over 12 years
      @radek: I would boot from an USB-device an check the remaining disk space with Gparted. You could also use the Linux distribution Parted Magic (partedmagic.com) to have more tool to check the disk. I think you just gave to much space to your home partition and not enough to the root partition. It not trivial to change partition size now, because of the encrypted home, but with a life system you could backup the whole home partition to a different HDD and then delete it, enlarge root partition and create an new, smaller home partition afterwards...
    • sarvesh.lad
      sarvesh.lad over 12 years
      @radek download and install an app called bleachbit and run the root version ... its basically a CCleaner alternative to linux
    • radek
      radek over 12 years
      @RolandTaylor: e2fsck tells me WARNING!!! The filesystem is mounted. If you continue you ***WILL*** cause ***SEVERE*** filesystem damage. How can I do it without causing problems? As for partitions: I did a fresh installation on clean HD, using all space and accepting Ubuntu defaults. I do not have other OS on my laptop. I presume partition would be /dev/sda?
    • radek
      radek over 12 years
      @maniat1k: Thanks. Updated question with fdisk -l output.
    • radek
      radek over 12 years
      @user15533: For the sake of next installation: I accepted defaults when installing. What would be reasonable size for root to prevent such situations?
    • Jason Southwell
      Jason Southwell over 12 years
      @radek you have to run it from recovery mode or a livecd (my honest apologies, I assumed that you had enough knowledge of Ubuntu to know to do that)
    • zanfur
      zanfur over 12 years
      @radek: please give us the output of df and of sudo parted -l (that's "ell" as in the first letter of "list", not "one"). I suspect that you have a root partition that is too small, and lots of free space elsewhere.
  • Kangarooo
    Kangarooo over 12 years
    kangarooo@WindowsOsXUNR100403LTS:~$ sudo du -s -h -x /∗ [1] 5700 du: cannot access `/home/kangarooo/.gvfs': Permission denied lowast: command not found kangarooo@WindowsOsXUNR100403LTS:~$ 4.6G / ^C [1]+ Exit 1 sudo du -s -h -x /
  • Marcel Stimberg
    Marcel Stimberg over 12 years
    I replaced the "∗" with a "*", this is what it was intended to be, I think...
  • radek
    radek over 12 years
    Thanks. Few questions. Anything in particular I should be looking for in dmesg? How exactly can I check SMART status? And how to perform long self test?