首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >根(/dev/vda1 1)上的空间不足。不知道为什么

根(/dev/vda1 1)上的空间不足。不知道为什么
EN

Ask Ubuntu用户
提问于 2018-08-28 15:32:06
回答 1查看 8.6K关注 0票数 5

我有一个新的Ubuntu数字海洋液滴,它不断耗尽空间的根。

代码语言:javascript
复制
df

Filesystem     1K-blocks      Used Available Use% Mounted on
udev             2013876         0   2013876   0% /dev
tmpfs             404640     10740    393900   3% /run
/dev/vda1       81120924  81104144       396 100% /          <----------<<<<< 396k space left after running apt clean commands. it keeps going down to 0 
tmpfs            2023196         0   2023196   0% /dev/shm
tmpfs               5120         0      5120   0% /run/lock
tmpfs            2023196         0   2023196   0% /sys/fs/cgroup
/dev/sda       363979364 245756248  99856652  72% /mnt/volume-nyc1-04
/dev/vda15        106858      3437    103421   4% /boot/efi
tmpfs             404640         0    404640   0% /run/user/1000
tmpfs             404640         0    404640   0% /run/user/0

80g/分区是100%。

但是当我切换到/和做

代码语言:javascript
复制
du -sk -x -h *

16M bin
65M boot
0   dev
du: cannot access 'etc/ssl/certs/Camerfirma_Global_Chambersign_Root.pem': Structure needs cleaning
du: cannot access 'etc/ssl/certs/Certigna.pem': Structure needs cleaning
5.6M    etc
40M home
0   initrd.img
0   initrd.img.old
159M    lib
4.0K    lib64
16K lost+found
4.0K    media
8.0K    mnt
4.0K    opt
du: cannot access 'proc/4713/task/4713/fd/4': No such file or directory
du: cannot access 'proc/4713/task/4713/fdinfo/4': No such file or directory
du: cannot access 'proc/4713/fd/4': No such file or directory
du: cannot access 'proc/4713/fdinfo/4': No such file or directory
0   proc
32K root
11M run
14M sbin
8.0K    snap
4.0K    srv
0   sys
36K tmp
1.1G    usr
254M    var
0   vmlinuz
0   vmlinuz.old

我不能让它加起来超过几次演出。不知道整个80场演出都去哪了!

到目前为止,我尝试了几个恰当的干净命令,但这几乎没有什么区别。

这是一个更大的包裹清单,但我不确定哪些是安全的。

代码语言:javascript
复制
dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}'

3.883 MB     ncurses-term
3.890 MB     libmagic1
3.958 MB     libdns162
4.039 MB     command-not-found-data
4.351 MB     linux-libc-dev
4.409 MB     libpython3.5
5.310 MB     geoip-database
6.102 MB     coreutils
6.307 MB     bitcoind
6.499 MB     dpkg
6.572 MB     udev
6.922 MB     perl-base
7.180 MB     linux-headers-4.4.0-133-generic
7.188 MB     linux-headers-4.4.0-134-generic
8.069 MB     lxd-client
8.517 MB     libpython2.7-stdlib
8.644 MB     python3.5-minimal
9.623 MB     libpython3.5-stdlib
10.696 MB    libc6
11.355 MB    grub-common
11.907 MB    libgcc-5-dev
12.921 MB    libc6-dev
13.023 MB    binutils
13.363 MB    locales
14.912 MB    libstdc++-5-dev
15.659 MB    iso-codes
16.714 MB    lxd
16.858 MB    perl-modules-5.22
18.414 MB    systemd
19.877 MB    libperl5.22
20.911 MB    cpp-5
22.343 MB    g++-5
23.000 MB    git
23.121 MB    gcc-5
26.240 MB    vim-runtime
29.389 MB    libicu55
38.940 MB    libpython2.7-dev
51.022 MB    libpython3.5-dev
64.915 MB    linux-image-4.4.0-131-generic
64.935 MB    linux-image-4.4.0-133-generic
64.947 MB    linux-image-4.4.0-134-generic
67.640 MB    linux-headers-4.4.0-133
67.645 MB    linux-headers-4.4.0-134
77.453 MB    snapd

