1

I am struggling against disk space, regarding root location.

Seems like I have reach 100% usage, and cannot find a way to regain space.

I have used apg-get autoremove, apt-get clean, removed old linux-images and it had no effect what so ever in root folder.

Can't even install or update the system because I am constantly receiving this message:

You don't have enough free space in /var/cache/apt/archives

After search about the subject, I didn't found any solution that could solve the issue.

Anyone knows how can I solve this?

NOTE: I have removed libreoffice to gain more space, and looking through Disks GUI, I notice that I had 626MB free, but still when I try to upgrade this system I get the message "You don't have enough free space in /var/cache/apt/archives" and it just needs 465 MB of archives and after installation it will only use 94MB.

  • 2
    Could you include the results of lsblk to give people a better idea of your partition scheme. Are you using LVM? – kemotep Jun 14 at 22:08
  • Ofcourse: prntscr.com/o2192r and yes with RAID 1 – SipriusPT Jun 14 at 22:09
  • Could you please make the pictures of text, text? Pictures are not search engine addressable and in the various formats that this site can be rendered in can be pretty hard to read. Having the text be text allows people to copy and paste and more easily be directed to this post in the event they also have this issue or know a solution. Lastly, links to 3rd party sites can go down or be otherwise unavailable. This will make your question and the potential answer useless in the future if this is the case. Check out the Help Center for more information. – kemotep Jun 14 at 22:17
  • 1
    I know that pretty well but I can only access that machine through HP ILO, where copy paste is not possible. SSH and other forms of remote desktops with copy paste capabilities are also not possible. With an OCR engine it doesnt convert text properly. =/ – SipriusPT Jun 14 at 22:24
  • 1
    I would save the output to a file, and copy that file over if possible. I apologize, I assumed this was a desktop you were having issues with because of the custom shell prompt. – kemotep Jun 14 at 22:34
1

Looking at your overall disk usage (1.4TB in /media) and assuming you have installed Linux to a single partition, the easiest immediate fix seems to be to boot (into a live distro if necessary) and free up space by moving some media files to an external drive. This should allow you to boot and install any packages you need to get on with using your system.

Once you are up and running then you need to figure out where the space is being used and what to do with the space consuming files. While df and du are good diagnostic tools, you may get a better feel for what is eating your disk using Filelight.

The longer term solution would be to re-partition your system so that / has enough space to function and your 'non-essential' files (in /media and /home) cannot predate on the disk space required to operate the system. FYI, my own partition schema is

lsblk
NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                8:0    0 931.5G  0 disk 
└─sda1             8:1    0 931.5G  0 part /home/bu5hman/Work
sdb                8:16   0 978.1G  0 disk 
├─sdb1             8:17   0   260M  0 part /boot/efi
└─sdb2             8:18   0 977.9G  0 part 
  ├─vtb-Root     254:0    0    50G  0 lvm  /
  ├─vtb-Home     254:1    0   200G  0 lvm  /home
  ├─vtb-Play     254:2    0   300G  0 lvm  /home/bu5hman/Play
  ├─vtb-Swap     254:3    0     4G  0 lvm  [SWAP]
  ├─vtb-WinVm    254:4    0   100G  0 lvm  /home/bu5hman/.WinVm
  └─vtb-WinShare 254:5    0   100G  0 lvm  /home/bu5hman/Work/WinShare

Even if Work, Play or even my .WinVM fill their own partitions to the point of giving an out of space error within their own partition this will not affect the space available to the operating system in /

  • Finally I have found the source of the problem, one backup that I had, created a new folder at /media, when the external disk that I have for backups was not connected properly in the system so it was not mounted at the time of backup, so I had like 13GB on it! I will give you the right answer, since it was because of your first statement that I have measure each folder there. – SipriusPT Jun 16 at 20:30
  • and because that if I have made it I would fix the issue. – SipriusPT Jun 16 at 20:40
  • Thx, though I would really encourage you to put `\` on its own partition. You would be safe from any repetition of the out of space error. – bu5hman Jun 17 at 5:59
2

You can use find to identify the largest files on the root volume, then delete any unnecessary ones. However, it looks like you have most of the system folders on the root volume (/var, /var/log, /tmp, etc.)

If this is true, and if you have a lot of log files, clearing some may help...it all depends on how verbose your logging is, how old the system is, and how much activity actually gets logged.

To find large files only on the root partition, execute the following:

# find / -xdev -size +1000M

This command will search the volume /, but will not cross over to other filesystems (-xdev). It will list any file with a size greater than 1000MB (1024MB? Depends on how your system utilities refer to M, MiB, Mb, etc.) You can use various other values to narrow down the search for large files... +100M for ~100MB files, etc.

You can also surgically review each subdirectory level with:

# du / -hx --max-depth=1

(that x is very important...) This at least helps you narrow down where the most disk space is being used, if not the actual culprits.

Here is a decent article on the basics of keeping a filesystem clean.

  • 2
    Thanks for the answer, didnt knew the -xdev argument for find. But the only file that I have above 50M its just chrome. Also at /var/log I just have 45M. And in /tmp there is only 64K. The root directory with user folders(desktop, documents, etc...) doenst have any file there. I really dont know where is being wasted so many GBs of space. This system has almost 2 years, and its a 24/7 powerup machine, with default log verbose. – SipriusPT Jun 14 at 22:32
  • 1
    Updating my answer with a few other options to try. – 0xSheepdog Jun 14 at 22:53
  • After used du / -h --max-depth=1: 9.7M /bin, 36M /boot, 0 /daily_lock, 0 /dev, 9.4M /etc, 796G /home, 268M /lib, 4K /lib64, 16K /lost+found, 1.4T /media, 12K /mnt, 178M /opt, 0 /proc, 19M /root, 18M /run, 13M /sbin, 4K /srv, 0 /sys, 64K /tmp, 4.6G /usr, 293M /var, 2.2T total. Cannot figure out even where at least 50% of those 18G are... – SipriusPT Jun 15 at 12:28
  • I updated my answer. That original du command isn't going to give you the results you want. It doesn't recurse into subdirectories. Run it and compare the output to df -hT... – 0xSheepdog Jun 26 at 17:10

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.