cndaqiang / E5-PC-daily

服务器集群管理遇到的问题和总结
1 stars 0 forks source link

开机grub问题 #22

Open cndaqiang opened 4 years ago

cndaqiang commented 4 years ago

参考 https://blog.csdn.net/zhouzhiyao960211/article/details/100529225

使用 ls可以查看有哪些硬盘分区 ls (hd0,xxN)/等价于ls (hd0,N)/ (hd0,N)对应/devsdaN, 对应 N=1,2,3 (hd1,N)应该对应/dev/sdbN 如图中,经过多次ls发现,我的根目录在(hd0,3)/dev/sda3 使用

linux (hd0,3)/vmlinuz root=/dev/sda3
initrd (hd0,3)/initrd.img
boot

即可正常启动 28427673

同时,我在(hd0,2)中也发现了引导文件 用

linux (hd0,2)/vmlinuz-xxx  root=/dev/sda3
initrd (hd0,2)/initrd.img-xxx
boot

也能启动,但是启动后,类似进入了单用户模式,内核也不一样 1434004291 276391862

cndaqiang commented 4 years ago

开机后,更新grub

root@girl:/home/cndaqiang# update-grub2
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-20-generic
Found initrd image: /boot/initrd.img-4.15.0-20-generic
Found Windows Boot Manager on /dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
root@girl:/home/cndaqiang# grub-install /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.
cndaqiang commented 4 years ago

grub其他参考命令 https://blog.csdn.net/gatieme/article/details/59127020