当我这样做..。./mnt显示比它的大小更大,这是奇怪的(驱动器只有350次)。还有那些访问错误是怎么回事

代码语言:javascript
复制
sudo du -hd 1 | sort -h

du: cannot access './proc/5000/task/5000/fd/4': No such file or directory
du: cannot access './proc/5000/task/5000/fdinfo/4': No such file or directory
du: cannot access './proc/5000/fd/3': No such file or directory
du: cannot access './proc/5000/fdinfo/3': No such file or directory
du: cannot access './etc/ssl/certs/Camerfirma_Global_Chambersign_Root.pem': Structure needs cleaning
du: cannot access './etc/ssl/certs/Certigna.pem': Structure needs cleaning
0   ./dev
0   ./proc
0   ./sys
4.0K    ./lib64
4.0K    ./media
4.0K    ./opt
4.0K    ./srv
8.0K    ./snap
16K ./lost+found
32K ./root
36K ./tmp
5.6M    ./etc
11M ./run
14M ./sbin
16M ./bin
40M ./home
68M ./boot
159M    ./lib
254M    ./var
1.1G    ./usr
469G    ./mnt
471G    .

以下是/mnt的内容。其中一些可能是本地文件吗?

代码语言:javascript
复制
:/mnt# ls -al
total 20
drwxr-xr-x  5 root root 4096 Aug 27 18:04 .
drwxr-xr-x 23 root root 4096 Aug 27 16:33 ..
drwxr-xr-x  2 root root 4096 Aug 18 14:36 volume-nyc1-03
drwxr-xr-x  4 root root 4096 Aug 27 16:42 volume_nyc1_04
drwxr-xr-x  4 root root 4096 Aug 27 16:42 volume-nyc1-04


:/mnt# du -sk -x -h *
4.0K    volume-nyc1-03
235G    volume_nyc1_04

支票盘正在拿出一些东西。

代码语言:javascript
复制
$:/# sudo fsck -nf /dev/vda1

fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
Warning!  /dev/vda1 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry 'Camerfirma_Global_Chambersign_Root.pem' in /etc/ssl/certs (1490) has deleted/unused inode 1521.  Clear? no

Entry 'Camerfirma_Global_Chambersign_Root.pem' in /etc/ssl/certs (1490) has an incorrect filetype (was 7, should be 0).
Fix? no

Entry 'Certigna.pem' in /etc/ssl/certs (1490) has deleted/unused inode 1522.  Clear? no

Entry 'Certigna.pem' in /etc/ssl/certs (1490) has an incorrect filetype (was 7, should be 0).
Fix? no

Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -16499
Fix? no

Inode bitmap differences:  -(1521--1522)
Fix? no


cloudimg-rootfs: ********** WARNING: Filesystem still has errors **********

cloudimg-rootfs: 109495/10321920 files (0.6% non-contiguous), 20938940/20943099 blocks
EN

回答 1

Ask Ubuntu用户

发布于 2018-08-28 15:46:26

首先,可以添加-x选项以防止du遍历文件系统。

然后添加sort -h按文件大小排序

最后,以root用户的身份运行此命令。

代码语言:javascript
复制
du -shx /* | sort -rh

这可以帮助您了解发生了什么,通过查看第一行,而不花费太多的时间探索您的/mnt

您似乎还在/etc/文件上出现文件系统损坏。/etc/文件不太可能很大,但是您仍然可以在文件系统恶化之前检查它的错误。

如果您无法计算空间消耗,请在/etc/中运行相同的命令,这样您就可以知道它在没有损坏目录的情况下所需的大小。

票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1069803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档