Ubuntu:bash:无法为此处文档创建临时文件:设备上没有剩余空间

Ubuntu:bash:无法为此处文档创建临时文件:设备上没有剩余空间

在文件名选项卡完成后,我收到来自 bash 的错误 No space left on device。

当我试图找出是什么耗尽了我的空间时,正如类似问题所建议的那样,我对 df -ah 结果感到困惑。我的电脑有 220GB 磁盘,但似乎只使用了 66GB。

哪里有问题? var/lib 中有很多 docker 镜像吗?我应该把它们移到其他地方吗?

Filesystem      Size  Used Avail Use% Mounted on
sysfs              0     0     0    - /sys
proc               0     0     0    - /proc
udev            7,8G     0  7,8G   0% /dev
devpts             0     0     0    - /dev/pts
tmpfs           1,6G   11M  1,6G   1% /run
/dev/nvme0n1p7   34G   32G     0 100% /
securityfs         0     0     0    - /sys/kernel/security
tmpfs           7,8G   26M  7,8G   1% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           7,8G     0  7,8G   0% /sys/fs/cgroup
cgroup             0     0     0    - /sys/fs/cgroup/systemd
pstore             0     0     0    - /sys/fs/pstore
efivarfs           0     0     0    - /sys/firmware/efi/efivars
cgroup             0     0     0    - /sys/fs/cgroup/cpuset
cgroup             0     0     0    - /sys/fs/cgroup/net_cls,net_prio
cgroup             0     0     0    - /sys/fs/cgroup/pids
cgroup             0     0     0    - /sys/fs/cgroup/rdma
cgroup             0     0     0    - /sys/fs/cgroup/freezer
cgroup             0     0     0    - /sys/fs/cgroup/devices
cgroup             0     0     0    - /sys/fs/cgroup/memory
cgroup             0     0     0    - /sys/fs/cgroup/blkio
cgroup             0     0     0    - /sys/fs/cgroup/cpu,cpuacct
cgroup             0     0     0    - /sys/fs/cgroup/perf_event
cgroup             0     0     0    - /sys/fs/cgroup/hugetlb
systemd-1          -     -     -    - /proc/sys/fs/binfmt_misc
mqueue             0     0     0    - /dev/mqueue
debugfs            0     0     0    - /sys/kernel/debug
hugetlbfs          0     0     0    - /dev/hugepages
configfs           0     0     0    - /sys/kernel/config
fusectl            0     0     0    - /sys/fs/fuse/connections
/dev/loop2       54M   54M     0 100% /snap/core18/677
/dev/loop3      148M  148M     0 100% /snap/skype/66
/dev/loop1      202M  202M     0 100% /snap/hiri/53
/dev/loop4       92M   92M     0 100% /snap/core/6259
/dev/loop6       43M   43M     0 100% /snap/gtk-common-themes/701
/dev/loop7      136M  136M     0 100% /snap/chromium/490
/dev/loop5      227M  227M     0 100% /snap/pycharm-community/83
/dev/loop8      165M  165M     0 100% /snap/noson/160
/dev/loop10     142M  142M     0 100% /snap/skype/51
/dev/loop12     139M  139M     0 100% /snap/skype/54
/dev/loop13      91M   91M     0 100% /snap/core/6350
/dev/loop9      202M  202M     0 100% /snap/hiri/56
/dev/loop11     271M  271M     0 100% /snap/pycharm-community/108
/dev/loop16     477M  477M     0 100% /snap/libreoffice/100
/dev/loop14     179M  179M     0 100% /snap/noson/175
/dev/loop20     478M  478M     0 100% /snap/libreoffice/80
/dev/loop19     144M  144M     0 100% /snap/chromium/566
/dev/loop23      54M   54M     0 100% /snap/core18/594
/dev/loop21      35M   35M     0 100% /snap/gtk-common-themes/818
/dev/loop25     271M  271M     0 100% /snap/pycharm-community/112
/dev/loop26     193M  193M     0 100% /snap/hiri/42
/dev/nvme0n1p9  173G   16G  149G  10% /home
/dev/nvme0n1p1  496M   64M  433M  13% /boot/efi
binfmt_misc        0     0     0    - /proc/sys/fs/binfmt_misc
tmpfs           1,6G     0  1,6G   0% /run/user/0
tmpfs           1,6G   60K  1,6G   1% /run/user/1000
gvfsd-fuse         0     0     0    - /run/user/1000/gvfs
/dev/loop27      54M   54M     0 100% /snap/core18/719
/dev/loop24      91M   91M     0 100% /snap/core/6405
/dev/loop0       35M   35M     0 100% /snap/gtk-common-themes/1122
/dev/loop22      94M   94M     0 100% /snap/noson/179
/dev/loop17     147M  147M     0 100% /snap/chromium/595
/dev/loop18     484M  484M     0 100% /snap/libreoffice/104
overlay            -     -     -    - /var/lib/docker/overlay2/0d3c09bca9a7835f9c9b51114c9c15d08b127dbf7eacc53f7dccaa9f79c9885e/merged
overlay            -     -     -    - /var/lib/docker/overlay2/085ba20c74d4078feda19d9a71ce2b04810ea22ac1e074f451a81a6d60d80c10/merged
overlay            -     -     -    - /var/lib/docker/overlay2/08de193cf78bd7284cd8b2254c727a859039b34bfc1288c579d964f4b2029f45/merged
shm                -     -     -    - /var/lib/docker/containers/b32add46586fc18218271486f137687430272cabed1e8090be8d4301d7cb3368/mounts/shm
shm                -     -     -    - /var/lib/docker/containers/d8c1e0688afd134667083c1fcf467ec2b252fc8e6457ed1635a70642ce536f77/mounts/shm
shm                -     -     -    - /var/lib/docker/containers/80982ee282be06f4dd5cc8e3fbad5ebe215e9257db61f9e1cac87bbc6543f058/mounts/shm
nsfs               -     -     -    - /run/docker/netns/4b8d6fe23d4c
nsfs               -     -     -    - /run/docker/netns/43a0f6dd8034
nsfs               -     -     -    - /run/docker/netns/9e2e1b56b0de
overlay            -     -     -    - /var/lib/docker/overlay2/71d932f5ea853341431835774f3ecd4d7ab909020fdef3343048fcdf75401ebc/merged
shm                -     -     -    - /var/lib/docker/containers/2aa2003301c5e4e63182376b1bce08e34188835c59794214070b6cc6a576e8e7/mounts/shm
nsfs               -     -     -    - /run/docker/netns/9eb16a7792ab
tracefs            -     -     -    - /sys/kernel/debug/tracing

du -shc /* | sort -h


3,9M    /lib32
11M /run
13M /bin
13M /sbin
16M /etc
161M    /root
214M    /boot
761M    /lib
5,4G    /usr
16G /home
17G /snap
28G /var
66G total

答案1

嗯,看看清单。您拥有的基本分区是这两个:

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p7   34G   32G     0 100% /
/dev/nvme0n1p9  173G   16G  149G  10% /home

即,您有大约 170 GB 的单独空间/home,但其他所有内容(包括/var)都在 中/,而只有 34 GB。

对已安装的系统重新分区可能很困难(除非您使用 LVM,但您没有使用 LVM),但您可以尝试看看是否有一些大型数据集可以移动到/home,例如那些映像。您还可以运行从/var/whatever到 例如 的符号链接/home/var/whatever(或类似的绑定安装),以便数据在 下的预期位置仍然可见/var

答案2

您的根文件系统已满,临时目录也已满。许多脚本和程序都需要一些空间来存放工作文件,甚至锁定文件。当 /tmp 不可写时,就会发生不好的事情。

相关内容