Linux 的 /tmp 目錄變成 1MB 的 overflow 檔案系統如何解決

本文解释了Linux系统中/tmp目录的由来,当该目录空间不足导致无法上传超过1MB的文件时的解决步骤。通过将名为'overflow'的文件系统卸载,可以释放足够的空间解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天有台 Linux 系統的硬碟滿了,導致系統發生異常,將空間清出之後,大部分的程式都可以正常運作,但是一個用 PHP 寫的網站卻出了點小問題,所有功能都能運作,MySQL 資料庫也能跑,但只要上傳超過 1MB 的檔案卻怎樣也上傳不成功 (UPLOAD_ERR_CANT_WRITE),查了好久才終於發現,原來是系統的 /tmp 暫存目錄只剩下 1MB 而已,而且檔案系統為沒聽過的 overflow 這個名稱,這篇文章用來解釋這個檔案系統的由來,以及解決方法。

先看看目前的檔案系統變成這樣:

其實我的 /tmp 根本沒有一個獨立的分割區,所以這個分割區是自動被建立的,而建立的時間點就在「磁碟空間不足」的時候,而且 Linux 系統預設這個暫時的 /tmp 分割區只會有 1MB 這麼大而已,主要目的是為了讓系統其他服務能夠維持一個基本的運作,有時候沒有這個 /tmp 目錄會導致許多服務無法正常啟動。

然而,解決的方法很簡單,只要把 overflow 檔案系統給 umount 掉即可,指令如下:

sudo umount overflow

如果因為檔案被鎖定的問題,而導致無法 umount 的話,可以先進入單人模式 ( telinit 1 ),然後再 umount 即可,否則就要重開機才能解決。

$ pip3 install PTM-POSE Collecting PTM-POSE Downloading ptm_pose-0.3.0-py3-none-any.whl.metadata (7.6 kB) Collecting pandas==2.2.* (from PTM-POSE) Downloading pandas-2.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (89 kB) Collecting numpy==1.26.* (from PTM-POSE) Downloading numpy-1.26.4.tar.gz (15.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.8/15.8 MB 478.4 kB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting scipy==1.13.* (from PTM-POSE) Downloading scipy-1.13.1.tar.gz (57.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.2/57.2 MB 474.2 kB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [43 lines of output] + meson setup /tmp/pip-install-z8uxbhaj/scipy_2d56e94197b1489098e8f0980667dae9 /tmp/pip-install-z8uxbhaj/scipy_2d56e94197b1489098e8f0980667dae9/.mesonpy-nurt08x2 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-z8uxbhaj/scipy_2d56e94197b1489098e8f0980667dae9/.mesonpy-nurt08x2/meson-python-native-file.ini The Meson build system Version: 1.8.2 Source dir: /tmp/pip-install-z8uxbhaj/scipy_2d56e94197b1489098e8f0980667dae9 Build dir: /tmp/pip-install-z8uxbhaj/scipy_2d56e94197b1489098e8f0980667dae9/.mesonpy-nurt08x2 Build type: native build Project name: scipy Project version: 1.13.1 C compiler for the host machine: cc (gcc 13.3.0 "cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0") C linker for the host machine: cc ld.bfd 2.42 C++ compiler for the host machine: c++ (gcc 13.3.0 "c++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0") C++ linker for the host machine: c++ ld.bfd 2.42 Cython compiler for the host machine: cython (cython 3.0.12) Host machine cpu family: x86_64 Host machine cpu: x86_64 Program python found: YES (/mnt/940660EA0660CEB4/PTM-POSE/myenv/bin/python3) Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1 Run-time dependency python found: YES 3.13 Program cython found: YES (/tmp/pip-build-env-13qjdw3k/overlay/bin/cython) Compiler for C supports arguments -Wno-unused-but-set-variable: YES Compiler for C supports arguments -Wno-unused-function: YES Compiler for C supports arguments -Wno-conversion: YES Compiler for C supports arguments -Wno-misleading-indentation: YES Library m found: YES Fortran compiler for the host machine: gfortran (gcc 13.3.0 "GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0") Fortran linker for the host machine: gfortran ld.bfd 2.42 Compiler for Fortran supports arguments -Wno-conversion: YES Checking if "-Wl,--version-script" links: YES Program pythran found: YES 0.15.0 0.15.0 (/tmp/pip-build-env-13qjdw3k/overlay/bin/pythran) Found CMake: /usr/bin/cmake (3.28.3) Run-time dependency xsimd found: NO (tried pkgconfig and cmake) Run-time dependency threads found: YES Library npymath found: YES Library npyrandom found: YES pybind11-config found: YES (/tmp/pip-build-env-13qjdw3k/overlay/bin/pybind11-config) 2.12.1 Run-time dependency pybind11 found: YES 2.12.1 Run-time dependency scipy-openblas found: NO (tried pkgconfig) Run-time dependency openblas found: NO (tried pkgconfig and cmake) Run-time dependency openblas found: NO (tried pkgconfig and cmake) ../scipy/meson.build:163:9: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake A full log can be found at /tmp/pip-install-z8uxbhaj/scipy_2d56e94197b1489098e8f0980667dae9/.mesonpy-nurt08x2/meson-logs/meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
最新发布
07-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值