8

I have run into this problem two days ago. The OS warns me that root has limited
disk space; however this should not be the case since I have 3 separate logical partitions for Ubuntu. Also it allows me to click the button examine, but I am not able to locate the problem that way? What can I do and what is the remedy? Inform me if further information is required.

Thanks for your assistance

Can I somehow include /usr directory in another mount point or the partition for the home folder without risking losing my data?

The culprit seems to be the /usr directory. The problem occurred after a full TexLive LaTeX installation. The output of lsblk is as follows: enter image description here

8

You can use the "Disk Usage Analyser" to see what is using all of your drive space.

  1. Open "Disk Usage Analyser" by searching for it in the Dash.
  2. Click on your root (/) drive.
  3. Wait for the graph at the right to stop displaying loading dots (it may take a while).
  4. You can now review which files are taking up the most space (You can just close the 'Permission denied' error if it appears).
  5. Hover your mouse over a sector to get the name of that folder and its size.

To delete the largest files/folders

After performing the above steps and with the file path to a larger file/folder which you want to delete, you can do the following:

  • Only if the file is in your Home directory, you could just move it to an external hard drive (or delete it altogether if it's unimportant)
  • If the file is not in your Home folder, you can take a guess at which package it belongs to and try apt-get uninstall to remove that package (if you don't need it)
  • Anything else, please edit your question with the path to the file/folder which you'd like to delete. You should not randomly delete files which are not in your Home folder.

Mounting a separate partition on /usr

This would be my suggestion. Use the following instructions:

  1. Install GParted using this command in a terminal:

    sudo apt-get install gparted
    
  2. Open GParted by searching for it in the dash.
  3. Locate a large partition (>100GB, I'd suggest sda5) of which is mostly unused (<50% used)
  4. Shrink this partition by 10GB (or 10000MB)
  5. Create a new logical ext4 partition taking up all of the free space.
  6. Open a root Nautilus window (be careful with this)

    sudo -H nautilus
    
  7. Copy the contents of the /usr folder (contents, not the folder itself) into the root of your new ext4 partition created above.
  8. Execute this command in a terminal, replacing /dev/sda1 with the partition identifier of your new partition created above:

    sudo blkid | grep '/dev/sda1' | grep -Po 'UUID="[^"]+"'
    
    • Copy the complete output of this command (should be similar to this: UUID="X7X2X1X3-X573-4929-97XX-XX1514X31X7X")
  9. Open the /etc/fstab file with this command:

    sudo -H gedit /etc/fstab
    
  10. Paste in it the following on it's own line, substituting your copied text in where necessary:

    <PASTE_HERE>    /usr    ext4    errors=remount-ro 0       1
    
  11. Reboot

The below steps are optional, but will delete redundant copies of the /usr folder still on your original / drive, freeing up space.

  1. Boot into a LiveCD/USB.
  2. Mount your original / drive in Nautilus, and take a note of where it's mounted to.
  3. Open a root Nautilus window (be careful with this)

    sudo -H nautilus
    
  4. Navigate to your original / drive (which you noted above)
  5. Delete the contents of the /usr folder, not the folder itself but everything inside it.
  6. Reboot.

Replies

Can the files outside the home directory not be copied to an external drive?

No, they can not. You should not manually delete (or move away) any files outside of your Home folder unless you (you yourself, not apt-get or similar) put them there.

Is having two mount point at the same logical partition possible?

No, that is not possible.

| improve this answer | |
  • Okay I found the problem, but how can I transfer the file to another partition or change the mount partition, are these possible ? – Vesnog Oct 18 '13 at 12:09
  • Well I appreciate your effort. Some questions arose in my mind: Can the files outside the home directory not be copied to an external drive? I do not want to delete the folder since they are necessary, so I should reformat my partitions or change my mount point maybe. Is having two mount point at the same logical partition possible? /usr is the largest path inside the root directory. – Vesnog Oct 19 '13 at 12:53
  • @Vesnog edited answer to reply to your questions and more steps which will hopefully free up some space on / – kiri Oct 19 '13 at 23:24
  • Okay many thanks I have sized up my root partition by moving the home partition further along the HDD, I had to wait for some time but everything works as expected now. – Vesnog Oct 20 '13 at 4:28
  • @Vesnog good to see that it worked out for you. – kiri Oct 20 '13 at 4:30
1

The root file system is located under /.

The message you are receiving tells you that the disk partition that is mounted on the root file system (/) has 533.9MB available. However, this does not include the other two partitions.

You can see more information about the partitions and their mount points by typing lsblk.

| improve this answer | |
  • Well thanks. The output shows that I have 14 GB allocated to root filesystem and 35 GB allocated to the home directory. – Vesnog Oct 18 '13 at 11:33
  • @Vesnog Please edit your original question to provide this information instead of putting it in a comment. – kiri Oct 18 '13 at 11:35
  • Yeah, your root partition is 14G in size. You can check the disk usage in System Monitor. – errikos Oct 18 '13 at 11:38
  • @minerz029 I have done as you told sorry for the previous edit. – Vesnog Oct 18 '13 at 11:46
1

To free up some space you may want to clean /var/log

I had once a error loop in a php app, and the apache log folder had a few GB.

| improve this answer | |
  • /var/log is not the culprit it is only 7.1 MB in size – Vesnog Oct 18 '13 at 11:49
1

Boot the live cd and run gparted. Shrink your home partition to free up some space at the end, then copy the swap partition there, and delete the original swap partition, then expand your root partition into that free space.

| improve this answer | |
  • Sounds like risky business? I have most of my data backed up, but anyways. By the way can I do the same operation while the system is running or can I define two mount points on the same logical partition? – Vesnog Oct 18 '13 at 16:25
  • No, you can't do it while the system is running, hence why you have to boot from the livecd. The risk involved in doing it the way I suggested, which involves no moving of the start of the partition, is minimal. – psusi Oct 18 '13 at 17:00
1

I've faced the same problem and when i run df -h

I found that /boot using 100% of it's space and that mainly because of i didn't remove old kernel versions!

To know your current Kernel version run uname -r and to check all installed kernel versions run dpkg --list 'linux-image*'

i have found a lot of kernel versions installed and that's why there was no space in my /boot directory! and thus i can't even install new updates from Software Updater.

You can remove kernel versions run sudo apt-get remove linux-image-VERSION

But By careful not to remove your current kernel version.

You can also Install Ubuntu Tweak and using it you can remove all your old kernel versions.

To install Ubuntu Tweak you can run the following commands:

sudo add-apt-repository ppa:tualatrix/ppa

sudo apt-get update

sudo apt-get install ubuntu-tweak

To Open it simply type: ubuntu-tweak or ubuntu-tweak -f janitor To open janitor tab directly.

Here's all "askubuntu" pages that help you to do this ;) my thread.

What is the safest way to clean up /boot partition?

Is it safe to remove old kernels after installing the latest mainline?

How to run Ubuntu Tweak's janitor automatically?

This solution works with me :D

| improve this answer | |
  • @CharlesGreen Thanks a lot for this valuable note. – Abdallah Okasha May 23 '17 at 15:01
  • Thank you very much for including the relevant portions of the answer – Charles Green May 23 '17 at 15:17

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.