This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
general:disk-space-management [2017/07/07 10:55] mscherf revisions for #155 |
general:disk-space-management [2020/06/01 15:28] (current) Karson N. |
||
---|---|---|---|
Line 3: | Line 3: | ||
It is important to make sure that the server does not fully run out of disk space. If it does, the services running in the server will quit working, and some of the database tables could even become corrupted. Here are some things to consider, to help ensure that your server has enough disk space to work correctly. | It is important to make sure that the server does not fully run out of disk space. If it does, the services running in the server will quit working, and some of the database tables could even become corrupted. Here are some things to consider, to help ensure that your server has enough disk space to work correctly. | ||
+ | \\ | ||
===== Backups ===== | ===== Backups ===== | ||
- | Although backups do themselves take disk space, it is still very important to have them. To protect against data loss, it is always strongly recommended not only to keep multiple sets of backups, but also to keep copies of at least some of them in an offsite location. Although we do create our own [[vps-hosting: | + | Although backups do themselves take disk space, it is still very important to have them. To protect against data loss, it is always strongly recommended not only to keep multiple sets of backups, but also to keep copies of at least some of them in an offsite location. Although we do create our own |
+ | [[vps-hosting: | ||
+ | there are multiple reasons it is important not only for you to create your own backups as well, but also to keep at least one of the copies offsite. | ||
- | For cPanel/WHM servers, you can read more about how to configure automatic backups and some of our recommendations for them [[control-panels: | + | For cPanel/WHM servers, you can read more about how to configure automatic backups and some of our recommendations for them [[control-panels: |
+ | For manually triggering backups at the time you want them via cPanel, you can read more | ||
+ | ((https:// | ||
+ | [[https:// | ||
+ | For DirectAdmin servers, you can configure backups from | ||
+ | ((https:// | ||
+ | [[https:// | ||
+ | and it is possible to | ||
+ | ((https:// | ||
+ | [[https:// | ||
+ | For servers still using Plesk, (Plesk is no longer available for new servers) you can learn more about the backup system | ||
+ | ((http:// | ||
+ | [[http:// | ||
<WRAP important> | <WRAP important> | ||
Line 22: | Line 37: | ||
* How long ago you want to be able to revert accounts to | * How long ago you want to be able to revert accounts to | ||
- | For more specific recommendations, | + | For more specific recommendations, |
+ | [[control-panels: | ||
+ | \\ | ||
===== Account Quotas ===== | ===== Account Quotas ===== | ||
- | One way to help prevent the server from running out of disk space is by using account quotas to limit how much disk space each account is allowed to use. In cPanel, the quota for a specific account can be adjusted in WHM at '' | + | One way to help prevent the server from running out of disk space is by using account quotas to limit how much disk space each account is allowed to use. In cPanel, the quota for a specific account can be adjusted in WHM at |
+ | < | ||
+ | | ||
+ | </ | ||
+ | |||
+ | by clicking the plus (+) button next to the desired account, clicking the " | ||
It is strongly recommended to have a quota on each account, and for the sum of the account quotas to be enough less than the total size of the server to leave room for the system files. | It is strongly recommended to have a quota on each account, and for the sum of the account quotas to be enough less than the total size of the server to leave room for the system files. | ||
- | It is important to note that with default settings, database sizes are not calculated. This setting is chosen as default for performance reasons, since there is considerable overhead with calculating database sizes. For this reason, the database sizes are by default displayed as zero, and do not count against the accounts' | + | It is important to note that with default settings, database sizes are not calculated. This setting is chosen as default for performance reasons, since there is considerable overhead with calculating database sizes. For this reason, the database sizes are by default displayed as zero, and do not count against the accounts' |
+ | < | ||
+ | | ||
+ | </ | ||
+ | |||
+ | But remember that this is likely to slow down the server, so you will need to decide for your server how likely it is for database disk space usage to become a problem vs. database disk space calculation to cause a problem with server load, or which issue you would rather risk happening. | ||
It is also important to note that (in a cPanel server) files owned by " | It is also important to note that (in a cPanel server) files owned by " | ||
+ | \\ | ||
===== Monitoring and Troubleshooting ===== | ===== Monitoring and Troubleshooting ===== | ||
- | It is strongly recommended to keep an eye on how much disk space the server is using, to help ensure it does not completely fill up its disk. On a cPanel server, it is strongly recommended to enable all of the following settings in WHM at '' | + | It is strongly recommended to keep an eye on how much disk space the server is using, to help ensure it does not completely fill up its disk. On a cPanel server, it is strongly recommended to enable all of the following settings in WHM at |
+ | < | ||
+ | | ||
+ | </ | ||
+ | |||
+ | in the section " | ||
* System disk space usage warnings | * System disk space usage warnings | ||
Line 59: | Line 92: | ||
If more disk space is being used than expected, it is recommended to check what is using the disk space. Where to check first will depend on how you find out about it. | If more disk space is being used than expected, it is recommended to check what is using the disk space. Where to check first will depend on how you find out about it. | ||
- | If the server has used up enough of its disk space overall that it is causing services (daemons) to be interrupted, | + | If the server has used up enough of its disk space overall that it is causing services (daemons) to be interrupted, |
+ | [[software: | ||
+ | If SSH is not working either, you can | ||
+ | [[my-knownhost: | ||
+ | for assistance | ||
+ | \\ | ||
==== Troubleshooting via SSH ==== | ==== Troubleshooting via SSH ==== | ||
{{howhard> | {{howhard> | ||
- | <WRAP important> | + | <WRAP important> |
- | If you are logged into ssh as root,((or if you have gotten a connection via the console)) | + | If you are logged into ssh as root, you can check the server' |
< | < | ||
- | root@host [~]# df -h / | + | |
- | Filesystem | + | Filesystem |
- | / | + | / |
</ | </ | ||
Line 80: | Line 118: | ||
< | < | ||
- | # df -h /backup | + | |
</ | </ | ||
Line 88: | Line 126: | ||
< | < | ||
- | root@host [~/ | + | |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 5.0G / | + | 5.0G |
- | 5.0G / | + | 5.0G |
- | 10G total | + | 10G |
</ | </ | ||
Line 112: | Line 150: | ||
< | < | ||
- | # repquota -as | + | |
</ | </ | ||
Line 118: | Line 156: | ||
< | < | ||
- | root@host [~]# repquota -as | head | + | |
- | *** Report for user quotas on device / | + | *** Report for user quotas on device / |
- | Block grace time: 00:00; Inode grace time: 00:00 | + | Block grace time: 00:00; Inode grace time: 00:00 |
Block limits | Block limits | ||
- | User used soft hard grace used soft hard grace | + | |
- | ---------------------------------------------------------------------- | + | ---------------------------------------------------------------------- |
- | root -- 29533M | + | root -- 29533M |
- | bin | + | bin |
- | daemon | + | daemon |
- | nobody | + | nobody |
- | mailnull | + | mailnull |
</ | </ | ||
Line 138: | Line 176: | ||
< | < | ||
- | root@host [~]# cd / | + | |
- | root@host [/ | + | root@host [/ |
- | 932K ./ | + | 932K |
- | 84K ./etc | + | 84K |
- | 8.0K ./ | + | 8.0K |
- | 4.0K ./ | + | 4.0K |
- | 12K ./ | + | 12K |
- | 20K ./ | + | 20K |
- | 4.0K ./ | + | 4.0K |
- | 8.0K ./ | + | 8.0K |
- | 63M ./ | + | 63M |
- | 636M ./ | + | 636M |
- | 8.5M ./ | + | 8.5M |
- | 2.2M ./ | + | 2.2M |
- | 62M ./tmp | + | 62M |
- | 24K ./ssl | + | 24K |
- | 580K ./ | + | 580K |
- | 80K ./ | + | 80K |
- | 8.0K ./ | + | 8.0K |
- | 8.0K ./ | + | 8.0K |
- | 630M ./ | + | 630M |
- | 4.0K ./ | + | 4.0K |
- | 100K ./ | + | 100K |
- | 1.4G . | + | 1.4G |
</ | </ | ||
Line 167: | Line 205: | ||
< | < | ||
- | root@host [/ | + | |
- | 100K ./ | + | 100K |
- | 580K ./ | + | 580K |
- | 932K ./ | + | 932K |
- | 2.2M ./ | + | 2.2M |
- | 8.5M ./ | + | 8.5M |
- | 62M ./tmp | + | 62M |
- | 63M ./ | + | 63M |
- | 630M ./ | + | 630M |
- | 636M ./ | + | 636M |
- | 1.4G . | + | 1.4G |
</ | </ | ||
Line 183: | Line 221: | ||
< | < | ||
- | root@host [/ | + | |
- | 932K ./ | + | 932K |
- | 4.0K ./ | + | 4.0K |
- | 84K ./etc | + | 84K |
- | 8.0K ./ | + | 8.0K |
- | 4.0K ./ | + | 4.0K |
- | 12K ./ | + | 12K |
- | 20K ./ | + | 20K |
- | 4.0K ./ | + | 4.0K |
- | 4.0K ./ | + | 4.0K |
- | 8.0K ./ | + | 8.0K |
- | 4.0K ./ | + | 4.0K |
- | 4.0K ./ | + | 4.0K |
- | 4.0K ./ | + | 4.0K |
- | 63M ./ | + | 63M |
- | 636M ./ | + | 636M |
- | 4.0K ./ | + | 4.0K |
- | 0 ./ | + | 0 |
- | 8.5M ./ | + | 8.5M |
- | 2.2M ./ | + | 2.2M |
- | 0 ./www | + | 0 |
- | 62M ./tmp | + | 62M |
- | 24K ./ssl | + | 24K |
- | 0 ./ | + | 0 |
- | 580K ./ | + | 580K |
- | 4.0K ./ | + | 4.0K |
- | 4.0K ./ | + | 4.0K |
- | 80K ./ | + | 80K |
- | 8.0K ./ | + | 8.0K |
- | 8.0K ./ | + | 8.0K |
- | 4.0K ./ | + | 4.0K |
- | 8.0K ./ | + | 8.0K |
- | 630M ./ | + | 630M |
- | 4.0K ./ | + | 4.0K |
- | 4.0K ./ | + | 4.0K |
- | 100K ./ | + | 100K |
- | 4.0K ./ | + | 4.0K |
- | 1.4G . | + | 1.4G |
</ | </ | ||
Line 226: | Line 264: | ||
< | < | ||
- | root@host [/ | + | |
- | 100K ./ | + | 100K |
- | 580K ./ | + | 580K |
- | 932K ./ | + | 932K |
- | 2.2M ./ | + | 2.2M |
- | 8.5M ./ | + | 8.5M |
- | 62M ./tmp | + | 62M |
- | 63M ./ | + | 63M |
- | 630M ./ | + | 630M |
- | 636M ./ | + | 636M |
- | 1.4G . | + | 1.4G |
</ | </ | ||
Line 244: | Line 282: | ||
< | < | ||
- | root@host [/ | + | |
- | -rw-r--r-- 1 root root 1.0G Jul 31 10:38 temp | + | -rw-r--r-- 1 root root 1.0G Jul 31 10:38 temp |
</ | </ | ||
Line 251: | Line 289: | ||
< | < | ||
- | root@host [/ | + | |
- | 100K ./ | + | 100K |
- | 580K ./ | + | 580K |
- | 932K ./ | + | 932K |
- | 2.2M ./ | + | 2.2M |
- | 8.5M ./ | + | 8.5M |
- | 63M ./tmp | + | 63M |
- | 65M ./ | + | 65M |
- | 634M ./ | + | 634M |
- | 637M ./ | + | 637M |
- | 2.4G . | + | 2.4G |
</ | </ | ||
Line 267: | Line 305: | ||
< | < | ||
- | root@host [/ | + | |
- | 580K ./ | + | 580K |
- | 932K ./ | + | 932K |
- | 2.2M ./ | + | 2.2M |
- | 8.5M ./ | + | 8.5M |
- | 63M ./tmp | + | 63M |
- | 65M ./ | + | 65M |
- | 634M ./ | + | 634M |
- | 637M ./ | + | 637M |
- | 1.1G ./ | + | 1.1G |
- | 2.4G . | + | 2.4G |
</ | </ | ||
+ | \\ | ||
==== Troubleshooting via cPanel/WHM ==== | ==== Troubleshooting via cPanel/WHM ==== | ||
Line 286: | Line 325: | ||
<WRAP info> This section assumes a cPanel server. If your server uses DirectAdmin or Plesk, you will need to instead use the equivalent functions in your panel. </ | <WRAP info> This section assumes a cPanel server. If your server uses DirectAdmin or Plesk, you will need to instead use the equivalent functions in your panel. </ | ||
- | If you are able to still log into WHM and cPanel, you can use the " | + | If you are able to still log into WHM and cPanel, you can use the |
+ | ((https:// | ||
+ | " | ||
+ | interface in WHM at | ||
+ | < | ||
+ | | ||
+ | </ | ||
+ | |||
+ | to see how much space each account is currently taking. You can even sort the accounts by disk space usage by clicking the title of the "Disk Used" column. Note that if databases are not being included in quota calculations, | ||
- | If there is an account in particular you would like to investigate, | + | If there is an account in particular you would like to investigate, |
+ | ((https:// | ||
+ | " | ||
+ | page in the " | ||
+ | \\ | ||
==== Temporary Files ==== | ==== Temporary Files ==== | ||
- | Usually temporary files will not be the main cause of the server running out of disk space, | + | //Usually// temporary files will not be the main cause of the server running out of disk space. However, it is very important //**not**// to remove the '' |
{{howhard> | {{howhard> | ||
< | < | ||
- | # find /tmp -type f -print0 | xargs -0 du -sch | sort -h | tail | + | |
</ | </ | ||
Line 303: | Line 354: | ||
< | < | ||
- | # find /tmp -type f -exec rm -v {} + | + | |
</ | </ | ||
+ | \\ | ||
==== Trash Folders - cPanel File Manager ==== | ==== Trash Folders - cPanel File Manager ==== | ||
- | cPanel File Manager has a trash folder for each account, so that if something is deleted by accident from the File Manager, it can be brought back relatively easily. But, this trash folder is not automatically emptied. If any of your users make extensive use of the File Manager in cPanel, especially if they do not often use the [[https:// | + | cPanel File Manager has a trash folder for each account, so that if something is deleted by accident from the File Manager, it can be brought back relatively easily. But, this trash folder is not automatically emptied. If any of your users make extensive use of the File Manager in cPanel, especially if they do not often use the |
+ | ((https:// | ||
+ | [[https:// | ||
+ | button within File Manager, it is possible that these trash folders can get quite large. | ||
+ | \\ | ||
=== via cPanel === | === via cPanel === | ||
Line 316: | Line 372: | ||
These trash folders can be emptied within cPanel File Manager by clicking the "Empty Trash" button. | These trash folders can be emptied within cPanel File Manager by clicking the "Empty Trash" button. | ||
- | === via SSH or Console | + | \\ |
+ | === via SSH === | ||
{{howhard> | {{howhard> | ||
- | These trash folders are named '' | + | These trash folders are named '' |
< | < | ||
- | root@host [~]# du -sch / | + | |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 4.0K / | + | 4.0K |
- | 12K total | + | 12K |
</ | </ | ||
Line 333: | Line 390: | ||
< | < | ||
- | # find / | + | |
</ | </ | ||
+ | \\ | ||
==== Trash Folders - IMAP ==== | ==== Trash Folders - IMAP ==== | ||
If your users use IMAP to connect to their mail folders, then when they delete messages via their mail client they will usually at first be moved to a trash folder. In cPanel servers, it is possible to configure the IMAP trash folders to " | If your users use IMAP to connect to their mail folders, then when they delete messages via their mail client they will usually at first be moved to a trash folder. In cPanel servers, it is possible to configure the IMAP trash folders to " | ||
+ | \\ | ||
=== Autoexpunge === | === Autoexpunge === | ||
Line 346: | Line 405: | ||
In a cPanel server, The " | In a cPanel server, The " | ||
+ | \\ | ||
=== via cPanel === | === via cPanel === | ||
{{howhard> | {{howhard> | ||
- | In order to find these '' | + | In order to find these '' |
+ | ((https:// | ||
+ | [[https:// | ||
+ | Once this has been done, you should be able to find the folders in their locations. There are two places to look: | ||
* directly in the " | * directly in the " | ||
Line 357: | Line 420: | ||
If you started File Manager from the site's docroot, ((aka, the www or public_html folder)) you will need to go up one level in order to see the mail folder. | If you started File Manager from the site's docroot, ((aka, the www or public_html folder)) you will need to go up one level in order to see the mail folder. | ||
+ | \\ | ||
=== via Webmail === | === via Webmail === | ||
{{howhard> | {{howhard> | ||
- | //If// you have **not** yet enabled the new [[https:// | + | //If// you have **not** yet enabled the new |
+ | ((https:// | ||
+ | [[https:// | ||
+ | mailbox format, you can see the contents of the email accounts from the webmail interface of the overarching email account of the cPanel account | ||
+ | ((https:// | ||
+ | [[https:// | ||
+ | You may need to " | ||
- | === via SSH or Console | + | \\ |
+ | === via SSH === | ||
{{howhard> | {{howhard> | ||
Line 370: | Line 441: | ||
< | < | ||
- | root@host [~]# du -sch / | + | |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 24K / | + | 24K |
- | 32K / | + | 32K |
- | 436K / | + | 436K |
- | 604K total | + | 604K |
</ | </ | ||
Line 388: | Line 459: | ||
< | < | ||
- | root@host [~]# du -sch / | + | |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 16K / | + | 16K |
- | 24K / | + | 24K |
- | 32K / | + | 32K |
- | 436K / | + | 436K |
- | 616K total | + | 616K |
</ | </ | ||
Line 406: | Line 477: | ||
< | < | ||
- | # find / | + | |
</ | </ | ||
- | And remember, if you need any help, you can always [[my-knownhost: | + | And remember, if you need any help, you can always |
+ | [[my-knownhost: | ||
+ | for assistance. | ||