如果使用 UEFI 请参阅这个问题,“如果我使用 UEFI,我可以启动 memtest86+ 吗?”
在我的 Lenovo B570 上安装了 64 位版本的 Ubuntu 12.04 后,我遇到了在使用 Grub 安装 11.10 时遇到的相同问题,但在 uEFI 系统上无法正常运行。我使用与上次相同的技术来解决问题(使用 Super Grub Disc LiveCD 会话修复 Grub)并且我的系统在 Ubuntu 和 Windows 7 之间愉快地双启动
但是现在当我启动 Grub 菜单时只显示
我不再看到以前存在的使用 Memtest86+ 的选项,在 Ubuntu 软件中心检查后,我可以看到该软件包已安装,但是如何使再次运行它的选项出现在 Grub 菜单中?
我试过了:
sudo update-grub
Run Code Online (Sandbox Code Playgroud)
这没有任何区别。
sudo chmod +x /etc/grub.d/20_memtest86+
Run Code Online (Sandbox Code Playgroud)
结果是:
chmod: cannot access /etc/grub.d/20_memtest86+': No such file or directory
并进入
ls /etc/grub.d/
Run Code Online (Sandbox Code Playgroud)
结果是:
00_header 10_linux 30_os-prober 41_custom
05_debian_theme 20_linux_xen 40_custom README
Run Code Online (Sandbox Code Playgroud)
23 *_* 89 26
尝试打开终端并运行
sudo chmod +x /etc/grub.d/20_memtest86+
sudo update-grub
Run Code Online (Sandbox Code Playgroud)
检查它是否在那里
grep memtest /boot/grub/grub.cfg
Run Code Online (Sandbox Code Playgroud)
就像我禁用它一样
hob@hob-HP-dx5150-MT:~$ cat /boot/grub/grub.cfg |grep memtest
hob@hob-HP-dx5150-MT:~$ sudo chmod +x /etc/grub.d/20_memtest86+
[sudo] password for hob:
hob@hob-HP-dx5150-MT:~$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-24-generic
Found initrd image: /boot/initrd.img-3.2.0-24-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 11.10 (11.10) on /dev/sda6
Found Trisquel 5.5 (5.5) on /dev/sda8
Found Ubuntu 12.04 LTS (12.04) on /dev/sda9
done
hob@hob-HP-dx5150-MT:~$ cat /boot/grub/grub.cfg |grep memtest
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
### END /etc/grub.d/20_memtest86+ ###
Run Code Online (Sandbox Code Playgroud)
如果文件不存在,您可以尝试创建文件,在终端中使用 nano
sudo nano /etc/grub.d/20_memtest86+
Run Code Online (Sandbox Code Playgroud)
或使用 gui 编辑器
gksudo gedit /etc/grub.d/20_memtest86+
Run Code Online (Sandbox Code Playgroud)
填充它
#!/bin/sh
set -e
if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then
. /usr/lib/grub/grub-mkconfig_lib
LX=linux16
elif [ -f /usr/lib/grub/update-grub_lib ]; then
. /usr/lib/grub/update-grub_lib
LX=linux
else
# no grub file, so we notify and exit gracefully
echo "Cannot find grub config file, exiting." >&2
exit 0
fi
# We can't cope with loop-mounted devices here.
case ${GRUB_DEVICE_BOOT} in
/dev/loop/*|/dev/loop[0-9]) exit 0 ;;
esac
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
if test -e /boot/memtest86+.bin ; then
MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+.bin" )
echo "Found memtest86+ image: $MEMTESTPATH" >&2
cat << EOF
menuentry "Memory test (memtest86+)" {
EOF
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
$LX $MEMTESTPATH
}
menuentry "Memory test (memtest86+, serial console 115200)" {
EOF
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
$LX $MEMTESTPATH console=ttyS0,115200n8
}
EOF
fi
#if test -e /boot/memtest86+_multiboot.bin ; then
# MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+_multiboot.bin" )
# echo "Found memtest86+ multiboot image: $MEMTESTPATH" >&2
# cat << EOF
#menuentry "Memory test (memtest86+, experimental multiboot)" {
#EOF
# printf '%s\n' "${prepare_boot_cache}"
# cat << EOF
# multiboot $MEMTESTPATH
#}
#menuentry "Memory test (memtest86+, serial console 115200, experimental multiboot)" {
#EOF
# printf '%s\n' "${prepare_boot_cache}"
# cat << EOF
# multiboot $MEMTESTPATH console=ttyS0,115200n8
#}
#EOF
#fi
Run Code Online (Sandbox Code Playgroud)
确保之后在其上运行 chmod +x 命令。
我有点担心它丢失了 - 你在 grub.d 中有其他所有东西吗?
ls /etc/grub.d/
00_header 10_linux.bak 20_memtest86+ 41_custom
05_debian_theme 10_linux.dpkg-old 30_os-prober README
10_linux 20_linux_xen 40_custom
Run Code Online (Sandbox Code Playgroud)
Mic*_*nzl 16
apt install memtest86+
Run Code Online (Sandbox Code Playgroud)
这将自动重新配置 grub 并将条目添加到启动菜单。
如果您收到错误,请memtest86+ is already the newest version使用
sudo apt-get install --reinstall memtest86+
如果所有其他方法都失败了,您可以获得一个可启动的 ISO,您可以将其刻录到 CD 并从中启动。当然,如果您正在启动 UEFI,您应该在这里。
Cri*_*ciu 14
我遇到了同样的问题,并且由于我的笔记本电脑上有 EFI,ubuntu 提供的 memtest86+ 版本 4.x 将无法工作,因为 EFI 仅受版本 5 及更新版本支持。
最新版本是非 GPL 的,必须从 memtest 网站手动下载(它们有 ISO 和 USB 映像),但至少它们是免费的。
小智 5
我没有设法在 2 天内完成这项工作,然后我检查了 Synaptic 的 grub 包......似乎是,没有包grub-imageboot是问题的根源。
sudo apt-get install grub-imageboot
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
85279 次 |
| 最近记录: |