718天 墨茶

Never Say Never

Debian系在使用萌咖脚本dd时报错Error! grub.cfg.

墨茶    1个月前  165次浏览  2条评论  2405字   原创

今天是国家公祭日,铭记历史,缅怀逝者。

系统信息

[email protected]:~# curl -Lso- bench.sh | bash
----------------------------------------------------------------------
 CPU Model             : Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz
 CPU Cores             : 4
 CPU Frequency         : 3491.914 MHz
 CPU Cache             : 16384 KB
 Total Disk            : 32.0 GB (2.1 GB Used)
 Total Mem             : 15659 MB (142 MB Used)
 Total Swap            : 0 MB (0 MB Used)
 System uptime         : 0 days, 10 hour 7 min
 Load average          : 0.00, 0.01, 0.00
 OS                    : Ubuntu 20.04 LTS
 Arch                  : x86_64 (64 Bit)
 Kernel                : 5.4.0-29-generic
 TCP CC                : cubic
 Virtualization        : KVM
 Organization          : AS16276 OVH SAS
 Location              : Frankfurt am Main / DE
 Region                : Hesse
----------------------------------------------------------------------
^C
The script has been terminated.

报错内容

使用的萌咖脚本,报错:

[email protected]:~# bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -dd "http://localhost/win/zh-cn_windows2016.gz"

# Check Dependence

[ok]		iconv
[ok]		ip
[ok]		wget
[ok]		awk
[ok]		grep
[ok]		sed
[ok]		cut
[ok]		cat
[ok]		lsblk
[ok]		cpio
[ok]		gzip
[ok]		find
[ok]		dirname
[ok]		basename

# Install

Auto Mode insatll Windows
[http://localhost/win/zh-cn_windows2016.gz]

[Debian] [bullseye] [amd64] Downloading...
Error! grub.cfg. 

解决方法

进入/boot/目录能看到有以下文件,其中包含一个grub文件夹,再进入grub文件夹可以看到grub.cfg,很显然这是grub2:

[email protected]:~# cd /boot && ls -lha
total 94M
drwxr-xr-x  3 root root 4.0K May 12  2020 .
drwxr-xr-x 19 root root 4.0K Dec 14 11:44 ..
-rw-r--r--  1 root root 233K Apr 29  2020 config-5.4.0-29-generic
drwxr-xr-x  4 root root 4.0K Jun  6  2020 grub
lrwxrwxrwx  1 root root   27 May 10  2020 initrd.img -> initrd.img-5.4.0-29-generic
-rw-r--r--  1 root root  78M May 10  2020 initrd.img-5.4.0-29-generic
lrwxrwxrwx  1 root root   27 May 10  2020 initrd.img.old -> initrd.img-5.4.0-29-generic
-rw-------  1 root root 4.6M Apr 29  2020 System.map-5.4.0-29-generic
lrwxrwxrwx  1 root root   24 May 10  2020 vmlinuz -> vmlinuz-5.4.0-29-generic
-rw-------  1 root root  12M Apr 29  2020 vmlinuz-5.4.0-29-generic
lrwxrwxrwx  1 root root   24 May 10  2020 vmlinuz.old -> vmlinuz-5.4.0-29-generic
[email protected]:/boot# cd grub && ls -lha
total 2.4M
drwxr-xr-x 4 root root 4.0K Jun  6  2020 .
drwxr-xr-x 3 root root 4.0K May 12  2020 ..
drwxr-xr-x 2 root root 4.0K May 12  2020 fonts
-rw-r--r-- 1 root root  712 May 10  2020 gfxblacklist.txt
-r--r--r-- 1 root root 6.7K May 13  2020 grub.cfg
-rw-r--r-- 1 root root 1.0K Dec 14 11:43 grubenv
drwxr-xr-x 2 root root  12K May 10  2020 i386-pc
-rw-r--r-- 1 root root 2.3M May 10  2020 unicode.pf2

boot目录下只有grub文件夹,由于grub2的配置文件所在的目录通常为/boot/grub2/,所以有可能是没有grub2文件夹导致的。

为了验证猜想,创建一个grub2文件夹,并使用以下命令生成配置文件:

mkdir /boot/grub2 && grub-mkconfig -o /boot/grub2/grub.cfg

再次运行脚本,即可顺利dd。

未显示?请点击刷新