问题:设备上没有剩余空间

阿里万

今天早上我遇到了严重的问题。我通过 Teamviewer 远程连接到实验室中的 Ubuntu 桌面以完成机器学习模型的训练,并在一​​周内向我的主管展示一些结果。

在某一点上,我的脚本应该pickle转储一些数组列表的大文件(大约 3GB),所以我让脚本运行了一夜。今天早上,我远程连接检查,发现脚本停止运行并显示一条No space left on device消息。

我怀疑系统转储了太多tmp文件,所以我reboot通过终端执行,迫使系统重新启动(我的错)。

不幸的是,重新启动后,我只能看到黑屏(光标闪烁,见下图)。可能系统挂了,无法进入登录阶段,所以我看不到输入登录屏幕来输入密码。

有没有办法可以安全地重新启动系统?请问有什么帮助吗?

编辑

这是输出:

df -h
Filesystem    Size    Used    Avail    Use%    Mounted on
udev          7.8G       0      7.8G      0%     /dev
tmpfs          1.6G    1.4M     1.6G      1%     /run
/dev/sda1     422B      401G    0        100%    /
tmpfs         7.8G       0      7.8G      0%     /dev/shm
tmpfs         5.0M      4.0K    5.0M      1%     /run/lock
tmpfs         7.8G       0      7.8G      0%     /sys/fs/cgroup
/dev/loop2    256K      256       0     100%    /snap/gtk2-common-themes/9
/dev/loop1    67M       67M       0     100%    /snap/p8x-onenote/66
/dev/loop0    92M       92M       0     100%    /snap/core/8689
.
.
/dev/loop14   256K     256K       0     100%    /snap/gtk2-common-themes/5
tmpfs         1.6G        0     1.6G      0%    /run/user/1000


ls -al /boot
total 102224
drwxr-xr-x 4  root root   4096  feb 20 06:08
drwxr-xr-x 25 root root   4096  feb 19 06:34
-rw-r--r-- 1  root root 217495  jan 17 13:59 config-4.15.0-76-generic
-rw-r--r-- 1  root root 217495  feb 11 18:53 config-4.15.0-88-generic
drwr-xr-x  5  root root   4096  feb 20 06:02 grub


ls -alS /tmp
total 192
drwxrwxrt  14 root root 139264 mar 8 16:39  .
drwxr-xr-x 25 root root   4096 feb 19 06:34 ..
drwxrwxrwt 2  root root   4096 mar 8 15:23 .font-unix
drwxwxrwt  2  root root   4096 mar 8 15:23 .ICE-unix
drwx-----  2  root root   4096 mar 8 15:24 doise-PKdhtxMeriun

