我运行的是双启动 Windows 10 和 Ubuntu 18.04 LTS,带有 NVIDIA GPU:s,在 Ubuntu apt 安装过程中愚蠢地强制关闭我的电脑,因为我误以为这是一次崩溃(屏幕变黑,然后出现终端),而没有仔细查看。从那以后,我一直无法使用,因为系统在到达登录屏幕时完全冻结(我已经在使用 nomodeset)。从 GRUB 菜单启动到恢复模式也不起作用,它在获取恢复菜单时冻结。
修复尝试
为了解决这个问题,我设法通过e
在启动 Ubuntu 时按下 GRUB 并附加到rw init=/bin/bash
以 linux 开头的行来直接启动到 root bash 会话。从这里,我可以删除一些不相关的数据集以释放硬盘空间,然后运行dpkg --configure -a
。在此之后,尝试在我的默认最新内核上启动我的 Ubuntu 仍然不起作用,但它没有在登录时冻结,而是停在一个initramfs
显示 的终端上gave up waiting for root file system device
。
在尝试了 initramfs 给出的建议诊断后,增加 rootdelay 不起作用,/proc/modules 为空,ls /dev 没有显示 sda 之类的内容。没有运气。
然后我尝试从以前的内核启动(我的最新内核是 4.15.0.151,以前的内核是 4.15.0.147),我确实设法没有卡在 initramfs 上,但现在我再次在登录时冻结。这是我尝试修复问题所能达到的程度,希望它没有毁了我的东西。通过此内核上的 GRUB 菜单启动恢复模式仍然不起作用,但直接启动到 root bash 会话可以工作(没有尝试在此 root bash 会话中获取互联网访问权限,不确定如何这样做)。
现在,我已经设法从 USB 启动了 18.04 LTS 安装程序。它没有使用现有文件系统重新安装的选项,但它允许我访问文件系统,这似乎工作得很好。我能够访问在 apt 安装期间第一次强制关闭之前发生的 apt 日志,下面是 apt 安装当天的日志。请注意,在这两个日志中,最后它们都被中断了。我还看到它在 nvidia 更新期间被中断,并且一些 initramfs 被推迟但打算在被中断之前进行修改(可以解释我在 4.15.0.151 上启动时遇到的 initramfs 问题)。
问题
我想知道我是否可以保存现有的 Ubuntu 安装,也许通过回滚 apt 安装或以某种方式恢复或修复 initramfs 内容,或者甚至只是让之前的内核 4.15.0.147 工作?
非常感谢您的帮助!如果需要其他日志,请告诉我。
日志
/var/log/apt/term.log
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../libnss-myhostname_237-3ubuntu10.49_amd64.deb ...
Unpacking libnss-myhostname:amd64 (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Setting up libnss-myhostname:amd64 (237-3ubuntu10.49) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Log ended: 2021-07-21 10:05:51
Log started: 2021-07-21 10:05:54
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../libnvidia-common-460_460.91.03-0ubuntu0.18.04.1_all.deb ...
Unpacking libnvidia-common-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Setting up libnvidia-common-460 (460.91.03-0ubuntu0.18.04.1) ...
Log ended: 2021-07-21 10:05:55
Log started: 2021-07-21 10:05:58
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../linux-libc-dev_4.15.0-151.157_amd64.deb ...
Unpacking linux-libc-dev:amd64 (4.15.0-151.157) over (4.15.0-147.151) ...
Setting up linux-libc-dev:amd64 (4.15.0-151.157) ...
Log ended: 2021-07-21 10:05:58
Log started: 2021-07-21 10:06:02
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../linux-signed-generic_4.15.0.151.139_amd64.deb ...
Unpacking linux-signed-generic (4.15.0.151.139) over (4.15.0.147.134) ...
Setting up linux-signed-generic (4.15.0.151.139) ...
Log ended: 2021-07-21 10:06:02
Log started: 2021-07-21 10:06:07
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_237-3ubuntu10.49_amd64.deb ...
Unpacking systemd-sysv (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Setting up systemd-sysv (237-3ubuntu10.49) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Log ended: 2021-07-21 10:06:08
Log started: 2021-07-21 10:06:12
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../libudev-dev_237-3ubuntu10.49_amd64.deb ...
Unpacking libudev-dev:amd64 (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Preparing to unpack .../udev_237-3ubuntu10.49_amd64.deb ...
Unpacking udev (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Preparing to unpack .../libudev1_237-3ubuntu10.49_amd64.deb ...
Unpacking libudev1:amd64 (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Setting up libudev1:amd64 (237-3ubuntu10.49) ...
Setting up udev (237-3ubuntu10.49) ...
update-initramfs: deferring update (trigger activated)
Setting up libudev-dev:amd64 (237-3ubuntu10.49) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Processing triggers for systemd (237-3ubuntu10.44) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
ureadahead will be reprofiled on next reboot
Processing triggers for initramfs-tools (0.130ubuntu3.11) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-147-generic
Log ended: 2021-07-21 10:06:24
Log started: 2021-07-21 10:06:27
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../libnss-systemd_237-3ubuntu10.49_amd64.deb ...
Unpacking libnss-systemd:amd64 (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Preparing to unpack .../libpam-systemd_237-3ubuntu10.49_amd64.deb ...
Unpacking libpam-systemd:amd64 (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Preparing to unpack .../systemd_237-3ubuntu10.49_amd64.deb ...
Unpacking systemd (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Preparing to unpack .../libsystemd0_237-3ubuntu10.49_amd64.deb ...
Unpacking libsystemd0:amd64 (237-3ubuntu10.49) over (237-3ubuntu10.44) ...
Setting up libsystemd0:amd64 (237-3ubuntu10.49) ...
Setting up systemd (237-3ubuntu10.49) ...
Setting up libnss-systemd:amd64 (237-3ubuntu10.49) ...
Setting up libpam-systemd:amd64 (237-3ubuntu10.49) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1.2) ...
Processing triggers for ureadahead (0.100.0-21) ...
Log ended: 2021-07-21 10:06:31
Log started: 2021-07-21 10:06:34
Selecting previously unselected package linux-modules-4.15.0-151-generic.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 427029 files and directories currently installed.)
Preparing to unpack .../0-linux-modules-4.15.0-151-generic_4.15.0-151.157_amd64.deb ...
Unpacking linux-modules-4.15.0-151-generic (4.15.0-151.157) ...
Selecting previously unselected package linux-image-4.15.0-151-generic.
Preparing to unpack .../1-linux-image-4.15.0-151-generic_4.15.0-151.157_amd64.deb ...
Unpacking linux-image-4.15.0-151-generic (4.15.0-151.157) ...
Selecting previously unselected package linux-modules-extra-4.15.0-151-generic.
Preparing to unpack .../2-linux-modules-extra-4.15.0-151-generic_4.15.0-151.157_amd64.deb ...
Unpacking linux-modules-extra-4.15.0-151-generic (4.15.0-151.157) ...
Preparing to unpack .../3-linux-generic_4.15.0.151.139_amd64.deb ...
Unpacking linux-generic (4.15.0.151.139) over (4.15.0.147.134) ...
Preparing to unpack .../4-linux-image-generic_4.15.0.151.139_amd64.deb ...
Unpacking linux-image-generic (4.15.0.151.139) over (4.15.0.147.134) ...
Selecting previously unselected package linux-headers-4.15.0-151.
Preparing to unpack .../5-linux-headers-4.15.0-151_4.15.0-151.157_all.deb ...
Unpacking linux-headers-4.15.0-151 (4.15.0-151.157) ...
Selecting previously unselected package linux-headers-4.15.0-151-generic.
Preparing to unpack .../6-linux-headers-4.15.0-151-generic_4.15.0-151.157_amd64.deb ...
Unpacking linux-headers-4.15.0-151-generic (4.15.0-151.157) ...
Preparing to unpack .../7-linux-headers-generic_4.15.0.151.139_amd64.deb ...
Unpacking linux-headers-generic (4.15.0.151.139) over (4.15.0.147.134) ...
Setting up linux-modules-4.15.0-151-generic (4.15.0-151.157) ...
Setting up linux-headers-4.15.0-151 (4.15.0-151.157) ...
Setting up linux-headers-4.15.0-151-generic (4.15.0-151.157) ...
/etc/kernel/header_postinst.d/dkms:
* dkms: running auto installation service for kernel 4.15.0-151-generic
Kernel preparation unnecessary for this kernel. Skipping...
applying patch disable_fstack-clash-protection_fcf-protection.patch...patching file Kbuild
Hunk #1 succeeded at 82 (offset 11 lines).
Building module:
cleaning build area...
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'make' -j8 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=4.15.0-151-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/4.15.0-151-generic/build LD=/usr/bin/ld.bfd modules........
Signing module:
- /var/lib/dkms/nvidia/460.80/4.15.0-151-generic/x86_64/module/nvidia.ko
- /var/lib/dkms/nvidia/460.80/4.15.0-151-generic/x86_64/module/nvidia-drm.ko
- /var/lib/dkms/nvidia/460.80/4.15.0-151-generic/x86_64/module/nvidia-modeset.ko
- /var/lib/dkms/nvidia/460.80/4.15.0-151-generic/x86_64/module/nvidia-uvm.ko
Secure Boot not enabled on this system.
cleaning build area...
DKMS: build completed.
nvidia.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
nvidia-modeset.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
nvidia-drm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
nvidia-uvm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
depmod...
DKMS: install completed.
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.15.0-151-generic -C /lib/modules/4.15.0-151-generic/build M=/var/lib/dkms/virtualbox/5.2.42/build.....
Signing module:
- /var/lib/dkms/virtualbox/5.2.42/4.15.0-151-generic/x86_64/module/vboxnetadp.ko
- /var/lib/dkms/virtualbox/5.2.42/4.15.0-151-generic/x86_64/module/vboxpci.ko
- /var/lib/dkms/virtualbox/5.2.42/4.15.0-151-generic/x86_64/module/vboxdrv.ko
- /var/lib/dkms/virtualbox/5.2.42/4.15.0-151-generic/x86_64/module/vboxnetflt.ko
Secure Boot not enabled on this system.
cleaning build area...
DKMS: build completed.
vboxdrv.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
vboxnetadp.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
vboxnetflt.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
vboxpci.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-151-generic/updates/dkms/
depmod...
DKMS: install completed.
...done.
Setting up linux-headers-generic (4.15.0.151.139) ...
Setting up linux-image-4.15.0-151-generic (4.15.0-151.157) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.15.0-147-generic
I: /initrd.img.old is now a symlink to boot/initrd.img-4.15.0-147-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-4.15.0-151-generic
I: /initrd.img is now a symlink to boot/initrd.img-4.15.0-151-generic
Setting up linux-modules-extra-4.15.0-151-generic (4.15.0-151.157) ...
Setting up linux-image-generic (4.15.0.151.139) ...
Setting up linux-generic (4.15.0.151.139) ...
Processing triggers for linux-image-4.15.0-151-generic (4.15.0-151.157) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 4.15.0-151-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-151-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-151-generic
Found initrd image: /boot/initrd.img-4.15.0-151-generic
Found linux image: /boot/vmlinuz-4.15.0-147-generic
Found initrd image: /boot/initrd.img-4.15.0-147-generic
Found linux image: /boot/vmlinuz-4.15.0-144-generic
Found initrd image: /boot/initrd.img-4.15.0-144-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Log ended: 2021-07-21 10:07:32
Log started: 2021-07-21 10:07:36
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 462584 files and directories currently installed.)
Preparing to unpack .../00-nvidia-driver-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking nvidia-driver-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../01-libnvidia-gl-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-gl-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../02-nvidia-dkms-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Removing all DKMS Modules
Done.
Unpacking nvidia-dkms-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../03-nvidia-kernel-source-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking nvidia-kernel-source-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../04-nvidia-kernel-common-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking nvidia-kernel-common-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../05-libnvidia-decode-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-decode-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../06-libnvidia-compute-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-compute-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../07-libnvidia-extra-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-extra-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../08-nvidia-compute-utils-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking nvidia-compute-utils-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../09-libnvidia-encode-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-encode-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../10-nvidia-utils-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking nvidia-utils-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../11-libnvidia-ifr1-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-ifr1-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../12-libnvidia-fbc1-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-fbc1-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../13-xserver-xorg-video-nvidia-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking xserver-xorg-video-nvidia-460 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Preparing to unpack .../14-libnvidia-cfg1-460_460.91.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libnvidia-cfg1-460:amd64 (460.91.03-0ubuntu0.18.04.1) over (460.80-0ubuntu0.18.04.2) ...
Setting up libnvidia-extra-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up libnvidia-fbc1-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up libnvidia-gl-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up libnvidia-ifr1-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up libnvidia-compute-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up nvidia-kernel-source-460 (460.91.03-0ubuntu0.18.04.1) ...
Setting up nvidia-utils-460 (460.91.03-0ubuntu0.18.04.1) ...
Setting up nvidia-kernel-common-460 (460.91.03-0ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
update-initramfs: Generating /boot/initrd.img-4.15.0-147-generic
Setting up libnvidia-cfg1-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up libnvidia-decode-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up nvidia-compute-utils-460 (460.91.03-0ubuntu0.18.04.1) ...
Setting up libnvidia-encode-460:amd64 (460.91.03-0ubuntu0.18.04.1) ...
Setting up xserver-xorg-video-nvidia-460 (460.91.03-0ubuntu0.18.04.1) ...
Setting up nvidia-dkms-460 (460.91.03-0ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
update-initramfs: Generating /boot/initrd.img-4.15.0-147-generic
/var/log/apt/history.log
Commandline: /usr/bin/unattended-upgrade
Upgrade: libnss-myhostname:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49)
End-Date: 2021-07-21 10:05:51
Start-Date: 2021-07-21 10:05:54
Commandline: /usr/bin/unattended-upgrade
Upgrade: libnvidia-common-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1)
End-Date: 2021-07-21 10:05:55
Start-Date: 2021-07-21 10:05:58
Commandline: /usr/bin/unattended-upgrade
Upgrade: linux-libc-dev:amd64 (4.15.0-147.151, 4.15.0-151.157)
End-Date: 2021-07-21 10:05:58
Start-Date: 2021-07-21 10:06:02
Commandline: /usr/bin/unattended-upgrade
Upgrade: linux-signed-generic:amd64 (4.15.0.147.134, 4.15.0.151.139)
End-Date: 2021-07-21 10:06:02
Start-Date: 2021-07-21 10:06:07
Commandline: /usr/bin/unattended-upgrade
Upgrade: systemd-sysv:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49)
End-Date: 2021-07-21 10:06:08
Start-Date: 2021-07-21 10:06:12
Commandline: /usr/bin/unattended-upgrade
Upgrade: udev:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49), libudev1:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49), libudev-dev:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49)
End-Date: 2021-07-21 10:06:24
Start-Date: 2021-07-21 10:06:27
Commandline: /usr/bin/unattended-upgrade
Upgrade: libsystemd0:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49), libpam-systemd:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49), systemd:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49), libnss-systemd:amd64 (237-3ubuntu10.44, 237-3ubuntu10.49)
End-Date: 2021-07-21 10:06:31
Start-Date: 2021-07-21 10:06:34
Commandline: /usr/bin/unattended-upgrade
Install: linux-headers-4.15.0-151-generic:amd64 (4.15.0-151.157, automatic), linux-modules-4.15.0-151-generic:amd64 (4.15.0-151.157, automatic), linux-image-4.15.0-151-generic:amd64 (4.15.0-151.157, automatic), linux-modules-extra-4.15.0-151-generic:amd64 (4.15.0-151.157, automatic), linux-headers-4.15.0-151:amd64 (4.15.0-151.157, automatic)
Upgrade: linux-headers-generic:amd64 (4.15.0.147.134, 4.15.0.151.139), linux-image-generic:amd64 (4.15.0.147.134, 4.15.0.151.139), linux-generic:amd64 (4.15.0.147.134, 4.15.0.151.139)
End-Date: 2021-07-21 10:07:32
Start-Date: 2021-07-21 10:07:36
Commandline: /usr/bin/unattended-upgrade
Upgrade: libnvidia-compute-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), libnvidia-encode-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), nvidia-kernel-common-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), xserver-xorg-video-nvidia-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), libnvidia-gl-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), libnvidia-fbc1-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), libnvidia-decode-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), libnvidia-cfg1-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), nvidia-utils-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), nvidia-dkms-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), nvidia-compute-utils-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), libnvidia-ifr1-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), nvidia-driver-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), libnvidia-extra-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1), nvidia-kernel-source-460:amd64 (460.80-0ubuntu0.18.04.2, 460.91.03-0ubuntu0.18.04.1)
编辑1:运行后sudo fsck UUID=<uuid of my unmounted target file system>
结果为/dev/nvme0n1p5: clean, 1322236/9601024 files, 32166204/38392320 blocks
答案1
我的怀疑是正确的;我的系统想要安装新的 nvidia 驱动程序(我想它还决定同时升级到新内核,但对此不太确定)。当我通过强制关机中断安装时,安装正在使用 update-initramfs 写入 initrd.img。因此,“登录屏幕冻结”和“卡在 initramfs” - 它们都是出现问题的迹象!
我设法修复了它并完全控制了我原来的 Ubuntu 系统,包括原始文件系统:) 以下是我的方法:
免责声明
请自行承担风险!我这样做的时候并不关心我原来的 Ubuntu 文件系统是否会崩溃。话虽如此,这对我来说效果很好,我从来没有真正感觉到我的文件系统有崩溃的风险。而且据我所知,它最终并没有崩溃 -在我执行此操作之前文件系统没有损坏(请参阅问题中的 EDIT 1 和 fsck),之后也没有损坏。如果您想尝试此修复,则应确保文件系统本身没有损坏。
使固定
总之,我的修复方法包括使用 Ubuntu 安装 USB 并使用试用版访问文件系统并修复其损坏的 apt 安装。在尝试之前,请阅读完整的修复程序!
首先,我拿到了最初安装 Ubuntu 时使用的 Ubuntu 可启动 USB 盘(如果您不再拥有它,可以从 Ubuntu 网站重新下载,但请尝试使用相同的 Ubuntu 版本,在我的情况下是 18.04 LTS)。我将其插入计算机,并通过 BIOS 选择 USB 盘作为启动选项。然后,我从 USB 盘中看到 GRUB,并选择“试用 Ubuntu”选项。这将启动 Ubuntu 的“试用版”。
从这里,我跟随部分的此链接找到我原来的 Ubuntu 系统(我想要恢复的,而不是试用版的)的文件系统,挂载它并准备好,以便我可以更新该文件系统上的 apt 内容。
我实际上一开始就按照了该教程中的所有说明,但并没有解决我的问题。不过,下面列出的步骤是我解决问题的方法,而且对我有用。
为了完整起见,我将在下面总结我所遵循的部分:
- 使用 Ctrl+Alt+T 启动终端。执行 转到 root 权限
cd /
。 - 用来
sudo fdisk -l
找出你的文件系统路径是什么(在我的情况下它是/dev/nvme0n1p5
但它也可以是/dev/sdaX
某个数字X)。 - 使用
sudo mount <path from step 2> /mnt
(同样,在我的情况下路径是/dev/nvme0n1p5
)。这将挂载原始 Ubuntu 系统的文件系统,以便可以通过从试用版 Ubuntu 访问它/mnt
。 - 使用
sudo mount --bind /dev /mnt/dev
、sudo mount --bind /proc /mnt/proc
和sudo mount --bind /sys /mnt/sys
。不知道为什么这样做,但我按照教程做了,而且对我来说很有效。 - 用于
sudo chroot /mnt
创建一个以原始文件系统为根的临时环境。我认为这有助于重新配置正确进行,而不是在试用系统上进行。
现在,您应该看到一个等待进一步指令的终端提示符#
。这意味着您处于具有已更改 root 权限的临时环境中。
从这里,我跟随部分的本教程修复我混乱的 apt 安装和 initramfs。我没有执行该教程中与锁相关的操作。总结一下,我执行了本教程中的以下操作:
- 使用
sudo dpkg --configure -a
- 使用
sudo apt clean
- 使用
sudo apt update --fix-missing
- 使用
sudo apt install -f
- 使用
sudo dpkg --configure -a
(是的,再次按照他们的教程:p) - 使用
sudo apt upgrade
- 使用
sudo apt dist-upgrade
- 如果您发现任何无法升级或安装的问题,请查找与该问题相关的错误是什么,以及如何修复该错误以便您可以成功升级。
完成此操作后,您应该能够升级 NVIDIA 驱动程序,并且它还应该生成一个干净的 initrd.img 文件,这就是导致我出现“卡在 initramfs”问题的原因!最后,为了完成并重新启动,我执行了第一个教程中描述的以下清理:
- 使用
update-grub
- 使用
exit
退出具有改变的根目录的临时环境;您现在应该有一个“标准”终端提示符并且退出环境。 - 使用
sudo umount /mnt/dev
- 使用
sudo umount /mnt/proc
- 使用
sudo umount /mnt/sys
- 使用
sudo umount /mnt
这将卸载原始文件系统。然后我关闭计算机,启动原始 Ubuntu 系统(不是试用版 Ubuntu 可启动 USB)的 GRUB,并选择正常的第一个选项。
并且成功了!没有冻结,也没有卡在 initramfs。:)
希望这对某些人有帮助,但请记住免责声明!
答案2
使用 4.15.0-151 两天来,我也遇到了很多麻烦。我的 Ubuntu 18.04 LTS 继续随机挂起。然后我需要在维护模式下重新启动,检查文件系统,修复错误,然后正常重新启动。几分钟内挂起 4 次后,我恢复到 4.15.0-147,它可以正常工作。版本 151 肯定有问题。
这是我在系统挂起强制重启后在日志中发现的内容。4.15.0-147 从未发生过这种情况:
lug 23 15:11:17 Lucifer kernel: BUG: unable to handle kernel paging request at ffff913c0fee15bc
lug 23 15:11:17 Lucifer kernel: IP: __kmalloc_node_track_caller+0x142/0x2b0
lug 23 15:11:17 Lucifer kernel: PGD 0 P4D 0
lug 23 15:11:17 Lucifer kernel: Oops: 0000 [#1] SMP PTI
lug 23 15:11:17 Lucifer kernel: Modules linked in: vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) ccm cmac rfcomm bnep zram binfmt_misc intel_rapl x86_pkg_tem
lug 23 15:11:17 Lucifer kernel: input_leds serio_raw fb_sys_fops snd_seq snd_seq_device syscopyarea snd_timer shpchp snd sysfillrect soundcore mei_me me
lug 23 15:11:17 Lucifer kernel: CPU: 0 PID: 10386 Comm: Socket Thread Tainted: P W OE 4.15.0-151-generic #157-Ubuntu
lug 23 15:11:17 Lucifer kernel: Hardware name: Acer Aspire E5-771G/EA70_HB, BIOS V1.07 06/04/2014
lug 23 15:11:17 Lucifer kernel: RIP: 0010:__kmalloc_node_track_caller+0x142/0x2b0
lug 23 15:11:17 Lucifer kernel: RSP: 0018:ffffad0500987bb8 EFLAGS: 00010282
lug 23 15:11:17 Lucifer kernel: RAX: ffff913c0fee15bc RBX: 00000000014102c0 RCX: ffffffff9d85a077
lug 23 15:11:17 Lucifer kernel: RDX: 000000000000a81a RSI: 0000000000000000 RDI: 0000000000026180
lug 23 15:11:17 Lucifer kernel: RBP: ffffad0500987bf8 R08: ffff91e25f226180 R09: ffff91e25a802d80
lug 23 15:11:17 Lucifer kernel: R10: 0000000000000000 R11: ffff91e25a802d80 R12: 00000000014102c0
lug 23 15:11:17 Lucifer kernel: R13: 0000000000000800 R14: 00000000ffffffff R15: ffff913c0fee15bc
lug 23 15:11:17 Lucifer kernel: FS: 00007f0e53755700(0000) GS:ffff91e25f200000(0000) knlGS:0000000000000000
lug 23 15:11:17 Lucifer kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
lug 23 15:11:17 Lucifer kernel: CR2: ffff913c0fee15bc CR3: 000000015460e001 CR4: 00000000001606f0
lug 23 15:11:17 Lucifer kernel: Call Trace:
lug 23 15:11:17 Lucifer kernel: ? __alloc_skb+0x87/0x1d0
lug 23 15:11:17 Lucifer kernel: __kmalloc_reserve.isra.43+0x31/0x90
lug 23 15:11:17 Lucifer kernel: ? tcp_v4_md5_lookup+0x13/0x20
lug 23 15:11:17 Lucifer kernel: __alloc_skb+0x87/0x1d0
lug 23 15:11:17 Lucifer kernel: sk_stream_alloc_skb+0x56/0x1f0
lug 23 15:11:17 Lucifer kernel: tcp_sendmsg_locked+0x515/0xec0
lug 23 15:11:17 Lucifer kernel: tcp_sendmsg+0x2c/0x50
lug 23 15:11:17 Lucifer kernel: inet_sendmsg+0x2e/0xb0
lug 23 15:11:17 Lucifer kernel: sock_sendmsg+0x3e/0x50
lug 23 15:11:17 Lucifer kernel: SYSC_sendto+0x13f/0x180
lug 23 15:11:17 Lucifer kernel: ? SyS_futex+0x13b/0x180
lug 23 15:11:17 Lucifer kernel: SyS_sendto+0xe/0x10
lug 23 15:11:17 Lucifer kernel: do_syscall_64+0x73/0x130
lug 23 15:11:17 Lucifer kernel: entry_SYSCALL_64_after_hwframe+0x41/0xa6
lug 23 15:11:17 Lucifer kernel: RIP: 0033:0x7f0e53419a9e
lug 23 15:11:17 Lucifer kernel: RSP: 002b:00007f0e537540b0 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
lug 23 15:11:17 Lucifer kernel: RAX: ffffffffffffffda RBX: 00000000000000ac RCX: 00007f0e53419a9e
lug 23 15:11:17 Lucifer kernel: RDX: 0000000000000060 RSI: 00007f0e0f4a2000 RDI: 00000000000000ac
lug 23 15:11:17 Lucifer kernel: RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
lug 23 15:11:17 Lucifer kernel: R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0e0f4a2000
lug 23 15:11:17 Lucifer kernel: R13: 0000000000000060 R14: 0000000000000000 R15: 0000000000000000
lug 23 15:11:17 Lucifer kernel: Code: 4c 89 df 4c 89 5d c8 e8 bd ae 01 00 49 89 c1 4c 8b 5d c8 4d 85 c9 0f 85 35 ff ff ff 45 31 ff eb 4e 49 63 41 20 49 8
lug 23 15:11:17 Lucifer kernel: RIP: __kmalloc_node_track_caller+0x142/0x2b0 RSP: ffffad0500987bb8
lug 23 15:11:17 Lucifer kernel: CR2: ffff913c0fee15bc
lug 23 15:11:17 Lucifer kernel: ---[ end trace be1d19e661060db7 ]---
lug 23 15:11:17 Lucifer kernel: BUG: unable to handle kernel paging request at ffff913c0fee15bc
lug 23 15:11:17 Lucifer kernel: IP: __kmalloc_node_track_caller+0x142/0x2b0
lug 23 15:11:17 Lucifer kernel: PGD 0 P4D 0
lug 23 15:11:17 Lucifer kernel: Oops: 0000 [#2] SMP PTI
lug 23 15:11:17 Lucifer kernel: Modules linked in: vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) ccm cmac rfcomm bnep zram binfmt_misc intel_rapl x86_pkg_tem
lug 23 15:11:17 Lucifer kernel: input_leds serio_raw fb_sys_fops snd_seq snd_seq_device syscopyarea snd_timer shpchp snd sysfillrect soundcore mei_me me
lug 23 15:11:17 Lucifer kernel: CPU: 0 PID: 10382 Comm: IPC I/O Parent Tainted: P D W OE 4.15.0-151-generic #157-Ubuntu
lug 23 15:11:17 Lucifer kernel: Hardware name: Acer Aspire E5-771G/EA70_HB, BIOS V1.07 06/04/2014
lug 23 15:11:17 Lucifer kernel: RIP: 0010:__kmalloc_node_track_caller+0x142/0x2b0
lug 23 15:11:17 Lucifer kernel: RSP: 0018:ffffad0500753a98 EFLAGS: 00010282
lug 23 15:11:17 Lucifer kernel: RAX: ffff913c0fee15bc RBX: 00000000015102c0 RCX: ffffffff9d85a077
lug 23 15:11:17 Lucifer kernel: RDX: 000000000000a81a RSI: 0000000000000000 RDI: 0000000000026180
lug 23 15:11:17 Lucifer kernel: RBP: ffffad0500753ad8 R08: ffff91e25f226180 R09: ffff91e25a802d80
lug 23 15:11:17 Lucifer kernel: R10: ffffad0500753d58 R11: ffff91e25a802d80 R12: 00000000015102c0
lug 23 15:11:17 Lucifer kernel: R13: 0000000000000740 R14: 00000000ffffffff R15: ffff913c0fee15bc
lug 23 15:11:17 Lucifer kernel: FS: 00007f0e53818700(0000) GS:ffff91e25f200000(0000) knlGS:0000000000000000
lug 23 15:11:17 Lucifer kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
lug 23 15:11:17 Lucifer kernel: CR2: ffff913c0fee15bc CR3: 000000015460e003 CR4: 00000000001606f0
lug 23 15:11:17 Lucifer kernel: Call Trace:
lug 23 15:11:17 Lucifer kernel: ? __alloc_skb+0x87/0x1d0
lug 23 15:11:17 Lucifer kernel: __kmalloc_reserve.isra.43+0x31/0x90
lug 23 15:11:17 Lucifer kernel: __alloc_skb+0x87/0x1d0
lug 23 15:11:17 Lucifer kernel: alloc_skb_with_frags+0x56/0x1b0
lug 23 15:11:17 Lucifer kernel: ? wait_woken+0x80/0x80
lug 23 15:11:17 Lucifer kernel: sock_alloc_send_pskb+0x1f2/0x220
lug 23 15:11:17 Lucifer kernel: ? _cond_resched+0x19/0x40
lug 23 15:11:17 Lucifer kernel: ? wait_for_unix_gc+0x37/0xb0
lug 23 15:11:17 Lucifer kernel: unix_stream_sendmsg+0x1b6/0x390
lug 23 15:11:17 Lucifer kernel: sock_sendmsg+0x3e/0x50
lug 23 15:11:17 Lucifer kernel: ___sys_sendmsg+0x2a0/0x2f0
lug 23 15:11:17 Lucifer kernel: ? get_futex_key+0x2f7/0x3b0
lug 23 15:11:17 Lucifer kernel: ? touch_atime+0x36/0xe0
lug 23 15:11:17 Lucifer kernel: ? futex_wake+0x8f/0x180
lug 23 15:11:17 Lucifer kernel: ? do_futex+0x18f/0x4e0
lug 23 15:11:17 Lucifer kernel: __sys_sendmsg+0x54/0x90
lug 23 15:11:17 Lucifer kernel: ? __sys_sendmsg+0x54/0x90
lug 23 15:11:17 Lucifer kernel: SyS_sendmsg+0x12/0x20
lug 23 15:11:17 Lucifer kernel: do_syscall_64+0x73/0x130
lug 23 15:11:17 Lucifer kernel: entry_SYSCALL_64_after_hwframe+0x41/0xa6
lug 23 15:11:17 Lucifer kernel: RIP: 0033:0x7f0e5341a6f7
lug 23 15:11:17 Lucifer kernel: RSP: 002b:00007f0e538136d0 EFLAGS: 00000293 ORIG_RAX: 000000000000002e
lug 23 15:11:17 Lucifer kernel: RAX: ffffffffffffffda RBX: 000000000000007b RCX: 00007f0e5341a6f7
lug 23 15:11:17 Lucifer kernel: RDX: 0000000000000040 RSI: 00007f0e53813770 RDI: 000000000000007b
lug 23 15:11:17 Lucifer kernel: RBP: 00007f0e53813770 R08: 0000000000000000 R09: 00007f0df2bda380
lug 23 15:11:17 Lucifer kernel: R10: 00007f0df723c59c R11: 0000000000000293 R12: 0000000000000040
lug 23 15:11:17 Lucifer kernel: R13: 00007f0e53813750 R14: 00007f0e2a4db1a0 R15: 0000000000000001
lug 23 15:11:17 Lucifer kernel: Code: 4c 89 df 4c 89 5d c8 e8 bd ae 01 00 49 89 c1 4c 8b 5d c8 4d 85 c9 0f 85 35 ff ff ff 45 31 ff eb 4e 49 63 41 20 49 8
lug 23 15:11:17 Lucifer kernel: RIP: __kmalloc_node_track_caller+0x142/0x2b0 RSP: ffffad0500753a98
lug 23 15:11:17 Lucifer kernel: CR2: ffff913c0fee15bc
lug 23 15:11:17 Lucifer kernel: ---[ end trace be1d19e661060db8 ]---
lug 23 15:11:17 Lucifer kernel: BUG: unable to handle kernel paging request at ffff913c0fee15bc
lug 23 15:11:17 Lucifer kernel: IP: __kmalloc_node_track_caller+0x142/0x2b0