[File Manager] 文件管理器中的磁盘容量计算逻辑是什么啊? Resolved
Tofloor
poster avatar
a-bird
deepin
2025-05-26 18:03
Author

我这边打开文件管理器后,看到磁盘容量和在终端用命令看到的容量不一致啊。这是bug吗?具体计算逻辑是啥啊?

1748253705630.png

1748253637315.png

Reply Favorite View the author
All Replies
夜夜笙歌free
deepin
2025-05-26 18:43
#1

这两者不是一个概念

Reply View the author
a-bird
deepin
2025-05-26 19:13
#2
夜夜笙歌free

这两者不是一个概念

上面那个是什么意思啊?不是使用量吗?confused

Reply View the author
夜夜笙歌free
deepin
2025-05-26 20:18
#3
a-bird

上面那个是什么意思啊?不是使用量吗?confused

https://bbs.deepin.org/post/254999 以前有人问过

linux 的硬盘分区程序会自动为 root 或指定的用户保留一定的磁盘空间默认是5%。可以通过 man mkfs.ext4 手册看到:

  -m reserved-blocks-percentage
          Specify the percentage of the filesystem blocks reserved for the super-user.  This avoids fragmenta‐
          tion,  and  allows  root-owned  daemons, such as syslogd(8), to continue to function correctly after
          non-privileged processes are prevented from writing to the filesystem.  The  default  percentage  is
          5%.

也就是说,ext文件系统,包括ext2、ext3、ext4都会默认预留5%的磁盘空间,留给root用户维护系统或者记录系统关键日志的时候使用(比如磁盘使用空间已经100%的情况下的处理)。

可以通过命令 tune2fs 查询到保留空间。

Reply View the author
a-bird
deepin
2025-05-26 20:25
#4
夜夜笙歌free

https://bbs.deepin.org/post/254999 以前有人问过

linux 的硬盘分区程序会自动为 root 或指定的用户保留一定的磁盘空间默认是5%。可以通过 man mkfs.ext4 手册看到:

  -m reserved-blocks-percentage
          Specify the percentage of the filesystem blocks reserved for the super-user.  This avoids fragmenta‐
          tion,  and  allows  root-owned  daemons, such as syslogd(8), to continue to function correctly after
          non-privileged processes are prevented from writing to the filesystem.  The  default  percentage  is
          5%.

也就是说,ext文件系统,包括ext2、ext3、ext4都会默认预留5%的磁盘空间,留给root用户维护系统或者记录系统关键日志的时候使用(比如磁盘使用空间已经100%的情况下的处理)。

可以通过命令 tune2fs 查询到保留空间。

哦哦哦,原来是这样,没想到这个还有保留部分

Reply View the author