ls -alS /var/log (# ...this filp fast, so cannot see first few lines)
4 drwxr-xr-x  4 root  root  4096 feb 21 2017 boot
60 -rw-r--r-- 1 root  root 59365 oct 12 2016 boostrap
4 -rw-rw---- 1  root  utmp  3840  mar 8  00:07 btmp.1

ls -al /home
total 20
drwxr-xr-x  5  root      root      4096  jul 17 2018  .
drwxr-xr-x 25  root      root      4096  feb  19  06:34 ..
drwxr-xr-x 59  akil      akil      4096  mar 8 08:32 akil
drwxr-xr-x 48   it         it      4096  feb 11 10:24 it
drwxr-xr-x 23 josepintor jpsepinto 4096 jul 17 2018 josepintor

EDID 2

ls -al /boot
total 102224
drwxr-xr-x 4  root root   4096  feb 20 06:08
drwxr-xr-x 25 root root   4096  feb 19 06:34
-rw-r--r-- 1  root root 217495  jan 17 13:59 config-4.15.0-76-generic
-rw-r--r-- 1  root root 217495  feb 11 18:53 config-4.15.0-88-generic
drwr-xr-x  5  root root   4096  feb 20 06:02 grub
drwxr-xe-x 4  root root   4096  feb 21 2017 grub.bak
-rw--r--r--1  root root   39379455 feb 6 06:52 initrd.img-4.15.0-76-generic
-rw-r--r-- 1 root root 39885351  feb 19 06:52 initrd.img-4-15.0-88-generic
-rw-r--r-- 1 root root 182704  jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 184380 jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 184840 jan 28  2016 memtest86+_multboot.bin
-rw------- 1 root root 40688355 jan 17 3:59 System.map-4.15.0-76-generic
-rw------- 1 root root 4063510 feb 11 18:53 System.map-4.15.0-88-generic
-rw------- 1 root root 8367768 jan 17 vmlinuz-415.0-76-generic
-rw------- 1 root root 8371864 feb 11 18:57 vmlinuz-4.15.0-88-generic


ls -alS /var/log
total 6084
-rw-r----  1 syslog   adm     1528831  mar  8 00:07 syslog.1
-rw-r----  1 syslog   adm      962690  mar  7 23:29 kern.log.1
-rw-r--r-- 1  root    root   717322    mar  8 15:24 boot.log
-rw-r--r-- 1  root    root   352885    agu 19 2019 vnetlib
-rw-rw-r-- 1  root    utmp   292876    mar  8 00:05  auth.log.1

编辑-3

现在可以访问 GRUB 菜单。我选择了这个Drop to root shell prompt选项。但是大约 5 分钟,我收到的消息如下(光标闪烁)

Starting stop unreadahead data collection...
[ OK ] Started stop unreadahead data collection.
[ TIME ] Timed out waiting for device dev-di...04\x2dbef2\x2deed7474e2fbd.devce.
[ DEPEND ] dependency failed for /dev/disk/by-...0c431-1324-4004-bef2-eed7474e2fdb.
-

然后光标闪烁,

编辑 4

sudo blkid
/dev/sda1: UUID="6c987832-52fb-49e2-86fd-9cf24992511c" TYPE="ext4" PARTUUID="e9461ec-01"
/dev/sda2: UUID="a2c7d786-bda1-4b83-99f1-fca3b4c05bcb" TYPE="swap" PARTUUID="e946b1ec-02"

cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a 
# device; 
#....
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=6c987832-52fb-49e2-86fd-9cf24992511c / ext4  errors=remount -ro 0 1
# swap was on /dev/sda2 during installation
UUID=a2c7d786-bda1-4b83-99f1-fca3b4c05bcb none swap sw 0 0
/dev/fd0  /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

dpkg -l *readahead*
Desired=Unkonwn/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
| / Err?=(none)/Reinst-required (Status, Err: uppercase=bad)
||/ Name         Version       Architecture      Description
+++==============================================================
un readahead     <none>         <none>        (no description available)
ii unreadahead  0.100.0-21       amd64      Read required files in advance

我在用 Ubuntu 18.04

在此处输入图片说明

在此处输入图片说明 编辑 5

降落在这里,关于重新启动.. 在此处输入图片说明

编辑-6

在答案的第 3 步中:

dpkg -l linux-* | grep -e ii | grep -e "-76"
ii linux-headers-4.4.15-76  4.15-76.86 all Header files related to Linux kernel version 4.15.0
ii linux-headers-4.15.0-76-generic  4.15.0-76.86 amd64 Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii linux-image-4.15.0-76-generic 4.15.0-76.86 amd64 Signed kernel image generic
ii linux-modules-4.15.0-76-generic 4.15.0-76.86 amd64 Linux kernel extra modules for version 4.15.0-76.86 SMP
ii linux-modules-extra-4.15.0-76-generic 4.15.9-76.86 amd64 Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP

编辑 7

    df -h
    Filesystem     Size     Used     Avail   Use% Mounted on
    udev           7.8G       0      7.8G      0    /dev
    tmpfs          1.6G     1.1M     1.6G      1%   /run
    /dev/sda1      422G     402G        0     100%   /
    tmpfs          7.8G       0       7.8G     0%   /dev/shm
    tmpfs          5.0M      4,0K    5.0M      1%   /run/lock
    tmpfs          7.8G       0      7.8G     0%    /sys/fs/cgroup

    ls -al /boot
    total 102224
    drwxr-xr-x    4    root    root     4096    feb   20 06:03
    drwxr-xr-x   25    root    root     4096    mar    9 14:10
    -rw-r--r--    1   root    root    217495    jan  17   13:59 config-4.15.0-76-generic
    -rw-r--r--    1   root    root    217495    feb  11 18:53 config-4.15.0-88-generic

drwxr-xr-x    5   root    root     4096     feb   20   06:02  grub
drwxr-xr-x    5   root    root     4096     feb   21   2017  grub.bak
-rw-r--r--    1   root    root   39379455   feb    6   06:53 initrd.img-4.15.0-76-generic
....
......
海尼玛

步骤1:

在恢复模式下,在#提示下,执行以下操作...

sudo pico /etc/fstab #编辑这个文件

改变这个:

/dev/fd0  /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

对此:

#/dev/fd0  /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

Control+o然后Enter# 写出文件

Control+ x# 退出 pico 编辑器

reboot

第2步:

Either TeamViewer in, or boot to a Ubuntu Live DVD/USB, and start the Disk Usage Analyzer application (this may be called something different on Lubuntu). A few clicks, and you can determine what's eating up your hard disk, and we can take the next step.

Disk Usage Analyzer is accessed from the GUI, but on Lubuntu it may not be installed by default, and you don't have the disk space to install it. The Ubuntu Live DVD/USB is what you used to install Lubuntu originally. If you don't have it any more, download the Ubuntu (not Lubuntu) image and create a Ubuntu Live DVD/USB which will have Disk Usage Anayzer already installed on it.

Step #3:

To try an clear a little disk space...

In the terminal...

dpkg -l linux-* | grep -e ii | grep -e "-76"

You should end up with 4-5 filenames. If it's more, then stop and tell me what you see. Then do...

sudo dpkg -P put_one_filename_here

并对之前显示的 4-5 个文件名重复此操作。

您现在可以正常启动了。清理工作仍在继续。

第四步:

让我们确保您没有文件系统问题...

  • 启动到 Ubuntu Live DVD/USB
  • terminalCtrl+ Alt+打开一个窗口T
  • 类型 sudo fdisk -l
  • 确定您的“Linux 文件系统”的 /dev/sdXX 设备名称
  • 键入sudo fsck -f /dev/sdXX,替换sdXX为您之前找到的数字
  • fsck如果有错误,请重复该命令
  • 类型 reboot

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章