【已解决】Root分区大小设定
Tofloor
poster avatar
mal1029
deepin
2020-08-15 10:50
Author
本帖最后由 mal1029 于 2020-9-11 09:31 编辑

按照指引设置root分区为15G。

运行一段时间后,发现root只剩下1G,遇到几次var暴增导致root空间用尽。

所以,我的问题是,15G的root空间设定是否过时了,还是我没有设置好?

Reply Favorite View the author
All Replies
avatar
deepinuser17
deepin
2020-08-15 11:40
#1
一般这种情况是日志,缓冲文件占用了很多空间.用ncdu命令来查看哪个文件夹,文件占用了空间.然后备份,清理.

  1. 安装ncdu:

  2. sudo apt-get install ncdu

  3. 查看空间使用状况:

  4. ncdu /
Copy the Code
Reply View the author
Comments
mal1029
2020-08-15 11:48
谢谢。

另外,15g是否其实不够呢
avatar
deepinuser17
deepin
2020-08-15 13:00
#2
如果root分区包括/opt, /usr, /tmp, /var文件夹,15GB不够大.至少要30GB. 50GB比较富余. 

在个人笔记本上,我的硬盘分区是:

/efi   200MB
/boot  900MB
swap   2 x 物理内存(如果小于16GB) 或是 物理内存(如果大于16GB) + 8GB
/      所有剩余的硬盘空间

这样分区,一个500GB的硬盘,450GB的空间给root分区.

如果要把home, 放在单独的分区:
/efi   200MB
/boot  900MB
swap   2 x 物理内存(如果小于16GB) 或是 物理内存(如果大于16GB) + 8GB
/      50GB
/home  所有剩余的硬盘空间

home单独分区的好处是重新安装时,保留该分区不格式化.但是在重装之前,一定要备份重要的文件. 
Reply View the author
Comments
mal1029
2020-08-19 01:48
了解了。谢谢。
avatar
137******86
deepin
2020-08-15 15:03
#3
/opt /var /Home都在数据盘 深度这是在逼你少用按传统目录打包的包啊,/usr空间实在拮据
Reply View the author
Comments
mal1029
2020-08-19 01:49
我的 opt var 都在root。
avatar
Hello
deepin
2020-08-15 22:15
#4
可以用gpart的镜像重新分区
Reply View the author
avatar
Hello
deepin
2020-08-15 22:15
#5
15个G根本不是人用的,我150个G现在都用了60个G
Reply View the author
Comments
mal1029
2020-08-19 01:51
谢谢。
avatar
wanzhendema
deepin
2020-08-15 23:00
#6
可以把没用的东西清理清理。
Reply View the author
Comments
mal1029
2020-08-19 01:52
OK
avatar
137******86
deepin
2020-08-16 00:22
#7
楼主应该不是用的全盘安装,全盘安装的话会把/var挂到数据盘。如果是自己分区的话再搞个15G的root是没意义的,建议调整一下。
Reply View the author
Comments
mal1029
2020-08-19 01:58
那把把var连接到home去吧。还是单独设一个var分区?
avatar
enforcee
deepin
2020-08-16 05:35
#8
很有可能是日志积累多了 有时候程序出问题会出现大量日志 如果不需要的话可以清理掉
单次清理办法:终端输入
sudo journalctl --vacuum-size=40M
保留日志的体积可以自定
一劳永逸办法:文本编辑器打开(使用root权限)
/etc/systemd/journald.conf
加入一行
SystemMaxUse=40M
数值同样可以自定

另外15GB确实有点少了
Reply View the author
Comments
mal1029
2020-08-19 01:59
OK
mal1029
2020-08-19 01:57
好。谢谢。