{"id":25924,"date":"2025-07-05T00:01:40","date_gmt":"2025-07-04T17:01:40","guid":{"rendered":"https:\/\/dps.media\/xu-ly-tinh-trang-day-dia-tmp-trong-cyberpanel\/"},"modified":"2025-07-05T00:01:41","modified_gmt":"2025-07-04T17:01:41","slug":"handling-tmp-disk-full-status-in-cyberpanel","status":"publish","type":"post","link":"https:\/\/dps.media\/en\/handling-tmp-disk-full-status-in-cyberpanel\/","title":{"rendered":"We look forward to receiving your feedback and\u2064 experiences \u200bfrom you\u200c on this journey. Please comment below or join the discussion \u2063to learn and grow together! \ud83d\ude0a"},"content":{"rendered":"<p>By default, OpenLiteSpeed uses the \/tmp\/lshttpd\/swap directory to store temporary files. If your \/tmp partition has limited space, the disk may become full, causing errors for the entire VPS.<\/p><p>Below is a summary of the steps to move OpenLiteSpeed's Swapping directory.<\/p><h3>Create a new directory for OpenLiteSpeed's Swapping Directory:<\/h3><p>Create directory:<\/p><pre data-no-translation=\"\">[bash]mkdir -p \/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><br>\nSet permissions:<\/p><pre data-no-translation=\"\">[bash]chmod 750 \/lswstmp\/lshttpd[\/bash]<\/pre><p>\u00a0<\/p><pre data-no-translation=\"\">[bash]chmod 700 \/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><br>\nAssign ownership:<\/p><pre data-no-translation=\"\">[bash]chown -R nobody:nogroup \/lswstmp\/lshttpd[\/bash]<\/pre><p><br>\nAccess the OpenLiteSpeed admin interface:<\/p><p>Address:<\/p><pre data-no-translation=\"\">[bash]https:\/\/your-server-ip:7080\/login.php[\/bash]<\/pre><p><br>\nIf you don't have an account, reset the password with the command:<\/p><pre data-no-translation=\"\">[bash]\/usr\/local\/lsws\/admin\/misc\/admpass.sh[\/bash]<\/pre><p><br>\nAfter logging in, go to the server configuration section:<\/p><p><strong>Server Configuration &gt; General<\/strong><br>\nIn the section <strong>Server Process<\/strong>, change the value of\u00a0<strong>Swapping Directory<\/strong><\/p><p>From the default value<\/p><pre data-no-translation=\"\">[bash]\/tmp\/lshttpd\/swap[\/bash]<\/pre><p>to<\/p><pre data-no-translation=\"\">[bash]\/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><a href=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_2qTIwvzVEf.png\" aria-label=\"Dps.media\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7428\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_2qTIwvzVEf.png\" alt=\"\" width=\"1098\" height=\"507\" title=\"\"><\/a><br>\nRestart OpenLiteSpeed:<\/p><p>Use the web interface or SSH command:<\/p><pre data-no-translation=\"\">[bash] systemctl restart lsws[\/bash]<\/pre><p><br>\nThese steps help you move OpenLiteSpeed's temporary directory to a partition with more space, avoiding disk full issues due to a small \/tmp partition.<\/p><h3><br>\nIf you want to take advantage of RAM to create a temporary (tmp) drive with higher speed, follow these steps:<\/h3><p>Create Directory for Ramdisk, Use the command:<\/p><pre data-no-translation=\"\">[bash]sudo mkdir -p \/mnt\/ramdisk[\/bash]<\/pre><p><br>\nMount ramdisk with 1GB size:<\/p><pre data-no-translation=\"\">[bash]sudo mount -t tmpfs -o size=1G tmpfs \/mnt\/ramdisk[\/bash]<\/pre><p><br>\nThis command creates a temporary ramdisk with a size of 1GB.<br>\nConfigure Ramdisk to Auto-Mount on Startup:<\/p><p>Add configuration to \/etc\/fstab so that ramdisk is automatically mounted every time the system starts.<br>\nUse the command:<\/p><pre data-no-translation=\"\">[bash]echo 'tmpfs \/mnt\/ramdisk tmpfs nodev,nosuid,noexec,nodiratime,size=1G 0 0' | sudo tee -a \/etc\/fstab[\/bash]<\/pre><p><br>\nThis line will be added to the \/etc\/fstab file, allowing the system to automatically create and mount the ramdisk with the specified options.<\/p><p>Select:<\/p><p><strong>Server Configuration &gt; General<\/strong><br>\nIn the section <strong>Server Process<\/strong>, change the value of\u00a0<strong>Swapping Directory<\/strong><\/p><p>From the default value<\/p><pre data-no-translation=\"\">[bash]\/tmp\/lshttpd\/swap[\/bash]<\/pre><p>to<\/p><pre data-no-translation=\"\">[bash]\/mnt\/ramdisk[\/bash]<\/pre><p><a href=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_x7UhepAI5A.png\" aria-label=\"Dps.media\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7430\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_x7UhepAI5A.png\" alt=\"\" width=\"1092\" height=\"509\" title=\"\"><\/a><br>\nRestart OpenLiteSpeed:<\/p><p>Use the web interface or SSH command:<\/p><pre data-no-translation=\"\">[bash] systemctl restart lsws[\/bash]<\/pre><p>The above steps will help you create a temporary disk on RAM, increasing the speed of temporary data processing due to the high speed of RAM compared to traditional drives. This is especially useful for applications that require fast data processing, such as web services or database applications. However, note that data on RAM will be lost when the system shuts down or restarts, so it should only be used for temporary files.<\/p><h3><br>\nTo add a cronjob to clean up the temporary drive at 3 AM daily, you can follow these steps:<\/h3><p>Create a script file (logscleaner.sh) with the following content:<\/p><pre data-no-translation=\"\">[bash]nano logscleaner.sh[\/bash]<\/pre><p>If using disk, add the following line:<\/p><pre data-no-translation=\"\">[bash]find \/lswstmp\/lshttpd\/swap -type f -delete[\/bash]<\/pre><p><br>\nIf using RAM, add the following line:<\/p><pre data-no-translation=\"\">[bash]find \/mnt\/ramdisk\/ -type f -delete[\/bash]<\/pre><p><br>\nGrant execute permission to the script:<\/p><pre data-no-translation=\"\">[bash]chmod +x logscleaner.sh[\/bash]<\/pre><p><br>\nTry running the script to check:<\/p><pre data-no-translation=\"\">[bash]sh logscleaner.sh[\/bash]<\/pre><p><br>\nAdd a cronjob to crontab:<\/p><pre data-no-translation=\"\">[bash]crontab -e[\/bash]<\/pre><p>\u00a0<\/p><pre data-no-translation=\"\">[bash]0 3 * * * sh \/root\/logscleaner.sh[\/bash]<\/pre><p><br>\nThis script will automatically run at 3 AM daily to clean up temporary files in the temporary disk, helping to minimize disk full issues.<\/p><div data-zone-id=\"0\" data-line-index=\"0\" data-line=\"true\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Theo m\u1eb7c \u0111\u1ecbnh, OpenLiteSpeed s\u1eed d\u1ee5ng th\u01b0 m\u1ee5c \/tmp\/lshttpd\/swap \u0111\u1ec3 l\u01b0u tr\u1eef c\u00e1c t\u1eadp tin t\u1ea1m th\u1eddi. N\u1ebfu ph\u00e2n v\u00f9ng \/tmp c\u1ee7a b\u1ea1n c\u00f3 dung l\u01b0\u1ee3ng nh\u1ecf, \u0111\u0129a c\u00f3 th\u1ec3 b\u1ecb \u0111\u1ea7y, g\u00e2y ra l\u1ed7i to\u00e0n b\u1ed9 VPSD\u01b0\u1edbi \u0111\u00e2y l\u00e0 t\u00f3m t\u1eaft c\u00e1c b\u01b0\u1edbc di chuy\u1ec3n th\u01b0 m\u1ee5c Swapping c\u1ee7a OpenLiteSpeed.T\u1ea1o th\u01b0 m\u1ee5c m\u1edbi cho [&hellip;]<\/p>","protected":false},"author":1,"featured_media":25925,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-25924","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"rankmath_keywords":{"primary":"","secondary":[""]},"yoast_keywords":{"primary":"","secondary":[]},"yoast_focuskw":"","rankmath_focuskw":"","seo_keywords":{"primary":"","secondary":[""]},"_links":{"self":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/posts\/25924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/comments?post=25924"}],"version-history":[{"count":0,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/posts\/25924\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/media\/25925"}],"wp:attachment":[{"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/media?parent=25924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/categories?post=25924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dps.media\/en\/wp-json\/wp\/v2\/tags?post=25924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}