这是一个桌面系统,配有用于操作系统 Xubuntu 20.04.6 的 1TB SSD,以及用于存储我所有文件的多个 HDD。所以操作系统不应该占用那么多空间。但 df 的输出是:
Filesystem 1K-blocks Used Available Use% Mounted on
udev 16332704 0 16332704 0% /dev
tmpfs 3284264 3384 3280880 1% /run
/dev/nvme0n1p2 959786032 740380052 170577772 82% /
显然,还有更多行,但 /dev/nvme 行是问题所在。我一辈子都找不到是什么占据了所有的空间。“home”文件夹大约有 6GB。
我对“proc”目录表示怀疑。Nautilus 称其拥有数万个文件,总计 128TB。我想不是。这是 cd /proc 的输出;须藤杜-hs
du: cannot read directory './3032/task/3032/net': Invalid argument
du: cannot read directory './3032/net': Invalid argument
du: cannot read directory './3288/task/3288/net': Invalid argument
du: cannot read directory './3288/net': Invalid argument
du: cannot access './6606/task/6606/fd/3': No such file or directory
du: cannot access './6606/task/6606/fdinfo/3': No such file or directory
du: cannot access './6606/fd/4': No such file or directory
du: cannot access './6606/fdinfo/4': No such file or directory
0
我在“/”下的所有其他目录上使用了“du -hs”,它们加起来约为 55GB。还有一个 2GB 的交换文件。那么我如何找到什么东西耗尽了我所有的 SSD 空间呢?
更新:这是输出cd / ; sudo du -hxd 1
j@puter:/$ cd / ; sudo du -hxd 1
11M ./root
18M ./bin
20M ./sbin
4.0K ./mnt
5.4G ./usr
16K ./lost+found
184K ./tmp
532M ./opt
248M ./boot
84K ./snap
12G ./var
6.4G ./home
4.0K ./lib64
8.0K ./srv
1.5G ./lib
4.0K ./cdrom
14M ./etc
8.0K ./media
28G .
j@puter:/$
更新:从实时 USB 启动,运行 fsck
xubuntu@xubuntu:~$ sudo fsck -f /dev/nvme0n1p2
fsck from util-linux 2.37.2
e2fsck 1.46.5 (30-Dec-2021)
Pass 1: Checking inodes, blocks, and sizes
Inode 34099073 extent tree (at level 1) could be narrower. Optimize<y>? yes
Inode 34344578 extent tree (at level 1) could be shorter. Optimize<y>? yes
Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/nvme0n1p2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/nvme0n1p2: 514456/61022208 files (4.6% non-contiguous), 189197520/244059136 blocks
xubuntu@xubuntu:~$
更新: ncdu
证实了du
我所说的:
Total disk usage: 27.4 GiB Apparent size: 27.2 GiB Items: 402910
当我查看 GUI 中的“属性”时,它说
401685 items, totalling 26.1 GiB (28,044,956,192 bytes)
(some contents unreadable)
162.7 GiB of 915.3 GiB free (82% used)