{"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":"<?xml encoding=\"utf-8\" ?><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>[bash]mkdir -p \/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><br>\nSet permissions:<\/p><pre>[bash]chmod 750 \/lswstmp\/lshttpd[\/bash]<\/pre><p>\u00a0<\/p><pre>[bash]chmod 700 \/lswstmp\/lshttpd\/swap[\/bash]<\/pre><p><br>\nAssign ownership:<\/p><pre>[bash]chown -R nobody:nogroup \/lswstmp\/lshttpd[\/bash]<\/pre><p><br>\nAccess the OpenLiteSpeed admin interface:<\/p><p>Address:<\/p><pre>[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>[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>[bash]\/tmp\/lshttpd\/swap[\/bash]<\/pre><p>to<\/p><pre>[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 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>[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>[bash]sudo mkdir -p \/mnt\/ramdisk[\/bash]<\/pre><p><br>\nMount ramdisk with 1GB size:<\/p><pre>[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>[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>[bash]\/tmp\/lshttpd\/swap[\/bash]<\/pre><p>to<\/p><pre>[bash]\/mnt\/ramdisk[\/bash]<\/pre><p><a href=\"https:\/\/dps.media\/wp-content\/uploads\/2025\/07\/chrome_x7UhepAI5A.png\" aria-label=\"Dps.media\"><img 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>[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>[bash]nano logscleaner.sh[\/bash]<\/pre><p>If using disk, add the following line:<\/p><pre>[bash]find \/lswstmp\/lshttpd\/swap -type f -delete[\/bash]<\/pre><p><br>\nIf using RAM, add the following line:<\/p><pre>[bash]find \/mnt\/ramdisk\/ -type f -delete[\/bash]<\/pre><p><br>\nGrant execute permission to the script:<\/p><pre>[bash]chmod +x logscleaner.sh[\/bash]<\/pre><p><br>\nTry running the script to check:<\/p><pre>[bash]sh logscleaner.sh[\/bash]<\/pre><p><br>\nAdd a cronjob to crontab:<\/p><pre>[bash]crontab -e[\/bash]<\/pre><p>\u00a0<\/p><pre>[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>\n<style>\r\n.lwrp.link-whisper-related-posts{\r\n            \r\n            margin-top: 40px;\nmargin-bottom: 30px;\r\n        }\r\n        .lwrp .lwrp-title{\r\n            \r\n            \r\n        }.lwrp .lwrp-description{\r\n            \r\n            \r\n\r\n        }\r\n        .lwrp .lwrp-list-container{\r\n        }\r\n        .lwrp .lwrp-list-multi-container{\r\n            display: flex;\r\n        }\r\n        .lwrp .lwrp-list-double{\r\n            width: 48%;\r\n        }\r\n        .lwrp .lwrp-list-triple{\r\n            width: 32%;\r\n        }\r\n        .lwrp .lwrp-list-row-container{\r\n            display: flex;\r\n            justify-content: space-between;\r\n        }\r\n        .lwrp .lwrp-list-row-container .lwrp-list-item{\r\n            width: calc(33% - 20px);\r\n        }\r\n        .lwrp .lwrp-list-item:not(.lwrp-no-posts-message-item){\r\n            \r\n            max-width: 150px;\r\n        }\r\n        .lwrp .lwrp-list-item img{\r\n            max-width: 100%;\r\n            height: auto;\r\n            object-fit: cover;\r\n            aspect-ratio: 1 \/ 1;\r\n        }\r\n        .lwrp .lwrp-list-item.lwrp-empty-list-item{\r\n            background: initial !important;\r\n        }\r\n        .lwrp .lwrp-list-item .lwrp-list-link .lwrp-list-link-title-text,\r\n        .lwrp .lwrp-list-item .lwrp-list-no-posts-message{\r\n            \r\n            \r\n            \r\n            \r\n        }@media screen and (max-width: 480px) {\r\n            .lwrp.link-whisper-related-posts{\r\n                \r\n                \r\n            }\r\n            .lwrp .lwrp-title{\r\n                \r\n                \r\n            }.lwrp .lwrp-description{\r\n                \r\n                \r\n            }\r\n            .lwrp .lwrp-list-multi-container{\r\n                flex-direction: column;\r\n            }\r\n            .lwrp .lwrp-list-multi-container ul.lwrp-list{\r\n                margin-top: 0px;\r\n                margin-bottom: 0px;\r\n                padding-top: 0px;\r\n                padding-bottom: 0px;\r\n            }\r\n            .lwrp .lwrp-list-double,\r\n            .lwrp .lwrp-list-triple{\r\n                width: 100%;\r\n            }\r\n            .lwrp .lwrp-list-row-container{\r\n                justify-content: initial;\r\n                flex-direction: column;\r\n            }\r\n            .lwrp .lwrp-list-row-container .lwrp-list-item{\r\n                width: 100%;\r\n            }\r\n            .lwrp .lwrp-list-item:not(.lwrp-no-posts-message-item){\r\n                \r\n                max-width: initial;\r\n            }\r\n            .lwrp .lwrp-list-item .lwrp-list-link .lwrp-list-link-title-text,\r\n            .lwrp .lwrp-list-item .lwrp-list-no-posts-message{\r\n                \r\n                \r\n                \r\n                \r\n            };\r\n        }<\/style>\r\n<div id=\"link-whisper-related-posts-widget\" class=\"link-whisper-related-posts lwrp\">\r\n            <div class=\"lwrp-title\">Related Posts<\/div>    \r\n        <div class=\"lwrp-list-container\">\r\n                                <div class=\"lwrp-list lwrp-list-row-container lwrp-list-double-row\">\r\n                <div class=\"lwrp-list-item\"><a href=\"https:\/\/dps.media\/en\/transparent-legal-information-of-dps-media-jsc-tax-code-0318700500\/\" class=\"lwrp-list-link\"><span class=\"lwrp-list-link-title-text\">Transparent legal information of DPS.MEDIA JSC \u2013 Tax Code: 0318700500<\/span><\/a><\/div><div class=\"lwrp-list-item\"><a href=\"https:\/\/dps.media\/en\/which-departments-functions-and-tasks-does-the-marketing-department-include\/\" class=\"lwrp-list-link\"><span class=\"lwrp-list-link-title-text\">What Departments Does a Marketing Room Consist Of? Functions and Responsibilities<\/span><\/a><\/div><div class=\"lwrp-list-item\"><a href=\"https:\/\/dps.media\/en\/20-viral-content-ideas-for-sales-fanpage\/\" class=\"lwrp-list-link\"><span class=\"lwrp-list-link-title-text\">20 viral content ideas for sales fanpages<\/span><\/a><\/div>                <\/div>\r\n                            <div class=\"lwrp-list lwrp-list-row-container lwrp-list-double-row\">\r\n                <div class=\"lwrp-list-item\"><a href=\"https:\/\/dps.media\/en\/guide-to-analyzing-a-b-testing-tiktok-ads\/\" class=\"lwrp-list-link\"><span class=\"lwrp-list-link-title-text\">Guide to Analyzing A\/B Testing for TikTok Ads<\/span><\/a><\/div><div class=\"lwrp-list-item\"><a href=\"https:\/\/dps.media\/en\/marketing-campaign-deployment-process-at-dps-media\/\" class=\"lwrp-list-link\"><span class=\"lwrp-list-link-title-text\">Marketing Campaign Deployment Process at DPS.MEDIA<\/span><\/a><\/div><div class=\"lwrp-list-item\"><a href=\"https:\/\/dps.media\/en\/designing-catalogues-for-the-tourism-industry-with-impressive-templates\/\" class=\"lwrp-list-link\"><span class=\"lwrp-list-link-title-text\">Design catalogues for the tourism industry with impressive templates<\/span><\/a><\/div>                <\/div>\r\n                <\/div>\r\n<\/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}]}}