ubuntu-pe icon indicating copy to clipboard operation
ubuntu-pe copied to clipboard

There was an error while booting with a USB flash drive

Open cqzuxia opened this issue 1 year ago • 10 comments

sr0 can't open /dev/sr0: No medium found

cqzuxia avatar Feb 19 '24 02:02 cqzuxia

这种情况一般会发生在刻录USB不完整:刻录不完整导致引导时磁盘驱动丢失,最简单的验证方式是在Grub2通过“硬盘启动ISO”命令来验证是否可以进入桌面,如果可以,说明刻录USB过程出现了不完整、或者是错误的刻录方式,请使用良好的USB、正确的刻录方式刻录ISO,并务必等待刻录过程完整结束。

“硬盘启动ISO”方式说明:

1、把ubuntu-pe.iso放到任意分区的“根目录”,同一根目录创建一个空文件(比如命名为 default.txt):

2、在Grub2中键入如下命令,来直接启动ISO:

$ search --set -f /default.txt
$ loopback lo /ubuntu-pe.iso
$ linux (lo)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-pe.iso
$ initrd (lo)/casper/initrd.img
$ boot

ghostplant avatar Feb 19 '24 05:02 ghostplant

我在grub命令行使用盘符为(cd,gpt3),可以boot,但是在boot后,会将U盘识别为光驱,查找sr0设备。

cqzuxia avatar Feb 19 '24 06:02 cqzuxia

请问你是dd或者upe2usb刻录的吗?三方刻录方式(如ventoy)可能无法正确按照ubuntu pe需要的引导设置来启动

ghostplant avatar Feb 19 '24 06:02 ghostplant

是的,我是用的是ventoy,我需要使用dd写入到完整U盘就可以正常使用吗?

cqzuxia avatar Feb 19 '24 07:02 cqzuxia

推荐upe2usb,这样可以把USB剩余空间利用起来。dd也行,只是没有USB剩余空间。

可以dd安装完后,USB启动桌面,插入另一个USB,然后在Ubuntu PE里面可以upe2usb方式写入ISO到第二个USB

ghostplant avatar Feb 19 '24 07:02 ghostplant

或者您需要在ventoy里面改一下grub2配置,让它能启动正确的设备,参考:https://github.com/ghostplant/ubuntu-pe/issues/47

ghostplant avatar Feb 19 '24 07:02 ghostplant

感谢,下一次使用了,我在U盘里面完整安装了一个ubuntu

cqzuxia avatar Feb 20 '24 01:02 cqzuxia

感谢,下一次使用了,我在U盘里面完整安装了一个ubuntu

路过。我给你个我目前用的 grub.cfg,像在 #47 里说的一样,用ultraiso自己替换下 (iso)/boot/grub/grub.cfg 再封好,一个500M的Live你值得拥有。

目前 2404 版本对于 Ventoy Persistent(数据持久化)以及安装到本地 vhd/vdi 后用 vDisk Boot 的支持都是很好的。

当然我呼唤作者考虑在后续版本优化兼容性,毕竟原版cd普遍没这情况,然后ventoy目前在国内玩pe的环境里认知度还可以,而且在B站上还发视频了是吧。

set timeout=10

loadfont unicode

insmod part_gpt
insmod part_msdos
insmod fat
insmod ntfs
insmod exfat
insmod iso9660

menuentry "Ubuntu PE" {
  set gfxpayload=keep

  if [ -e /casper/vmlinuz ]; then
    true
  else
    search --no-floppy --set -f /casper/vmlinuz
  fi

  linux	/casper/vmlinuz boot=casper locale=zh_CN.UTF-8 
  initrd	/casper/initrd.img
}

menuentry "Ubuntu PE (VESA safe graphics)" {
  set gfxpayload=keep

  if [ -e /casper/vmlinuz ]; then
    true
  else
    search --no-floppy --set -f /casper/vmlinuz
  fi

  linux	/casper/vmlinuz nomodeset xdriver=vesa boot=casper locale=zh_CN.UTF-8 
  initrd	/casper/initrd.img
}

menuentry "Find Local Debian/Ubuntu" {
  search --no-floppy --set -f /etc/apt/sources.list
  configfile /boot/grub/grub.cfg
}

menuentry "Find Local Windows (UEFI)" {
  search --no-floppy --set -f /EFI/Microsoft/Boot/bootmgfw.efi
  chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

menuentry "Find Local Windows (Legacy)" {
  if search --no-floppy --set -f /bootmgr; then
    ntldr /bootmgr
  elif search --no-floppy --set -f /ntldr; then
    ntldr /ntldr
  else
    chainloader +1
  fi
}

menuentry "System Memory Test" {
  search --no-floppy --set -f /boot/memtest86+.upe
  linux /boot/memtest86+.upe
}

menuentry "System BootNext" {
  exit
}

menuentry "System Reboot" {
  reboot
}

menuentry "System Shutdown" {
  halt
}

menuentry "Firmware Settings (UEFI Only)" {
  fwsetup
}

d0ng13 avatar Feb 25 '24 05:02 d0ng13

即使不改任何config,似乎标准Ventoy的“Boot in grub2 mode”是可以成功启动,有试过吗?

ghostplant avatar Apr 08 '24 15:04 ghostplant

即使不改任何config,似乎标准Ventoy的“Boot in grub2 mode”是可以成功启动,有试过吗?

Ventoy boot in grub2 mode 可以顺利启动。 测试环境:

  • ubuntu-noble-mate-x86_64-20240407.iso / zh_cn
  • ventoy 1.0.97 / NTFS / EFI / Boot in grup2 mode

d0ng13 avatar Apr 09 '24 17:04 d0ng13