当遇到磁盘空间已用完,无法创建目录时怎么办?
背景介绍:
在安装 MogDB3.0 数据库时,提示磁盘空间已用完,无法创建目录。
报错内容:
[root@mogdb-kernel-0003 opt]# ptk install -f config.yaml --db-version 3.0.0 -y
INFO[2022-08-18T13:16:53.555] 未指定安装包路径,默认使用在线包: https://cdn-mogdb.enmotech.com/mogdb-media/3.0.0/MogDB-3.0.0-openEuler-arm64.tar.gz
INFO[2022-08-18T13:16:53.555] start check operating system
INFO[2022-08-18T13:16:53.558] prechecking dependent tools...
INFO[2022-08-18T13:16:53.569] platform: kylin_V10_64bit host=...INFO[2022-08-18T13:16:53.572] kernel version: 4.19.90-17.ky10.aarch64 host=...INFO[2022-08-18T13:16:53.656] locale: LANG=zh_CN.UTF-8 host=...INFO[2022-08-18T13:16:53.660] timezone: +0800 host=...INFO[2022-08-18T13:16:53.664] swap memory 4194240kB, total memory 65637632kB host=...WARN[2022-08-18T13:16:53.676] net.ipv4.tcp_fin_timeout=40, expect 60 host=...WARN[2022-08-18T13:16:53.692] net.ipv4.tcp_retries1=3, expect 5 host=...WARN[2022-08-18T13:16:53.697] net.ipv4.tcp_syn_retries=6, expect 5 host=...INFO[2022-08-18T13:16:53.747] check kernel.core_pattern host=...INFO[2022-08-18T13:16:53.753] check removeIPC value host=...WARN[2022-08-18T13:16:53.792] device(dm-0) 'IO Request'=128, expect 256 host=...WARN[2022-08-18T13:16:53.792] device(dm-1) 'IO Request'=128, expect 256 host=...INFO[2022-08-18T13:16:55.453] check port 28000 host=...INFO[2022-08-18T13:16:55.683] port 28000 is free host=...INFO[2022-08-18T13:16:55.683] 使用缓存 /root/.ptk/cache/MogDB-3.0.0-openEuler-arm64.tar.gz
INFO[2022-08-18T13:16:57.672] validation: installation package is safe
INFO[2022-08-18T13:16:57.672] parse version.cfg from MogDB-3.0.0-openEuler-64bit.tar.gz
INFO[2022-08-18T13:17:00.855] detected db version: MogDB-3.0.0, number: 92.605, commit_id: 62408a0f
[PTK-50202] failed to create dir '/root/.ptk/data/mogdb2', because mkdir /root/.ptk/data/mogdb2: no space left on device
解决办法:
进入根目录下,执行 df -h 查看各个目录空间使用率。
进入磁盘空间已用完的目录下,查找占空间大的文件。如果确认无用,将其删掉即可释放空间。