Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1645  / 3 Years ago, thu, may 13, 2021, 3:34:15

I am running dual boot Windows 10 and Ubuntu 18.04 LTS with NVIDIA GPU:s and stupidly forced my computer to shut down during an Ubuntu apt installation, as I mistook it for a crash (screen turned black followed by a terminal) without looking too much into it. Since this, I have not been able to use as the system freezes entirely when reaching the login screen (I am already using nomodeset). Booting into recovery mode from GRUB menu does not work either, it freezes upon getting the recovery menu.


Attempts of Fixing


To try to fix this, I managed to boot directly into a root bash session by pressing e in GRUB when booting Ubuntu and appending rw init=/bin/bash to the line beginning with linux. From here I was able to remove some unrelated datasets to free up space on my hard drive, and then ran dpkg --configure -a. After this, trying to boot my Ubuntu on my default latest kernel still does not work, but instead of freezing at login it stops at an initramfs terminal that says gave up waiting for root file system device.


After trying the suggested diagnostics given by initramfs, increasing rootdelay did not work, and /proc/modules was empty, and ls /dev did not show stuff like sda. No luck there.


I then tried to boot from a previous kernel (my latest kernel is 4.15.0.151 and the previous kernel is 4.15.0.147), and I do manage to not get stuck at initramfs, but now I again get a freeze at login. This is as far as I have gotten in trying to fix things, and hopefully it hasn't ruined stuff for me. Booting recovery mode via the GRUB menu on this kernel still does not work, but booting directly to a root bash session works (have not tried gaining internet access in this root bash session, not sure how to do so).


Right now, I have managed to boot an 18.04 LTS installer from a USB. This does not have the option to reinstall with existing file system, but it does allow me to access the file system, which seems to work just fine. I was able to access logs for apt that occurred right before I first forced shut down during apt installations, and below are logs for the day of the apt install. Note that in both of these logs, at the end, they are interrupted. I also see that it was interrupted during nvidia updates, and that some initramfs was deferred but intended to be modified right before being interrupted (could explain the initramfs issues I am having when booting on 4.15.0.151).


Question


I am wondering if it is possible for me to save my existing Ubuntu installation, maybe by rolling back the apt installations or somehow restoring or fixing the initramfs stuff, or even just getting the previous kernel 4.15.0.147 to work?


Any help is greatly appreciated! Let me know if any other logs are needed.


Logs


/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)

EDIT 1: After running sudo fsck UUID=<uuid of my unmounted target file system>, the result is /dev/nvme0n1p5: clean, 1322236/9601024 files, 32166204/38392320 blocks


More From » 18.04

 Answers
5

My suspicions were correct; my system wanted to install new nvidia drivers (and it also decided to upgrade to a new kernel while at it I think but not as sure on this one). When I interrupted the installation by forcing shutdown, the installation was in the process of writing to initrd.img using update-initramfs. Hence the "freeze at login screen" and "stuck at initramfs" - they were both signs of what was wrong!


I managed to fix it and gain complete control of my original Ubuntu system including the original filesystem :) here's how I did it:


DISCLAIMER


Try this at your own risk! I did this while not caring if my original Ubuntu filesystem breaks. Having said that, this worked fine for me and I never actually felt as if my filesystem was at risk of breaking. And in the end it didn't break as far as I know - the filesystem was not broken before I did this (see EDIT 1 with fsck in the question) and is not broken after. You should make sure that the filesystem itself is not broken if you want to try this fix.


Fix


In summary, my fix involved using an Ubuntu install USB and use the trial version to access the filesystem and fix its broken apt installations. Please read the full fix before attempting it!


First, I got the Ubuntu bootable USB stick that I used to install Ubuntu in the first place (you can just re-download this from the Ubuntu website if you no longer have it, try to have the same Ubuntu-version though, 18.04 LTS in my case). I inserted it into the computer and, through BIOS, selected the USB stick as the boot option. Then, I was presented with GRUB from the USB stick, and selected the "Try Ubuntu" option. This starts a "trial version" of Ubuntu.


From here, I followed parts of this link to find the filesystem of my original Ubuntu system (the one I want to recover, not the trial version), mount it and prepare it so that I can update apt stuff on that filesystem.



I actually went through all instructions in that tutorial at first, but it did not fix my problem. However, the steps I outlined below are what I did to fix things and they worked for me.



For the sake of completeness, I will summarize the parts I followed below:



  1. Start a terminal using Ctrl+Alt+T. Go to root by doing cd /.

  2. Use sudo fdisk -l to find out what your filesystem path is (in my case it was /dev/nvme0n1p5 but it can also be /dev/sdaX for some number X).

  3. Use sudo mount <path from step 2> /mnt (again, in my case the path was /dev/nvme0n1p5). This mounts the filesystem of the original Ubuntu system so that it is accessible from the trial Ubuntu through /mnt.

  4. Use sudo mount --bind /dev /mnt/dev, sudo mount --bind /proc /mnt/proc and sudo mount --bind /sys /mnt/sys. No idea why this is done but I did it to follow the tutorial and it worked for me.

  5. Use sudo chroot /mnt to create a temporary environment that has the original filesystem as the root. I would imagine this helps reconfiguration occur properly and not on the trial system.


Now, you should have a terminal prompt # that waits for further instructions. This means you are in the temporary environment with changed root.


From here, I followed parts of this tutorial to fix my messed up apt installations and initramfs. I did NOT do the stuff from that tutorial that is related to locks. To summarize, I did the following from this tutorial:



  1. Use sudo dpkg --configure -a

  2. Use sudo apt clean

  3. Use sudo apt update --fix-missing

  4. Use sudo apt install -f

  5. Use sudo dpkg --configure -a (yes, again according to their tutorial :p)

  6. Use sudo apt upgrade

  7. Use sudo apt dist-upgrade

  8. If you see any trouble with things not being upgraded or installed, look up what the error related to that trouble is, and how to fix that so you can successfully upgrade.


After doing this, you should be able to get your NVIDIA drivers upgraded and it should also generate a clean initrd.img file which is what caused the "stuck at initramfs" problem for me! Finally, to finish up and reboot, I did the following cleanup described in the first tutorial:



  1. Use update-grub

  2. Use exit to exit the temporary environment with changed root; you should now have a "standard" terminal prompt and be out of the environment.

  3. Use sudo umount /mnt/dev

  4. Use sudo umount /mnt/proc

  5. Use sudo umount /mnt/sys

  6. Use sudo umount /mnt


This unmounts the original filesystem. I then turned off the computer, booted up GRUB for my original Ubuntu system (not the trial Ubuntu bootable USB), and selected the normal first option.


And it worked! No freezes and no being stuck at initramfs. :)


Hope this helps someone, but remember the disclaimer!


[#1323] Thursday, May 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
urvedcaly

Total Points: 171
Total Questions: 118
Total Answers: 124

Location: Cape Verde
Member since Fri, Nov 27, 2020
4 Years ago
urvedcaly questions
Tue, Nov 8, 22, 19:40, 2 Years ago
Fri, May 26, 23, 15:27, 1 Year ago
Wed, Jan 19, 22, 08:09, 2 Years ago
Wed, Sep 14, 22, 16:14, 2 Years ago
;