不是rEFInd,而是想回到grub

最大的社区版本,Ubuntu的发源地
回复
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

不是rEFInd,而是想回到grub

#1

帖子 寺島聰子 » 2021-05-18 23:47

cmosクリアしたら マザーボードのUEFI ファームウェア中の「debian」の文字列が ブートメニューから消えました。
いろいろなことをやってみたが、うまくゆかず、ネットで見かけた次のことを試した。

>このアーカイブの .img ファイルは、EFI ベースのコンピュータであればブートできるはずです。
このファイルは rEFInd ブートマネージャを起動し、コンピュータの EFI システムパーティション (ESP) や他の場所にある
ブートローダを見つけることができるはずです。
このディスクイメージを使用するには、USBフラッシュドライブなどの媒体にコピーする必要があります。

debianは起動して正常に使えるようになりました。しかし

清除cmos后,主板UEFI固件中的“debian”字符串从启动菜单中消失。
虽然做了各种各样的事情,但是进展不顺利,就试着做了网上看到的下一件事。
>这个存档的文件如果是基于EFI的电脑的话应该可以启动。
该文件启动了rEFInd启动管理器,并位于计算机的EFI系统分区(ESP)或其他位置
应该可以找到启动程序。
要使用此盘片图像,必须复制到USB闪存等介质中。
debian启动后能正常使用了。但是

自分としては、もともとのgrub ブートローダーに戻したいです。
我想回到原来的grub启动器。
头像
astolia
论坛版主
帖子: 6450
注册时间: 2008-09-18 13:11

Re: 不是rEFInd,而是想回到grub

#3

帖子 astolia » 2021-05-19 10:23

https://wiki.debian.org/GrubEFIReinstall より

代码: 全选

sudo apt-get install --reinstall grub-efi
sudo grub-install
sudo update-grub
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 不是rEFInd,而是想回到grub

#4

帖子 寺島聰子 » 2021-05-20 23:27

fuhuizn様、astolia様、回答ありがとうございます。
最近様々のことが起きてlinux のことができませんでした。明日以降取り組みます。素早いレスいつものことながら感激です。皆様も我も、いかなる疫病にも罹ることなく健康であらんことを祈ります。
最近发生了各种各样的事情,不能linux。明天以后努力。很快的回帖虽然是平时的事但是很感激。希望大家和我都不要得任何流行病,要健康。
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 不是rEFInd,而是想回到grub

#5

帖子 寺島聰子 » 2021-05-21 11:30

usb live のrefinder のメニュー中にhddに書き込まれたrefinderをリムーブするオプションがあったのでそれをまず消した。
因为有在usb live的refinder的菜单中重新启动写入了hdd的refinder的选项,所以先把那个删除了。
参考
https://wiki.debian.org/GrubEFIReinstall

$ efibootmgr
BootCurrent: 0005
Timeout: 0 seconds
BootOrder: 0005,0003,0004,0001
Boot0001 UEFI: Built-in EFI Shell
Boot0003* Hard Drive
Boot0004* USB
Boot0005* UEFI: UFD 2.0 Silicon-Power16G8.07

Boot your computer with the Refind media
 Reinstalling grub-efi on your hard drive
  Check that the computer booted in computer in EFI mode:

$ [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
EFI boot on HDD

Reinstall the grub-efi package
$ sudo apt-get install --reinstall grub-efi


Put the debian bootloader in /boot/efi and create an appropriate entry in the computer NVRAM
将debian引导加载程序放入/boot/efi中,并在计算机NVRAM中创建适当的条目
$ sudo grub-install
Installing for x86_64-efi platform.
Installation finished. No error reported.

Recreate a grub config file based on your disk partitioning schema
根据磁盘分区模式重新创建grub配置文件
$ sudo update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Linux イメージを見つけました: /boot/vmlinuz-4.19.0-16-amd64
Found initrd image: /boot/initrd.img-4.19.0-16-amd64
Linux イメージを見つけました: /boot/vmlinuz-4.19.0-14-amd64
Found initrd image: /boot/initrd.img-4.19.0-14-amd64
Adding boot menu entry for EFI firmware configuration
完了

You should check afterwards that:
Check 1. the bootloader is existing in /boot/efi/EFI/debian/grubx64.efi

jin@kyo:~$ sudo cd /boot/efi/EFI/debian/
sudo: cd: コマンドが見つかりません
jin@kyo:~$ sudo -i
# cd /boot/efi/EFI/debian/
# ls
BOOTX64.CSV fbx64.efi grub.cfg grubx64.efi mmx64.efi shimx64.efi
#
# file /boot/efi/EFI/debian/grubx64.efi
/boot/efi/EFI/debian/grubx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
確認

Check 2. the nvram entry was properly created.
$ efibootmgr --verbose | grep debian
Boot0000* debian HD(1,GPT,4904e13d-5206-480f-9fc8-7cf0895845be,0x800,0x5f000)/File(\EFI\debian\shimx64.efi)
確認
You can now reboot, and Grub should greet you.
您现在可以重新启动了,Grub应该会欢迎您。
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 不是rEFInd,而是想回到grub

#6

帖子 寺島聰子 » 2021-05-21 12:07

みごと、以前どおりに。成功です。 :Haha
jin@kyo:~$ efibootmgr
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0003,0001
Boot0000* debian
Boot0001 UEFI: Built-in EFI Shell
Boot0003* Hard Drive
jin@kyo:~$

fuhuizn様の示してくれた usb live から起動してchrootを使用する方法は2週間くらい頑張りましたが
どうしてもできなかったのです。 :Cry
以下のあたりができなかった。
从fuhuizon先生表示的usb live开始,使用chroot的方法努力了2周左右,但是怎么也不行。没能做到以下几点。
sudo mount -t proc / proc / mnt / proc
sudo mount --rbind / sys / mnt / sys
sudo mount --rbind / dev / mnt / dev
sudo mount --rbind / run / mnt / run

その後 rEFInd USBメディアでdebian 起動できて、もう既に起動してるのだから、astoliaさんのやり方で今回成功しました。お二人ともありがとうございました。
この2週間しかたなくずっとWindows 8.1を使っていましたが(この問題の解決方法をネット検索するために)windowsも「なかなか良いなあ」と感じました。 それはone drive が便利でした。
之后rEFInd USB媒体可以启动debian,已经启动了,用astolia的方法这次成功了。谢谢你们两位。
这两周没办法一直使用Windows8.1(为了网络检索这个问题的解决方法)windows也感到「相当好啊」。那个用one drive很方便。 :Smile

debian でもこれを実現したいと思っています。google drive 等のmount を。
回复