UEFI引导的openwrt我转为vhd并保持分区uuid相同,在使用传统bios引导时,每次都停在grub画面,然后我键入`set prefix=(hd0,gpt2)/boot/grub`
再输入normal,然后就开始引导,在grub(在主引导区,删除所有分区仍会跳到grub界面)没有找到`hd0,gpt2)/boot/grub`不知道是没去找还是找不到可是手动键入命令又可以,现在如何让该openwrt在传统bios也能正确引导而无需键入这些命令?,上次你的对话中断而且常规的方法都失败了,你希望输出命令收集上下文.这是你上次需要的命令结果 ` OpenWrt 23.05.4, r24012-d8dd03c46f
=== WARNING! ===================================== There is no root password defined on this device! Use the "passwd" command to set up a new password in order to prevent unauthorized SSH logins.
root@CowBWrt:~# fdisk -l /dev/sda Disk /dev/sda: 3.9 GiB, 4186963968 bytes, 8177664 sectors Disk model: Virtual Disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 806CD554-9D47-275B-3D98-4B9A39229900
Device Start End Sectors Size Type /dev/sda1 34 511 478 239K BIOS boot /dev/sda2 512 33279 32768 16M Linux filesystem /dev/sda3 33280 6324223 6290944 3G Linux filesystem root@CowBWrt:# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 2.9G 0 loop /overlay sda 8:0 0 3.9G 0 disk ├─sda1 8:1 0 239K 0 part ├─sda2 8:2 0 16M 0 part /mnt/sda2 └─sda3 8:3 0 3G 0 part /rom sr0 11:0 1 1024M 0 rom root@CowBWrt:# blkid /dev/loop0: LABEL="rootfs_data" UUID="1c2a78a9-1dd5-43d3-8f61-bb2d903168bd" BLOCK_SIZE="4096" TYPE="f2fs" /dev/sda2: SEC_TYPE="msdos" LABEL_FATBOOT="kernel" LABEL="kernel" UUID="1234-ABCD" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="806cd554-9d47-275b-3d98-4b9a39229901" /dev/sda3: BLOCK_SIZE="262144" TYPE="squashfs" PARTUUID="806cd554-9d47-275b-3d98-4b9a39229902" /dev/sda1: PARTUUID="806cd554-9d47-275b-3d98-4b9a39229980" root@CowBWrt:# mount | grep sda /dev/sda3 on /rom type squashfs (ro,relatime,errors=continue) /sda3 on /overlay type f2fs (rw,noatime,lazytime,background_gc=on,nodiscard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,discard_unit=block) /dev/sda2 on /mnt/sda2 type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) root@CowBWrt:# df -h Filesystem Size Used Available Use% Mounted on /dev/root 148.3M 148.3M 0 100% /rom tmpfs 995.6M 2.3M 993.3M 0% /tmp /dev/loop0 2.9G 123.8M 2.7G 4% /overlay overlayfs:/overlay 2.9G 123.8M 2.7G 4% / tmpfs 512.0K 0 512.0K 0% /dev /dev/sda2 16.0M 6.8M 9.2M 43% /mnt/sda2 cgroup 995.6M 0 995.6M 0% /sys/fs/cgroup root@CowBWrt:# ls -la /mnt/sda2/boot/grub/ drwxrwxrwx 2 root root 2048 Mar 22 2024 . drwxrwxrwx 3 root root 2048 Mar 22 2024 .. -rwxrwxrwx 1 root root 512 Mar 22 2024 boot.img -rwxrwxrwx 1 root root 147175 Mar 22 2024 core.img -rwxrwxrwx 1 root root 524 Mar 22 2024 grub.cfg root@CowBWrt:# file /mnt/sda2/boot/grub/* -ash: file: not found root@CowBWrt:# hexdump -C /mnt/sda2/boot/grub/boot.img | head -5 00000000 eb 63 90 00 00 00 00 00 00 00 00 00 00 00 00 00 |.c..............| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000050 00 00 00 00 00 00 00 00 00 00 00 80 01 00 00 00 |................| 00000060 00 00 00 00 ff fa eb 05 f6 c2 80 74 05 f6 c2 70 |...........t...p| root@CowBWrt:# hexdump -C /mnt/sda2/boot/grub/core.img | head -5 00000000 52 56 be 1b 81 e8 39 01 5e bf f4 81 66 8b 2d 83 |RV....9.^...f.-.| 00000010 7d 08 00 0f 84 e2 00 80 7c ff 00 74 46 66 8b 1d |}.......|..tFf..| 00000020 66 8b 4d 04 66 31 c0 b0 7f 39 45 08 7f 03 8b 45 |f.M.f1...9E....E| 00000030 08 29 45 08 66 01 05 66 83 55 04 00 c7 04 10 00 |.)E.f..f.U......| 00000040 89 44 02 66 89 5c 08 66 89 4c 0c c7 44 06 00 70 |.D.f..f.L..D..p| root@CowBWrt:# dd if=/dev/sda bs=512 count=1 | hexdump -C 1+0 records in 1+0 records out 00000000 eb 63 90 00 00 00 00 00 00 00 00 00 00 00 00 00 |.c..............| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000050 00 00 00 00 00 00 00 00 00 00 00 80 22 00 00 00 |............"...| 00000060 00 00 00 00 ff fa 90 90 f6 c2 80 74 05 f6 c2 70 |...........t...p| 00000070 74 02 b2 80 ea 79 7c 00 00 31 c0 8e d8 8e d0 bc |t....y|..1......| 00000080 00 20 fb a0 64 7c 3c ff 74 02 88 c2 52 be 80 7d |. ..d|<.t...R..}| 00000090 e8 17 01 be 05 7c b4 41 bb aa 55 cd 13 5a 52 72 |.....|.A..U..ZRr| 000000a0 3d 81 fb 55 aa 75 37 83 e1 01 74 32 31 c0 89 44 |=..U.u7...t21..D| 000000b0 04 40 88 44 ff 89 44 02 c7 04 10 00 66 8b 1e 5c |.@.D..D.....f..| 000000c0 7c 66 89 5c 08 66 8b 1e 60 7c 66 89 5c 0c c7 44 ||f..f..|f.\..D| 000000d0 06 00 70 b4 42 cd 13 72 05 bb 00 70 eb 76 b4 08 |..p.B..r...p.v..| 000000e0 cd 13 73 0d 5a 84 d2 0f 83 d8 00 be 8b 7d e9 82 |..s.Z........}..| 000000f0 00 66 0f b6 c6 88 64 ff 40 66 89 44 04 0f b6 d1 |.f....d.@f.D....| 00000100 c1 e2 02 88 e8 88 f4 40 89 44 08 0f b6 c2 c0 e8 |.......@.D......| 00000110 02 66 89 04 66 a1 60 7c 66 09 c0 75 4e 66 a1 5c |.f..f.|f..uNf.| 00000120 7c 66 31 d2 66 f7 34 88 d1 31 d2 66 f7 74 04 3b ||f1.f.4..1.f.t.;| 00000130 44 08 7d 37 fe c1 88 c5 30 c0 c1 e8 02 08 c1 88 |D.}7....0.......| 00000140 d0 5a 88 c6 bb 00 70 8e c3 31 db b8 01 02 cd 13 |.Z....p..1......| 00000150 72 1e 8c c3 60 1e b9 00 01 8e db 31 f6 bf 00 80 |r...`......1....| 00000160 8e c6 fc f3 a5 1f 61 ff 26 5a 7c be 86 7d eb 03 |......a.&Z|..}..| 00000170 be 95 7d e8 34 00 be 9a 7d e8 2e 00 cd 18 eb fe |..}.4...}.......| 00000180 47 52 55 42 20 00 47 65 6f 6d 00 48 61 72 64 20 |GRUB .Geom.Hard | 00000190 44 69 73 6b 00 52 65 61 64 00 20 45 72 72 6f 72 |Disk.Read. Error| 000001a0 0d 0a 00 bb 01 00 b4 0e cd 10 ac 3c 00 75 f4 c3 |...........<.u..| 000001b0 00 00 00 00 00 00 00 00 54 d5 6c 80 00 00 00 00 |........T.l.....| 000001c0 02 00 ee ff ff ff 01 00 00 00 ff ff ff ff 00 00 |................| 000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| 00000200 root@CowBWrt:# parted /dev/sda print Model: Msft Virtual Disk (scsi) Disk /dev/sda: 4187MB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags 1 17.4kB 262kB 245kB bios_grub 2 262kB 17.0MB 16.8MB fat16 legacy_boot 3 17.0MB 3238MB 3221MB
root@CowBWrt:# ls /mnt/sda2/boot/grub/ boot.img core.img grub.cfg root@CowBWrt:# ls -l /mnt/sda2/boot/grub/ -rwxrwxrwx 1 root root 512 Mar 22 2024 boot.img -rwxrwxrwx 1 root root 147175 Mar 22 2024 core.img -rwxrwxrwx 1 root root 524 Mar 22 2024 grub.cfg root@CowBWrt:~#