报错Invalid BootNext valuegrep
原来的系统 (Original system):
almalinux 10 要安装的系统 (System to be installed): debian13 遇到的问题 (Issue): 日志如下 无法重装 机器为XFS分区的almalinux 10 实体机 尔英 12500H主板 使用参数bash reinstall.sh debian 13 --password ****(密码隐去了) --ssh-port 2233 --web-port 1166
[root@instance-20250922-0141 ~]# curl -O https://cnb.cool/bin456789/reinstall/-/git/raw/main/reinstall.sh || wget -O ${##*/} $ % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 147k 0 147k 0 0 223k 0 --:--:-- --:--:-- --:--:-- 223k [root@instance-20250922-0141 ~]# bash reinstall.sh debian 13 --password ****(密码隐去了) --ssh-port 2233 --web-port 1166 http://www.qualcomm.cn/cdn-cgi/trace % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 190 0 190 0 0 445 0 --:--:-- --:--:-- --:--:-- 446 Location: CN ***** SET NEXTOS DEBIAN 13 ***** none Installing package 'virt-what'... Last metadata expiration check: 2:03:57 ago on Tue Sep 30 09:39:07 2025. Dependencies resolved.
Package Architecture Version Repository Size
Installing: virt-what x86_64 1.27-2.el10 baseos 40 k
Transaction Summary
Install 1 Package
Total download size: 40 k Installed size: 76 k Downloading Packages: virt-what-1.27-2.el10.x86_64.rpm 32 kB/s | 40 kB 00:01
Total 32 kB/s | 40 kB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : virt-what-1.27-2.el10.x86_64 1/1
Running scriptlet: virt-what-1.27-2.el10.x86_64 1/1
Installed: virt-what-1.27-2.el10.x86_64
Complete! VM: false ***** DOWNLOAD VMLNUZ AND INITRD ***** https://mirror.nju.edu.cn/debian/dists/trixie/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:10 --:--:-- 0 curl: (28) Connection time-out % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 11.5M 100 11.5M 0 0 13.0M 0 --:--:-- --:--:-- --:--:-- 13.0M https://mirror.nju.edu.cn/debian/dists/trixie/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 38.7M 100 38.7M 0 0 26.3M 0 0:00:01 0:00:01 --:--:-- 26.3M https://mirror.nju.edu.cn/debian-cdimage/unofficial/non-free/firmware/trixie/current/firmware.cpio.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 470M 100 470M 0 0 40.8M 0 0:00:11 0:00:11 --:--:-- 41.9M ***** MOD DEBIAN INITRD ***** 131802 blocks https://cnb.cool/bin456789/reinstall/-/git/raw/main/trans.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 232k 0 232k 0 0 352k 0 --:--:-- --:--:-- --:--:-- 353k https://cnb.cool/bin456789/reinstall/-/git/raw/main/initrd-network.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 16587 0 16587 0 0 23938 0 --:--:-- --:--:-- --:--:-- 23935 ***** NETWORK INFO ***** IPv4 MAC: 00:e2:69:7a:3f:7b IPv4 Address: 192.168.0.8/24 IPv4 Gateway: 192.168.0.254
IPv6 MAC: 00:e2:69:7a:3f:7b IPv6 Address: 240e:33d:31:4261:2e2:69ff:fe7a:3f7b/64 IPv6 Gateway: fe80::20c:29ff:fefd:5b60
https://cnb.cool/bin456789/reinstall/-/git/raw/main/fix-eth-name.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 7823 0 7823 0 0 14820 0 --:--:-- --:--:-- --:--:-- 14844 https://cnb.cool/bin456789/reinstall/-/git/raw/main/fix-eth-name.service % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 845 100 845 0 0 1518 0 --:--:-- --:--:-- --:--:-- 1517 https://cnb.cool/bin456789/reinstall/-/git/raw/main/get-xda.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 688 100 688 0 0 1267 0 --:--:-- --:--:-- --:--:-- 1267 https://cnb.cool/bin456789/reinstall/-/git/raw/main/ttys.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 775 100 775 0 0 1296 0 --:--:-- --:--:-- --:--:-- 1298 http://mirror.nju.edu.cn/debian/dists/trixie/main/debian-installer/binary-amd64/Packages.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 65996 100 65996 0 0 118k 0 --:--:-- --:--:-- --:--:-- 118k http://mirror.nju.edu.cn/debian/pool/main/u/util-linux/fdisk-udeb_2.41-5_amd64.udeb % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 960k 100 960k 0 0 1169k 0 --:--:-- --:--:-- --:--:-- 1168k ***** DOWNLOAD GRUB EFI ***** https://mirror.nju.edu.cn/fedora/releases/42/Everything/x86_64/os/EFI/BOOT/grubx64.efi % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3943k 100 3943k 0 0 2413k 0 0:00:01 0:00:01 --:--:-- 2414k Could not prepare Boot variable: Invalid argument ***** ERROR ***** Line 2707 return 1 Invalid BootNext valuegrep ^ ***** ERROR ***** Line 2749 return 35 efibootmgr --bootnext $id
efibootmgr --create-only \
--disk "/dev/nvme0n1" \
--part 1 \
--label test \
--loader "\\EFI\\reinstall\\grubx64.efi"
看下运行结果
efibootmgr --create-only \ --disk "/dev/nvme0n1" \ --part 1 \ --label test \ --loader "\\EFI\\reinstall\\grubx64.efi"查看下运行结果
localhost:~# efibootmgr --create-only \
--disk "/dev/nvme0n1" \ --part 1 \ --label test \ --loader "\\EFI\\reinstall\\grubx64.efi"
Could not prepare Boot variable: No space left on device localhost:~# efibootmgr BootCurrent: 0004 Timeout: 1 seconds BootOrder: 0004,0000,0001,0003 Boot0000* Ubuntu VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb) Boot0001* debian VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb) Boot0003* AlmaLinux VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb) Boot0004* UEFI OS HD(1,GPT,31ef2791-888d-42aa-8284-4ab29b38c8ca,0x800,0x100000)/\EFI\BOOT\BOOTX64.EFI0000424f
懂了估计是写满了 我删几个再试试
localhost:~# efibootmgr --create-only \
--disk "/dev/nvme0n1" \ --part 1 \ --label test \ --loader "\\EFI\\reinstall\\grubx64.efi"
Could not prepare Boot variable: No space left on device localhost:~# efibootmgr BootCurrent: 0004 Timeout: 1 seconds BootOrder: 0004 Boot0004* UEFI OS HD(1,GPT,31ef2791-888d-42aa-8284-4ab29b38c8ca,0x800,0x100000)/\EFI\BOOT\BOOTX64.EFI0000424f
我尝试清空了NVRAM 但好像还是不行 估计是这个主板的问题 这个主板是尔英 12500H
尝试手动安装Debian也会报错NVRAM的问题 但是跳过写入NVRAM后继续安装Debian后启动正常 也能正常引导 很奇怪
可能自动使用了 /boot/efi/EFI/boot/bootx64.efi 引导