Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:general_admin:free_your_space [2012/12/28 17:31 (UTC)] hazel [/tmp directory] |
howtos:general_admin:free_your_space [2017/05/26 10:22 (UTC)] (current) alienbob [/tmp directory] Fix the scriptlet example. |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <!-- Reviewed 2012-01-09 mfillpot --> | ||
+ | <!-- Reviewed 2012-12-28 hazel --> | ||
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
====== Free your space ====== | ====== Free your space ====== | ||
- | + | Sometimes you can find yourself in a situation where you are suddenly faced | |
- | Sometimes you can find yourself in a situation where you are suddenly faced with a message telling you that there’s no more free space on your system. There might be a few things you can do to free some of it. | + | with a message telling you that there’s no more free space on your system. |
+ | There might be a few things you can do to free some of it. | ||
==== /tmp directory ==== | ==== /tmp directory ==== | ||
- | The first reason can be a /tmp directory which doesn’t get cleaned automatically. I create my own temporary files in my home directory so I can safely delete the contents of /tmp every time I shut down the system. You don’t have to do it manually, though. | + | The first reason can be a /tmp directory which doesn’t get cleaned |
+ | automatically. I create my own temporary files in my home directory so I | ||
+ | can safely delete the contents of /tmp every time I shut down the system. | ||
+ | You don’t have to do it manually, though. | ||
The following command should be placed in ''/ | The following command should be placed in ''/ | ||
- | <code>/ | + | <file bash / |
+ | / | ||
+ | </file> | ||
- | This will delete ALL the files in the /tmp directory every time the system | + | This will delete ALL the files in the /tmp directory every time the system |
- | down, so be careful what you put there! | + | shuts down, so be careful what you put there! |
- | The '' | + | The '' |
+ | need to perform any other tasks on shutdown, you can put them here. As | ||
+ | this file doesn’t exist on the default installation of Slackware, you | ||
+ | need to create it first and make it executable: | ||
- | < | + | < |
- | # chmod +x / | + | root@darkstar# touch / |
+ | root@darkstar# chmod +x / | ||
+ | </ | ||
- | < | + | < |
+ | Remember to test your commands well before you include them in the | ||
+ | shutdown file. | ||
+ | </ | ||
- | Alternatively, | + | Alternatively, |
+ | tmpfs by adding the following to ''/ | ||
- | <code> | + | <file - / |
+ | tmpfs / | ||
+ | </file> | ||
- | You can restrict the size of ''/ | + | You can restrict the size of ''/ |
+ | to avoid running out of memory. | ||
- | There is also a more prudent way of cleaning up your tmp directory; this method consists of allowing the temporary files to exist for more than the amount of time between startup and shutdown. The following script selects files which haven' | + | There is also a more prudent way of cleaning up your tmp directory; |
+ | this method consists of allowing the temporary files to exist for | ||
+ | more than the amount of time between startup and shutdown. The | ||
+ | following script selects files which haven' | ||
+ | certain amount of time and doesn' | ||
+ | decide to run this script using cron on a regular basis. | ||
- | < | + | < |
#!/bin/sh | #!/bin/sh | ||
# Cleanup /tmp however, do not remove sockets for X | # Cleanup /tmp however, do not remove sockets for X | ||
Line 36: | Line 62: | ||
find /tmp -type s -exec /bin/touch {} \; | find /tmp -type s -exec /bin/touch {} \; | ||
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \; | find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \; | ||
- | find /tmp -type f -mtime +37 -exec rm -rf {} | + | find /tmp -type f -mtime +37 -exec rm -rf {} \; |
</ | </ | ||
- | < | + | < |
+ | Again, please test scripts very carefully before deploying them on | ||
+ | your system. As always: your mileage may vary. | ||
+ | </ | ||
==== sbopkg ==== | ==== sbopkg ==== | ||
- | + | < | |
- | If you have been using [[http:// | + | root@darkstar# sbopkg -o |
- | + | ||
- | < | + | |
[ Checking for obsolete sources ] | [ Checking for obsolete sources ] | ||
This may take a few moments. Press <ESC> to abort. | This may take a few moments. Press <ESC> to abort. | ||
100%[====================================================] | 100%[====================================================] | ||
- | It appears there are no obsolete sources in / | + | It appears there are no obsolete sources in / |
+ | </ | ||
- | If you do not need the sources of packages installed via '' | + | If you do not need the sources of packages installed via '' |
+ | you may also want to clean the whole '' | ||
+ | in '' | ||
==== Finding files/ | ==== Finding files/ | ||
+ | It’s also good practice to find directories/ | ||
+ | space. The following command will display 20 largest files/ | ||
+ | in a specified place (in this example Fred's home directory): | ||
+ | <code bash find_largest.sh> | ||
+ | du -a /home/fred/ | sort -n -r | head -n 20 | ||
+ | </ | ||
- | It’s also good practice | + | You can go through the list and decide whether you want to delete any of |
- | + | them. | |
- | < | + | |
- | You can go through the list and decide whether you want to delete | + | A quicker approach might be to use |
+ | [[http:// | ||
+ | ncurses frontend. Not only does it display directories in your chosen | ||
+ | order (ascending/ | ||
+ | interactively browse (and **be careful: | ||
+ | < | ||
+ | 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. | ||
+ | </ | ||
- | A quicker approach might be to use [[http:// | + | Apart from ordering the files/ |
- | < | + | a number of interesting display options like showing percentage or graph, |
+ | showing/ | ||
+ | certain directories or files if you want.) | ||
- | Apart from ordering the files/ | + | Although it is not part of the stock Slackware, it can be easily installed |
- | + | from [[http:// | |
- | Although it is not part of the stock Slackware, it can be easily installed from [[http:// | + | (it does not have any additional dependencies.) |
==== Remove unnecessary programs ==== | ==== 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 [[http:// | ||
+ | longer use. You can remove 3rd party programs using the following command: | ||
- | 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 | + | < |
- | + | root@darkstar# | |
- | < | + | </ |
+ | This will list all 3rd party packages and let you select the ones you want | ||
+ | to remove. In order for an application | ||
+ | it must have been built and installed | ||
+ | [[http://docs.slackware.com/ | ||
+ | SlackBuild]]. Otherwise, it will not be part of the Slackware package | ||
+ | management | ||
- | 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 '' | + | If there' |
- | + | [[http:// | |
- | If there' | + | the excellent [[http:// |
===== Disk Cleanup Utilities ===== | ===== Disk Cleanup Utilities ===== | ||
- | + | Here are a list of disk cleanup utilities you might find useful to remove | |
- | Here are a list of disk cleanup utilities you might find useful to remove unnecessary or temporary files from your system. | + | unnecessary or temporary files from your system. |
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | |||
====== Sources ====== | ====== Sources ====== | ||
* Originally written by [[wiki: | * Originally written by [[wiki: |