内核更新(Debian Stable/Jessie)后,我的系统无法启动。我通过安装 ubuntu 恢复了系统,ubuntu 加载程序让我可以启动 debian。
所以现在我试图让 debian 修复启动过程,但似乎 efibootmgr 无能为力:
目前状态如下:
# efibootmgr -v
BootCurrent: 0000
No BootOrder is set; firmware will attempt recovery
Boot0000* Ubuntu HD(1,800,fa000,c865d688-f250-471e-9d54-bad998d64e31)File(\EFI\ubuntu\grubx64.efi)RC
Boot0001* UEFI Onboard LAN IPv6 ACPI(a0341d0,0)PCI(1c,0)PCI(0,0)MAC(MAC(74867a15fbd5,0)030d3c000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000RC
Boot0002* UEFI Onboard LAN IPv4 ACPI(a0341d0,0)PCI(1c,0)PCI(0,0)MAC(MAC(74867a15fbd5,0)RC
Boot0004* Windows Boot Manager HD(1,800,fa000,c865d688-f250-471e-9d54-bad998d64e31)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...d...............
Boot2001* EFI USB Device RC
我认为这可以解决这个问题:
# grub-install /dev/sda
Installing for x86_64-efi platform.
efibootmgr: Could not set variable Boot0003: No such file or directory
efibootmgr: Could not prepare boot variable: No such file or directory
Installation finished. No error reported.
但实际上 efibootmgr 似乎什么也改变不了
# efibootmgr -t 10
efibootmgr: Could not set Timeout: No such file or directory
有些东西出问题了,看起来这可能就是问题所在,有人知道是什么吗?
正如我所说,ubuntu 在同一系统上安装成功,所以我不愿意相信是计算机而不是 Debian 出了问题。
以下是失败的超时命令的 strace:
最后出现了一些错误(设备上没有剩余空间??)
root@dell-3521:/home/john# strace efibootmgr -t 10
execve("/bin/efibootmgr", ["efibootmgr", "-t", "10"], [/* 47 vars */]) = 0
brk(0) = 0xcff000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc3cfd1c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=126215, ...}) = 0
mmap(NULL, 126215, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc3cfcfd000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpci.so.3", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0%\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=52448, ...}) = 0
mmap(NULL, 2147632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc3cf8f1000
mprotect(0x7fc3cf8fc000, 2097152, PROT_NONE) = 0
mmap(0x7fc3cfafc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7fc3cfafc000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \"\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=109144, ...}) = 0
mmap(NULL, 2204200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc3cf6d6000
mprotect(0x7fc3cf6f0000, 2093056, PROT_NONE) = 0
mmap(0x7fc3cf8ef000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0x7fc3cf8ef000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libefivar.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000!\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=63520, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc3cfcfc000
mmap(NULL, 2159576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc3cf4c6000
mprotect(0x7fc3cf4cd000, 2093056, PROT_NONE) = 0
mmap(0x7fc3cf6cc000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fc3cf6cc000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\34\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1738176, ...}) = 0
mmap(NULL, 3844640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc3cf11b000
mprotect(0x7fc3cf2bd000, 2093056, PROT_NONE) = 0
mmap(0x7fc3cf4bc000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a1000) = 0x7fc3cf4bc000
mmap(0x7fc3cf4c2000, 14880, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc3cf4c2000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220:\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=84856, ...}) = 0
mmap(NULL, 2189928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc3cef04000
mprotect(0x7fc3cef18000, 2093056, PROT_NONE) = 0
mmap(0x7fc3cf117000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x7fc3cf117000
mmap(0x7fc3cf119000, 6760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc3cf119000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14664, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc3cfcfb000
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc3ced00000
mprotect(0x7fc3ced03000, 2093056, PROT_NONE) = 0
mmap(0x7fc3cef02000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fc3cef02000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc3cfcfa000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc3cfcf9000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc3cfcf8000
arch_prctl(ARCH_SET_FS, 0x7fc3cfcf9700) = 0
mprotect(0x7fc3cf4bc000, 16384, PROT_READ) = 0
mprotect(0x7fc3cef02000, 4096, PROT_READ) = 0
mprotect(0x7fc3cf117000, 4096, PROT_READ) = 0
mprotect(0x7fc3cf6cc000, 4096, PROT_READ) = 0
mprotect(0x7fc3cf8ef000, 4096, PROT_READ) = 0
mprotect(0x7fc3cfafc000, 4096, PROT_READ) = 0
mprotect(0x60e000, 4096, PROT_READ) = 0
mprotect(0x7fc3cfd1e000, 4096, PROT_READ) = 0
munmap(0x7fc3cfcfd000, 126215) = 0
access("/sys/firmware/efi/efivars/", F_OK) = 0
statfs("/sys/firmware/efi/efivars/", {f_type="SYSFS_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
uname({sys="Linux", node="dell-3521", ...}) = 0
access("/sys/firmware/efi/vars/new_var", F_OK) = 0
openat(AT_FDCWD, "/sys/firmware/efi/vars/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
brk(0) = 0xcff000
brk(0xd28000) = 0xd28000
fcntl(3, F_GETFD) = 0x1 (flags FD_CLOEXEC)
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents(3, /* 159 entries */, 32768) = 12872
getdents(3, /* 0 entries */, 32768) = 0
close(3) = 0
open("/sys/firmware/efi/vars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
read(3, "B\0o\0o\0t\0000\0000\0000\0000\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 2084
read(3, "", 2012) = 0
close(3) = 0
open("/sys/firmware/efi/vars/Boot0001-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
read(3, "B\0o\0o\0t\0000\0000\0000\0001\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 2084
read(3, "", 2012) = 0
close(3) = 0
open("/sys/firmware/efi/vars/Boot0002-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
read(3, "B\0o\0o\0t\0000\0000\0000\0002\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 2084
read(3, "", 2012) = 0
close(3) = 0
open("/sys/firmware/efi/vars/Boot0004-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
read(3, "B\0o\0o\0t\0000\0000\0000\0004\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 2084
read(3, "", 2012) = 0
close(3) = 0
open("/sys/firmware/efi/vars/Boot2001-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
read(3, "B\0o\0o\0t\0002\0000\0000\0001\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 2084
read(3, "", 2012) = 0
close(3) = 0
access("/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e098032b8c/data", F_OK) = -1 ENOENT (No such file or directory)
open("/sys/firmware/efi/vars/new_var", O_WRONLY) = 3
write(3, "T\0i\0m\0e\0o\0u\0t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2084) = -1 ENOSPC (No space left on device)
umask(0) = 022
umask(022) = 0
chmod("/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e0980/", 021371157541) = -1 ENOENT (No such file or directory)
chmod("/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e0980/attributes", 021371157541) = -1 ENOENT (No such file or directory)
chmod("/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e0980/data", 021371157541) = -1 ENOENT (No such file or directory)
chmod("/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e0980/guid", 021371157541) = -1 ENOENT (No such file or directory)
chmod("/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e0980/raw_var", 021371157541) = -1 ENOENT (No such file or directory)
chmod("/sys/firmware/efi/vars/Timeout-8be4df61-93ca-11d2-aa0d-00e0980/size", 021371157541) = -1 ENOENT (No such file or directory)
close(3) = 0
write(2, "efibootmgr: ", 12efibootmgr: ) = 12
write(2, "Could not set Timeout", 21Could not set Timeout) = 21
write(2, ": ", 2: ) = 2
write(2, "No such file or directory\n", 26No such file or directory
) = 26
exit_group(14) = ?
+++ exited with 14 +++
答案1
我听说过也见过 NVRAM 内容(efibootmgr
存储启动顺序和启动条目的地方)损坏的情况,这使得对其进行进一步更改变得困难或不可能。我知道的唯一解决办法是使用固件选项将所有设置重置为默认值。这应该可以清除全部条目超出 NVRAM 的范围,这将导致您的计算机无法启动,除非您在后备文件名位置 ( EFI/BOOT/bootx64.efi
) 中有内容,或者您使用可移动介质(如 Ubuntu 安装磁盘)。您可以使用应急磁盘或后备引导加载程序来启动操作系统并重新添加您想要的任何条目。
话虽如此,我不能 100% 肯定您遇到了这个问题。症状相似,但可能是您遇到了另一个问题,在这种情况下,尝试我刚刚建议的恢复将是浪费时间,实际上可能会使情况变得更糟。您必须自己决定是否值得冒险。
答案2
这似乎是 Windows 系统崩溃和戴尔硬件太差造成的:
http://www.c0le.org/2014/12/dual-booting-debian-jessie-and-windows.html
每次启动 Windows(我从来没有这样做过!这是偶然发生的!)时,它都会尝试添加自己的引导加载程序,这会把一切都搞砸。
修复此问题的方法是:在 Windows 命令提示符下执行此操作!:
(Win+X然后命令提示符(管理员))
bcdedit /set {bootmgr} path \EFI\debian\grubx64.efi
显然这使得 Windows 使用 debian 的 grub 引导加载程序。
然后,当 Windows 试图把事情搞砸时,它就会把它们搞砸,这样它们才能正常工作!
血腥的一堆。