update-initramfs 的问题(修复内核崩溃)

update-initramfs 的问题(修复内核崩溃)

我在 dist 升级期间遇到了这个问题,笔记本电脑关闭后进入了休眠状态。此后,我尝试从终端修复它,但情况变得更糟。我破坏了内核:

I have  Kernel Panic- not syncing: VFS: Unable to mount root fs on unknown block (0,0)

我没有旧内核,因此我尝试在 ubuntu 下修复它:

    ubuntu@ubuntu:~$ sudo mount /dev/mapper/ubuntu--vg-root /mnt
ubuntu@ubuntu:~$ ls /mnt
bin  boot  cdrom  dev  etc  home  initrd.img  initrd.img.old  lib  lib32  lib64  libx32  lost+found  media  mnt  opt  proc  root  run  sbin  snap  srv  sys  tmp  usr  var  vmlinuz  vmlinuz.old
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount --bind /dev/pts /mnt/dev/pts/
ubuntu@ubuntu:~$ sudo mount --bind /proc/ /mnt/proc/
ubuntu@ubuntu:~$ sudo mount --bind /sys/ /mnt/sys/
ubuntu@ubuntu:~$ sudo chroot /mnt

root@ubuntu:/# uname -a
Linux ubuntu 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu:/# update-initramfs -u -k 5.4.0-26-generic
update-initramfs: Generating /boot/initrd.img-5.4.0-26-generic
W: missing /lib/modules/5.4.0-26-generic
W: Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/5.4.0-26-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
cat: /var/tmp/mkinitramfs_dJX3nM/lib/modules/5.4.0-26-generic/modules.builtin: Datei oder Verzeichnis nicht gefunden
W: Can't find modules.builtin.modinfo (for locating built-in drivers' firmware, supported in Linux >=5.2)
depmod: WARNING: could not open modules.order at /var/tmp/mkinitramfs_dJX3nM/lib/modules/5.4.0-26-generic: No such file or directory
depmod: WARNING: could not open modules.builtin at /var/tmp/mkinitramfs_dJX3nM/lib/modules/5.4.0-26-generic: No such file or directory

有什么建议吗?谢谢!

编辑:@nobody,您能看看这个输出吗:

# dpkg -i linux-modules-5.4.0-26-generic_5.4.0-26.30_amd64.deb
Vormals nicht ausgewähltes Paket linux-modules-5.4.0-26-generic wird gewählt.
(Lese Datenbank ... 252292 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von linux-modules-5.4.0-26-generic_5.4.0-26.30_amd64.deb ...
Entpacken von linux-modules-5.4.0-26-generic (5.4.0-26.30) ...
linux-modules-5.4.0-26-generic (5.4.0-26.30) wird eingerichtet ...
root@ubuntu:/# apt update && apt -f install
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:2 http://de.archive.ubuntu.com/ubuntu jammy InRelease                    
Ign:3 http://archive.ubuntu.com/ubuntu jammy InRelease                       
Ign:4 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease            
Ign:5 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Ign:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:7 http://de.archive.ubuntu.com/ubuntu xenial InRelease
Ign:8 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:2 http://de.archive.ubuntu.com/ubuntu jammy InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:7 http://de.archive.ubuntu.com/ubuntu xenial InRelease
Ign:8 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:2 http://de.archive.ubuntu.com/ubuntu jammy InRelease
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Ign:7 http://de.archive.ubuntu.com/ubuntu xenial InRelease
Ign:8 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Fehl:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
  »security.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:3 http://archive.ubuntu.com/ubuntu jammy InRelease
  »archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:5 http://archive.ubuntu.com/ubuntu jammy-security InRelease
  »archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:2 http://de.archive.ubuntu.com/ubuntu jammy InRelease
  »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:4 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease
  »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:7 http://de.archive.ubuntu.com/ubuntu xenial InRelease
  »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:8 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease
  »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
  »archive.ubuntu.com« konnte nicht aufgelöst werden.
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Alle Pakete sind aktuell.
W: Fehlschlag beim Holen von http://de.archive.ubuntu.com/ubuntu/dists/jammy/InRelease »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
W: Fehlschlag beim Holen von http://de.archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
W: Fehlschlag beim Holen von http://de.archive.ubuntu.com/ubuntu/dists/xenial/InRelease »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
W: Fehlschlag beim Holen von http://de.archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease »de.archive.ubuntu.com« konnte nicht aufgelöst werden.
W: Fehlschlag beim Holen von http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease »security.ubuntu.com« konnte nicht aufgelöst werden.
W: Fehlschlag beim Holen von http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease »archive.ubuntu.com« konnte nicht aufgelöst werden.
W: Fehlschlag beim Holen von http://archive.ubuntu.com/ubuntu/dists/jammy-security/InRelease »archive.ubuntu.com« konnte nicht aufgelöst werden.
W: Fehlschlag beim Holen von http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease »archive.ubuntu.com« konnte nicht aufgelöst werden.
W: Einige Indexdateien konnten nicht heruntergeladen werden. Sie wurden ignoriert oder alte an ihrer Stelle benutzt.
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

源.列表:

root@ubuntu:/# cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04.1 LTS _Xenial Xerus_ - Release amd64 (20160719)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://de.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial universe
deb http://de.archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://de.archive.ubuntu.com/ubuntu/ jammy multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://de.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://de.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse


deb http://security.ubuntu.com/ubuntu jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
deb http://archive.ubuntu.com/ubuntu jammy main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu jammy-security main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu jammy-updates main universe restricted multiverse

[更新]:修复 chroot 中的互联网连接问题:sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

@nobody 我按照你的建议做了,最后一条命令:

root@ubuntu:/# apt -f install
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

下一步该怎么做?我现在应该再跑一次吗update-initramfs

[编辑] 我照做了update-initramfs,但不幸update grub 的是内核 Panik 仍然存在:有什么办法可以解决这个问题吗? 内核恐慌 - 未同步:VFS:无法在未知块 (0,0) 上挂载根文件系统

相关内容