尝试从10.10升级到11.04时,一切似乎都进行得很顺利,直到重新启动。出现了以下错误信息:
Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
我们如何修复这个问题?
sudo update-initramfs -u -k version
来生成version
的initrd(将version
替换为内核版本字符串,例如4.15.0-36-generic
),最后运行sudo update-grub
。apt install initramfs-tools
才能使用update-initramfs
命令。 - yunspacesudo fdisk -l
sudo mount /dev/sdax /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
/boot
位于单独的分区上,请同时调用:sudo mount /dev/sday /mnt/boot
update-initramfs
和update-grub
了。update-initramfs -u -k 2.6.38-8-generic (or your version)
dpkg --list | grep linux-image
update-grub
sudo mount --bind /dev/pts /mnt/dev/pts
和 sudo mount --bind /sys /mnt/sys
;如果没有这样做,update-grub2
将会报错。 - Hbfls /mnt/boot
,查找最新的内核版本。或者如果你想做得更准确,请阅读 /mnt/boot/grub/grub.cfg
中的 menuentry 'Ubuntu'
。 - Ciro Santilli OurBigBook.cominitrd
文件在/boot
目录下找不到了。问题是:这个文件怎么可能突然消失了呢?我没有做任何看起来危险的操作。 - Ciro Santilli OurBigBook.com--bind
和chroot,所以您不需要-k
选项。 - Déjà vuupdate-initramfs: 生成 /boot/initrd.img-4.15.0.50.52 警告:缺少 /lib/modules/4.15.0.50.52 确保所有必要的驱动程序都已构建到 Linux 镜像中! depmod: 错误:无法打开目录 /lib/modules/4.15.0.50.52:没有该文件或目录 depmod: 致命错误:无法搜索模块:没有该文件或目录 depmod: 警告:无法打开 /var/tmp/mkinitramfs_ch6X8K/lib/modules/4.15.0.50.52/modules.order:没有该文件或目录
- JeanSibeliusupdate-initramfs
之前挂载文件系统。但是我正在使用全盘加密(在安装Ubuntu时选择的),所以挂载方式不同;尝试这样做会导致错误,主要是关于不存在的挂载点。 - DanielERROR (dkms apport): binary package for evdi: 1.12.0 not found
,搜索结果显示这与我不再使用的DisplayLink有关,所以我卸载了它,运行sudo displaylink-installer uninstall
,然后重新执行上述操作,问题得到解决。 - Waqleh内核崩溃 - 不同步:VFS:无法在未知块(0,0)上挂载根文件系统
听起来真的很糟糕,我已经准备好摧毁旧服务器并安装新的硬盘了。我只需要删除一些旧的内核。 - undefineddpkg --configure -a
就足够触发 update-initramfs 挂钩,并修复损坏的内核。 - Symmetric/boot
分区,是这样吗? - Ciro Santilli OurBigBook.com/boot
空间不足,你可以使用sudo apt-get autoremove
命令来删除旧的内核。 - Florian Bruckersudo apt-get autoremove
,再次重启(较旧的内核),然后执行了sudo apt-get dist-upgrade
,这样就解决了问题。这是在我的一台小型测试机上进行的。但是出现了相同的问题,/boot
100% 使用。 - jmlumpkin/dev/vda
下(v
是virtio的指示字母,如果它被分区,则分区将是/dev/vda1
,/dev/vda2
等)VFS:无法打开根设备“vda”或unknown-block(0,0):错误-6
。
然后,在请附加正确的“root=”引导选项;以下是可用的分区:
处,它给出了一个它可以读取的分区列表。
但在我们的情况下,由于下一行与此完全无关,所以列表为空。root=
内核命令行选项。
这很简单,只需传递正确的选项!内核甚至会给出它所知道的选项列表!
例如,如果我们传递一个不存在的错误选项:
root=/dev/vda2
内核会给出以下类型的错误:
<4>[0.608475] 请附加正确的“root=”引导选项;以下是可用的分区:
<4>[0.609563] fe00 524288 vda
<4>[0.609723] 驱动程序:virtio_blk
<0>[0.610433] 内核恐慌-不同步:VFS:无法在未知块(254,2)上挂载根文件系统
明确告诉我们“嘿:没有vda2,但有一个vda!”
这个例子也很好地解释了先前情况中的(0,0)
、(254,0)
和(254,2)
的含义:
(0,0):第一个数字0表示根本无法从磁盘读取
(254,2):254是分配给磁盘的某个ID。2是该ID内的分区,如/dev/vda2。而分区0表示sudo dpkg --configure -a
--configure package...|-a|--pending
Configure a package which has been unpacked but not yet configured. If -a or --pending is given instead of package, all unpacked but unconfigured packages are configured.
To reconfigure a package which has already been configured, try the dpkg-reconfigure(8) command instead.
Configuring consists of the following steps:
1. Unpack the conffiles, and at the same time back up the old conffiles, so that they can be restored if something goes wrong.
2. Run postinst script, if provided by the package.
Setting up linux-image-4.15.0-76-generic (4.15.0-76.86) ...
Processing triggers for initramfs-tools (0.130ubuntu3.9) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-74-generic
Processing triggers for linux-image-4.15.0-76-generic (4.15.0-76.86) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 4.15.0-76-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-76-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-76-generic
Found initrd image: /boot/initrd.img-4.15.0-76-generic
Found linux image: /boot/vmlinuz-4.15.0-74-generic
Found initrd image: /boot/initrd.img-4.15.0-74-generic
Found linux image: /boot/vmlinuz-4.15.0-72-generic
Found initrd image: /boot/initrd.img-4.15.0-72-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 on /dev/sda1
done
这是由于升级到LTS 20.04时发生了崩溃。
dpkg --configure -a
再次打开了恢复菜单,因此包没有被(重新)配置。
所以我不得不列出已安装的内核
dpkg --list | grep linux-kernel | more
并且专门配置新安装的内核:
dpkg --configure linux-kernel-5.20.0-52-generic
安装过程中卷上的空间不足:
dpkg --purge remove linux-kernel-<someOldVersion>
我不会立即选择“删除所有旧内核”,因为如果最新的内核出现问题,你还需要一些可用的来启动。
你的磁盘正在磨损 - 运行 smartctl --health --all
和 e2fsck ...
某个驱动程序导致整个操作系统挂起 - 对我来说,当在4K屏幕上播放4K电影时,nVidia驱动程序会出现这种情况。
/dev
挂载到/mnt/dev
上。 - Lekensteynapt-get remove linux-server
apt-get update
apt-get -f install
apt-get upgrade
sudo apt-get install linux-image-generic
来升级到最新的内核,从而解决了这个问题。 - Owendpkg --configure linux-kernel-<version>-generic
- 不要加上-a
,因为那会再次触发恢复菜单。请查看我的回答获取更多信息。 - Ondra Žižka