[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

¡Esta es una revisión vieja del documento!


Traducción en pogreso. Victor

Libera tu espacio

A veces puede encontrarse en una situación en la que de repente se encuentra con un mensaje que le dice que no hay más espacio libre en su sistema. Puede haber algunas cosas que puedes hacer para liberar algo.

/tmp

La primera razón puede ser un directorio / tmp que no se limpie automáticamente. Creo mis propios archivos temporales en mi directorio de inicio para poder eliminar de forma segura el contenido de / tmp cada vez que apago el sistema. Sin embargo, no tienes que hacerlo manualmente. El siguiente comando se debe colocar en /etc/rc.d/rc.local_shutdown .

/etc/rc.d/rc.local_shutdown.append
/usr/bin/find /tmp -mindepth 1 -maxdepth 1 -exec /bin/rm -rf {} +;

Esto eliminará TODOS los archivos en el directorio / tmp cada vez que el sistema se apague, ¡así que tenga cuidado con lo que coloca allí! El archivo rc.local_shutdown también puede ser útil de otras maneras. Si necesita realizar otras tareas en el cierre, puede ponerlas aquí. Como este archivo no existe en la instalación predeterminada de Slackware, primero debe crearlo y hacerlo ejecutable:

root@darkstar# touch /etc/rc.d/rc.local_shutdown
root@darkstar# chmod +x /etc/rc.d/rc.local_shutdown
Recuerde probar sus comandos bien antes de incluirlos en el archivo shutdown.

Alternativamente, si tiene suficiente RAM, puede montar /tmp en tmpfs agregando lo siguiente a /etc/fstab .

/etc/fstab.append
tmpfs	/tmp		tmpfs	size=4G,nodev,nosuid	0	0

Puede restringir el tamaño de / tmp (máx. 4GB en el ejemplo anterior) para evitar quedarse sin memoria. También hay una forma más prudente de limpiar su directorio tmp; este método consiste en permitir que los archivos temporales existan por más tiempo que entre el inicio y el apagado. La siguiente secuencia de comandos selecciona archivos que no se han tocado para una una cierta cantidad de tiempo y no elimina los sockets para X. Uno podría decidir ejecutar esta secuencia de comandos con cron de forma regular.

cleanstale.sh
#!/bin/sh
# Cleanup /tmp however, do not remove sockets for X
 
# No lost+found with reiserfs
find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \;
find /tmp -type f -mtime +37 -exec rm -rf {} \;
De nuevo, pruebe los scripts con mucho cuidado antes de implementarlos en su sistema.

sbopkg

root@darkstar# sbopkg -o
[ Checking for obsolete sources ]
This may take a few moments. Press <ESC> to abort.
100%[====================================================]
It appears there are no obsolete sources in /var/cache/sbopkg.

Si no necesita las fuentes de los paquetes instalados a través de sbopkg , es posible que también desee limpiar todo el caché sbopkg . Puedes hacerlo en el menú de utilidades de sbopkg .

Finding files/directories taking up most space

It’s also good practice to find directories/files that take up most space. The following command will display 20 largest files/directories in a specified place (in this example Fred's home directory):

find_largest.sh
du -a /home/fred/ | sort -n -r | head -n 20

You can go through the list and decide whether you want to delete any of them.

A quicker approach might be to use ncdu, du's ncurses frontend. Not only does it display directories in your chosen order (ascending/descending, by size/name), but also lets you interactively browse (and be careful: delete) them.

To make sure you don’t delete something by accident, you can run the program in the read-only mode calling it with the -r flag.

Apart from ordering the files/directories by size or name, there are also a number of interesting display options like showing percentage or graph, showing/hiding hidden or excluded files and directories (you can exclude certain directories or files if you want.)

Although it is not part of the stock Slackware, it can be easily installed from SlackBuilds.org (it does not have any additional dependencies.)

Remove unnecessary programs

Another way of freeing some space is by uninstalling the apps that you no longer need. If you don’t know what you are doing, it is NOT recommended to uninstall anything from the Slackware’s default installation. You might break some parts of the system . A safer approach would be to uninstall some 3rd party applications. Long time ago you may have installed some applications from SlackBuilds that you no longer use. You can remove 3rd party programs using the following command:

root@darkstar# slackpkg clean-system

This will list all 3rd party packages and let you select the ones you want to remove. In order for an application to be included in slackpkg list it must have been built and installed the Slackware way, ie. by using a SlackBuild. Otherwise, it will not be part of the Slackware package management system.

If there's no SlackBuild for a program you want to install, try to create one or use the excellent src2pkg tool.

Disk Cleanup Utilities

Here are a list of disk cleanup utilities you might find useful to remove unnecessary or temporary files from your system.

  • Sweeper - A KDE disk cleanup application.
  • BleachBit - BleachBit quickly frees disk space and tirelessly guards your privacy. Free cache, delete cookies, clear Internet history, shred temporary files, delete logs, and discard junk you didn't know was there. A Slackbuild is available at SlackBuilds.org.

Sources

  • Originally written by sycamorex
  • Based on sycamorex's blog article here
  • Additional inputs by Harishankar (Disk Cleanup Utilities section)
  • Contrbutions by cpt (cleanup script), original script has been copied from a mail-list, cpt does explicitly not claim to be the original author of this script.

 es:howtos:general_admin:free_your_space ()