Free space on /

5 respostas [Última entrada]
kesavan
Desconectado
Joined: 12/16/2013

I'm facing very low disk space in the system under / (root).I frequently clean using the below tips , but still not enough.

################# Disk Cleaning Tips ####################
du -khs /var/* | sort -nr | head # top 10 var files
du -khs /var/cache/* | sort -nr | head # top 10 cache files
sudo apt-get clean # clean downloaded packages
sudo apt-get autoclean # remove stored archives in cache
sudo apt-get autoremove # auto remove unnecessary packages
find /var/log/* -maxdepth 1 -type f -size +1M -exec ls -lhS {} \; | awk '{ print $5,"",$9 }'|sort -nr | head -10 # list top 10 log files

Here's my disk usage:

kesavan@kesavan-Ideapad-Z460:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 3.8G 3.6G 52M 99% /
udev 1.5G 4.0K 1.5G 1% /dev
tmpfs 578M 1.1M 577M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.5G 344K 1.5G 1% /run/shm
/dev/sda9 7.5G 6.4G 1.1G 86% /home
/dev/sda1 344G 324G 2.0G 100% /media/DATA
/dev/sda2 20G 16G 2.8G 85% /media/11ea96ae-e372-4cd9-baa4-3f07008d0c6f
/dev/sda6 82G 71G 6.7G 92% /media/bfbc93c8-62db-4b3e-9cce-a01860d098f2

Is there something I can pull out from /usr? Seems nearly 1.3GB on /usr/share. Can I purge something out of that?

kesavan@kesavan-Ideapad-Z460:~$ sudo du -k --max-depth=1 /usr/* | sort -nr| cut -f2 | xargs -d '\n' du -khs
1.3G /usr/lib
998M /usr/share
193M /usr/src
121M /usr/bin
26M /usr/sbin
11M /usr/include
800K /usr/games
164K /usr/local

Any other tips to free more space?

!!!Freedom Matters!!!

Thanks,
Kesavan Muthuvel

AnexoTamaño
low-space2.png88.66 KB
lembas
Desconectado
Joined: 05/13/2010

If I was you, I'd first go get an external disk and make a backup of the whole thing. I never heard of a guy who regretted he had backups! Of course, you already might have a backup.

After that, I'd shrink another ext4 partition with more free space and then grow /. You can do so using e.g.

http://gparted.org/livecd.php

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

Older kernels (images and, maybe, headers) are not automatically removed and take quite some space. You can remove them from the package manager (search "linux-").

But 3.8 GB is not much and the long-term solution would be to extend the / partition from a Live CD (Trisquel's, for instance, has GParted). However, if you kept Trisquel's defaults, your /home is an XFS filesystem... and XFS filesystems cannot be shrunk. So you would need to backup the content of /home, remove its partition, extend that of / and repopulate /home from the backup.

lembas
Desconectado
Joined: 05/13/2010

>sudo apt-get clean # clean downloaded packages
>sudo apt-get autoclean # remove stored archives in cache
>sudo apt-get autoremove # auto remove unnecessary packages

apt-get doesn't incredibly enough have a man page but

$ apt-get --help|grep -E 'clean|autoremove'
autoremove - Remove automatically all unused packages
clean - Erase downloaded archive files
autoclean - Erase old downloaded archive files

(if this was a small disk, then also localepurge might come handy, read its caveats though)

onpon4
Desconectado
Joined: 05/30/2012

Note, though, that this doesn't clean up old kernel images. Those need to be removed manually.

kesavan
Desconectado
Joined: 12/16/2013

Everyone, Thanks for the suggestions.As long term pla, I wish to extend the size of the / prtition.

Let me try with GParted and come back with the outcome.

!!! Freedom Matters !!!

Thanks,
Kesavan Muthuvel
kesavan.info