mbusb / multibootusb

Create multiboot live Linux on a USB disk...
http://multibootusb.org/
GNU General Public License v2.0
1.39k stars 201 forks source link

Multiboot USB boots to GRUB CLI only, no menu #242

Closed martinedelbrock closed 6 years ago

martinedelbrock commented 6 years ago

OS: 4.13.0-kali1-amd64 #1 SMP Debian 4.13.13-1kali1 (2017-11-17) x86_64 GNU/Linux MultiBootUsb linux version 8.9.0 64 gb alcor flash drive, prevously low-level formatted, checked for errors and formatted to fat32 single primary partition with boot flag

Issue: boots to GRUB command line, no menu

When checking inside program all works ok - menu shows up, but not working in real boot from usb

ls output:

(ahci0) (ahci0,gpt3) (ahci0,gpt2) (ahci0,gpt1) (proc)

syslinux.cfg:

This file is created by MultiBootUSB.

default vesamenu.c32 prompt 0 menu title MultiBootUSB MENU BACKGROUND /multibootusb/bg.png TIMEOUT 300 MENU WIDTH 80 MENU MARGIN 10 MENU PASSWORDMARGIN 3 MENU ROWS 12 MENU TABMSGROW 18 MENU CMDLINEROW 18 MENU ENDROW -1 MENU PASSWORDROW 11 MENU TIMEOUTROW 20 MENU HELPMSGROW 22 MENU HELPMSGENDROW -1 MENU HIDDENROW -2 MENU HSHIFT 0 MENU VSHIFT 0 MENU COLOR border 30;44 #40ffffff #a0000000 std MENU COLOR title 1;36;44 #9033ccff #a0000000 std MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all MENU COLOR unsel 37;44 #50ffffff #a0000000 std MENU COLOR help 37;40 #c0ffffff #a0000000 std MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std MENU COLOR msg07 37;40 #90ffffff #a0000000 std MENU COLOR tabmsg 31;40 #30ffffff #00000000 std

Boot from HDD

LABEL Boot from Hard Drive MENU LABEL Boot from Hard Disk KERNEL chain.c32 APPEND hd1 MENU DEFAULT

Boot GRUB2

LABEL GRUB2 MENU LABEL Load GRUB2 BootManager Linux /multibootusb/grub/lnxboot.img INITRD /multibootusb/grub/core.img TEXT HELP Switch to GRUB2 bootloader for more options. Some distros may or may not run on GRUB2, but worth a try. Menu entries under GRUB2 are either converted from syslinux config or supported through native grub.cfg/loopback.cfg. ENDTEXT

Boot PLoP BootManager

LABEL GRUB2 MENU LABEL PLoP BootManager KERNEL /multibootusb/plpbt

start Parrot-full-3.9_amd64

LABEL Parrot-full-3.9_amd64 MENU LABEL Parrot-full-3.9_amd64 BOOT /multibootusb/Parrot-full-3.9_amd64/isolinux/debian-install.bs

end Parrot-full-3.9_amd64

start nst-26-9267.x86_64

LABEL nst-26-9267.x86_64 MENU LABEL nst-26-9267.x86_64 BOOT /multibootusb/nst-26-9267.x86_64/isolinux/fedora.bs

end nst-26-9267.x86_64

start cyborg-hawk-linux-v-1.1

LABEL cyborg-hawk-linux-v-1.1 MENU LABEL cyborg-hawk-linux-v-1.1 BOOT /multibootusb/cyborg-hawk-linux-v-1.1/isolinux/ubuntu.bs

end cyborg-hawk-linux-v-1.1

start Matriux_Leandros20130923

LABEL Matriux_Leandros20130923 MENU LABEL Matriux_Leandros20130923 BOOT /multibootusb/Matriux_Leandros20130923/isolinux/debian.bs

end Matriux_Leandros20130923

start bugtraq-II_bw-d-kde_x64

LABEL bugtraq-II_bw-d-kde_x64 MENU LABEL bugtraq-II_bw-d-kde_x64 BOOT /multibootusb/bugtraq-II_bw-d-kde_x64/isolinux/debian.bs

end bugtraq-II_bw-d-kde_x64

start deftZ-2017-1

LABEL deftZ-2017-1 MENU LABEL deftZ-2017-1 LINUX memdisk INITRD /multibootusb/deftZ-2017-1/deftZ-2017-1.iso APPEND iso

end deftZ-2017-1

start wifislax-4-12-final

LABEL wifislax-4-12-final MENU LABEL wifislax-4-12-final BOOT /multibootusb/wifislax-4-12-final/boot/isolinux/wifislax.bs

end wifislax-4-12-final

start bugtraq_optimus_x32_beta

LABEL bugtraq_optimus_x32_beta MENU LABEL bugtraq_optimus_x32_beta BOOT /multibootusb/bugtraq_optimus_x32_beta/isolinux/debian.bs

end bugtraq_optimus_x32_beta

start bb03-amd64-final

LABEL bb03-amd64-final MENU LABEL bb03-amd64-final BOOT /multibootusb/bb03-amd64-final/isolinux/ubuntu.bs

end bb03-amd64-final

start subgraph-os-alpha_2017-09-22_1

LABEL subgraph-os-alpha_2017-09-22_1 MENU LABEL subgraph-os-alpha_2017-09-22_1 BOOT /multibootusb/subgraph-os-alpha_2017-09-22_1/isolinux/debian-install.bs

end subgraph-os-alpha_2017-09-22_1

start Discreete_Linux_2016.1_beta1.hybrid

LABEL Discreete_Linux_2016.1_beta1.hybrid MENU LABEL Discreete_Linux_2016.1_beta1.hybrid BOOT /multibootusb/Discreete_Linux_2016.1_beta1.hybrid/isolinux/debian.bs

end Discreete_Linux_2016.1_beta1.hybrid

start BT5R3-KDE-64

LABEL BT5R3-KDE-64 MENU LABEL BT5R3-KDE-64 CONFIG /multibootusb/BT5R3-KDE-64/isolinux/isolinux.cfg APPEND /multibootusb/BT5R3-KDE-64/isolinux

Delete or comment above two lines using # and remove # from below line if you get not a COM module error.

BOOT /multibootusb/BT5R3-KDE-64/isolinux/ubuntu.bs

end BT5R3-KDE-64

start anonymos-shmoo

LABEL anonymos-shmoo MENU LABEL anonymos-shmoo

end anonymos-shmoo

start NodeZero

LABEL NodeZero MENU LABEL NodeZero CONFIG /multibootusb/NodeZero/isolinux/isolinux.cfg APPEND /multibootusb/NodeZero/isolinux

Delete or comment above two lines using # and remove # from below line if you get not a COM module error.

BOOT /multibootusb/NodeZero/isolinux/ubuntu.bs

end NodeZero

start LionSec-Linux-5.0-amd64

LABEL LionSec-Linux-5.0-amd64 MENU LABEL LionSec-Linux-5.0-amd64 BOOT /multibootusb/LionSec-Linux-5.0-amd64/isolinux/ubuntu.bs

end LionSec-Linux-5.0-amd64

start wt7-elite-1315.04.182016

LABEL wt7-elite-1315.04.182016 MENU LABEL wt7-elite-1315.04.182016 BOOT /multibootusb/wt7-elite-1315.04.182016/isolinux/debian.bs

end wt7-elite-1315.04.182016

start VL-7.2-STD-FINAL

LABEL VL-7.2-STD-FINAL MENU LABEL VL-7.2-STD-FINAL BOOT /multibootusb/VL-7.2-STD-FINAL/isolinux/redhat.bs

end VL-7.2-STD-FINAL

start kali-linux-2017.3-amd64

LABEL kali-linux-2017.3-amd64 MENU LABEL kali-linux-2017.3-amd64 BOOT /multibootusb/kali-linux-2017.3-amd64/isolinux/debian-install.bs

end kali-linux-2017.3-amd64

start kodachi-3.7-64

LABEL kodachi-3.7-64 MENU LABEL kodachi-3.7-64 LINUX memdisk INITRD /multibootusb/kodachi-3.7-64/kodachi-3.7-64.iso APPEND iso vmalloc=16016M

end kodachi-3.7-64

start pentoo-amd64-hardened-2015.0_RC5

LABEL pentoo-amd64-hardened-2015.0_RC5 MENU LABEL pentoo-amd64-hardened-2015.0_RC5

end pentoo-amd64-hardened-2015.0_RC5

start xiaopan6.4.1

LABEL xiaopan6.4.1 MENU LABEL xiaopan6.4.1 BOOT /multibootusb/xiaopan6.4.1/boot/isolinux/slitaz.bs

end xiaopan6.4.1

ghost commented 6 years ago

I'm rather sure this is the same issue as:

209 and #239

martinedelbrock commented 6 years ago

There are some errors reported before getting into GRUB cli in issue #209 and there are no errors in this case, so it is similar to #239

eaglerainbow commented 6 years ago

Here is yet another case, where we run into the problem that the GRUB cli is booted without displaying the menu:

With a little playing around (ls) I could figure out:

Therefore, it seems like that grub can't find the USB pen, on which grub is installed (and thus cannot load its configuration files). The pen is a 123GB Verbatim USB 3.0 stick, formatted with msdos partition table and one FAT32 as a whole disk:

Disk /dev/sdb: 115.4 GiB, 123882962944 bytes, 241958912 sectors
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: dos
Disk identifier: 0x240da7c8

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1  *     2048 241956863 241954816 115.4G  c W95 FAT32 (LBA)

Booting was performed using "F12" (temporary change of boot sequence).

Booting the stick via legacy boot and jumping from syslinux to grub2 works fine (but does not imply that it the stick was booted using EFI, which is a problem in my case, as I want to able to install Win10 in UEFI mode).

Ideas and suggestions welcome!

eaglerainbow commented 6 years ago

On the very same machine, there is an Debian 8 installed, which runs on GNU GRUB 2.02~beta2-22+deb8u1 (remember: the system is configured "UEFI only"). Using the command line environment with USB stick in the port, the result of ls is different:

(hd0) (hd1) (hd1,gpt6) (hd1,gpt5) (hd1,gpt4) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1) (cd0) (proc)

With a little of testing, I again come to the conlusion that

eaglerainbow commented 6 years ago

Yet another interesting aspect perhaps: Booting the USB stick again, I issued nativedisk and got back the following error message:

error: disk 'usb0,msdos1' not found

Moreover, lspci thinks that we have

...
00:14.0 8086:9d2f [0c03] USB Controller [PI 30]
...
eaglerainbow commented 6 years ago

And yet another observation. Same USB stick as mentioned above, now inserted into a computer running on an Asus M5A97 motherboard. The MB has both USB 2.0 and USB 3.0 hosts running.

eaglerainbow commented 6 years ago

@openprivacy also reports in #209 that he can got his issue with an USB 3.0 stick.

eaglerainbow commented 6 years ago

I have created an overview wiki page for this entire topic, as apparently the issue is quite widespread.

derEremit commented 6 years ago

yes, for me it was usb3.0 both port and stick

eaglerainbow commented 6 years ago

yes, for me it was usb3.0 both port and stick

Thanks for the update - I have adjusted the overview wiki page accordingly.

tobiasBora commented 6 years ago

Hello,

Similar problem here, but not exactly: I can boot normally on UEFI system if I run it on a USB 2.0 port, but I enter inside the menu if I run it from a USB 3.0 port.

If I run it from the Usb 2.0, it hangs during something like 1mn, and then I can read:

(ahci0) (ahci0,gpt9) (ahci0,gpt8) ... (ahci0,gpt1)
(usb0) (usb0,msdos1) (ahci1) (proc) (lvm/mvg-DebianVar) (lvm/mvg-DebianHome) (lvm/mvg-DebianSystem)

If I try "ls", in the Usb 3.0 case I've (after 1mn of hanging):

(ahci0) (ahci0,gpt9) (ahci0,gpt8) ... (ahci0,gpt1)
(ahci1) (proc) (lvm/mvg-DebianVar) (lvm/mvg-DebianHome) (lvm/mvg-DebianSystem)

So no idea why the usb key does not appear in the list for 3.0... Especially because when I installed grub by myself on my key before that it worked like a charm.

martinedelbrock commented 6 years ago

@eaglerainbow issue occasionally self-fixed without any effort from my side. Graphical menu appears on boot, no CLI. All os images on pendrive (10+ images) seem to be working.

Still using same pendrive with no changes since issue was occuring (no-name aliexpress usb2.0 chinese pendrive).

And still not changed nor updated parrot os x64 (3.9 release) on lenovo netbook, same USB socket (it looks like 2.0 socket, not 3.0).

Same pendrive being plugged in in another socket is not recognised as bootable media.

eaglerainbow commented 6 years ago

@martinedelbrock Because I am suspecting the USB port, in which you boot the USB stick, just to be sure that I got it right what you said:

Are you sure that you booted via (U)EFI and not via MBR?

mbusb commented 6 years ago

To make things clear, if the grub2 drops you to shell then it means that it is unable to find the configuration file located at (usb0,gpt1)/multibootusb/grub.cfg. That is how the efi binary is compiled for UEFI booting.

I am looking for the solution to load the configuration file by scanning all devices by enbedding configuration file in to grub2 binary. The link would be helpful for some on how to do it https://www.gnu.org/software/grub/manual/grub/html_node/Embedded-configuration.html. This require some time for me to test and pushing it back to repo.

@eaglerainbow Thanks for the wiki. This will remind me of things to consider for the next commit.

The possible workaround:- as per this documentation, you need to find the device in the shell and set the root and prefix pointing to multibootusb directory. I will post the details later.

eaglerainbow commented 6 years ago

@mbusb Thought so already that the config file could not be loaded. In various locations, however, there are indications that the root cause for not being able to load the file seems to be that the entire drive (here: USB stick) cannot be found at all. So for my case, I manually checked all devices listed by ls, but the necessary drive wasn't available. Though not being a 100% safe indicator, in many cases it seems to be related with using either USB3.0 devices or USB3.0 ports (that's also one reason why I created the wiki page for it, to assist by bringing some more transparency into the topic. My gut-feeling tells me that we have "the same symptom but with multiple root causes").

@all users affected (esp. those mentioned on the wiki page): Please report back in which combination (USB2.0/USB3.0) of port and type of stick you are experiencing that issue. Please ensure that you are really using UEFI and do not boot using MBR/legacy booting.

eaglerainbow commented 6 years ago

I'd like to add some more details on the "research", which I did on the hardware (mainly stuff, which I currently just have around me by chance):

Motherboard USB Controllers
Asus M5A97 LE AMD SB7x0/8x0/9x0 USB OHCI0 controller
AMD SB7x0/8x0/9x0 USB EHCI controller
Asmedia ASM1042A USB3.0 Controller
Asus P8Z77-V LE Intel 7 series/C216 Chipset USB xHCI
Intel 7 series/C216 Chipset USB EHCI
Asmedia ASM1042A USB3.0 Controller
Lenovo L560 Intel Device 9d2f

Here are my test result:

Motherboard port Boot after previous power-cycle Boots to shell status of device effective grub.cfg location detectable by search -f /multibootusb/grub/grub.cfg comments
Asus M5A97 LE USB 2.0 yes yes (shell) detected at (usb1) (usb1,msdos1)/multibootusb/grub/grub.cfg yes (usb0) does not exist
Asus M5A97 LE USB 2.0 no yes (shell) detected at (usb1) (usb1,msdos1)/multibootusb/grub/grub.cfg yes (usb0) does not exist
Asus M5A97 LE USB 3.0 yes yes (shell) not detected n/a no  
Asus M5A97 LE USB 3.0 no yes (shell) not detected n/a no  
Asus P8Z77-V LE USB 3.0 yes yes (shell) not detected n/a no hanging long time on ls
Asus P8Z77-V LE USB 3.0 no yes (shell) not detected n/a no hanging long time on ls
Asus P8Z77-V LE USB 2.0 yes no (menu) detected at (usb0) (usb0,msdos1)/multibootusb/grub/grub.cfg yes hanging long time on ls and search, with boot problems of some images
Asus P8Z77-V LE USB 2.0 no no (menu) detected at (usb0) (usb0,msdos1)/multibootusb/grub/grub.cfg yes hanging long time on ls and search, with boot problems of some images
Lenovo L560 USB 3.0 yes yes (shell) not detected n/a no hanging long time on ls
Lenovo L560 USB 3.0 no yes (shell) not detected n/a no hanging long time on ls

NB: I did not investigate on the boot problems of the images - that seems to be yet another topic, which I expect is unrelated to the current discussion here.

Here is what I make out of it:

  1. Execution after cold-boot did not differ in any case from the behavior after warm-boot (in contrast to what @gene1wood had observed at https://github.com/mbusb/multibootusb/issues/165#issuecomment-352521264 )
  2. None of my USB3.0 ports did work.
  3. Executing the test on a USB 2.0 port is also no guarantee to make things work: the USB stick may be also be detected as (usb1) instead of (usb0).

@mbusb I would expect that your efforts you are proposing to take in https://github.com/mbusb/multibootusb/issues/242#issuecomment-352843741 will solve my issue no. 3, but will leave my issue no. 2 unresolved.

HTH!

mbusb commented 6 years ago

I have made a latest commit to devel to solve this issue. Tested by a user and it works fine. Can some one test and report back, so that I can prepare for new release.

eaglerainbow commented 6 years ago

Will try to as soon as possible and provide feedback via this ticket here.

mbusb commented 6 years ago

If you confirm then I will release it by tomorrow.

On 30-Dec-2017 1:19 AM, "eaglerainbow" notifications@github.com wrote:

Will try to as soon as possible and provide feedback via this ticket here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mbusb/multibootusb/issues/242#issuecomment-354492606, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC34PPz-TKNJ7mZTPhbprKWMXSFVHXPks5tFUJKgaJpZM4Q1LmB .

eaglerainbow commented 6 years ago

I am on it right now... However, I have to first create me a proper environment - otherwise the test will be for the toss 🤔

eaglerainbow commented 6 years ago

I currently struggle with

Traceback (most recent call last):
  File "/usr/local/bin/multibootusb", line 149, in <module>
    config.image_path = arg
NameError: name 'config' is not defined

when running some non-trivial variant like multibootusb -c -i .... However, /usr/local/lib/python3.5/dist-packages/scripts/config.py is there and looks good to me. Any clue what I could be doing wrong?

[Sorry for that noob-ish comment, but I am not familar with python at all]

Update: Found #238. Trying to understand it, but it does not match to what i see... Python is 3.5.2 running on ubuntu:16.04.3 LTS Update: Mmmh.. made also sure that the packages python3-pyqt5 parted util-linux mtools python3-dbus python3-pyudev p7zip-full python3-six are installed. Same situation...

eaglerainbow commented 6 years ago

Tossed now my initial environment and changed to the machine where I initially had installed multibootusb. I did a

dpkg -r python3-multibootusb

there. Afterwards I cloned your repository as of state 67f57a8d889dc4abf56cbf75ffcaf531941a271b, branch master and created a fresh USB3.0 installation using a single iso image, plugging the stick into the USB3.0 port of the Lenovo L560:

Switching over to my Asus M5A97 LE, I plugged it into an USB 2.0 port:

In short: nope. Though it did not break anything major, it also did not solve neither issue 2 nor issue 3 for me.

eaglerainbow commented 6 years ago

Humpf... Just saw that you were asking for a test on branch devel. Will repeat the entire procedure...

mbusb commented 6 years ago

I wanted you to test devel branch not master.

On 30-Dec-2017 2:42 AM, "eaglerainbow" notifications@github.com wrote:

Tossed now my initial environment and changed to the machine where I initially had installed multibootusb. I did a

dpkg -r python3-multibootusb

there. Afterwards I cloned your repository as of state 67f57a8 https://github.com/mbusb/multibootusb/commit/67f57a8d889dc4abf56cbf75ffcaf531941a271b, branch master and created a fresh USB3.0 installation using a single iso image, plugging the stick into the USB3.0 port of the Lenovo L560:

  • Grub again fell into shell mode
  • ls still does not list the USB device
  • Grub still is the old version 2.02~rc1

Switching over to my Asus M5A97 LE, I plugged it into an USB 2.0 port:

  • Grub again fell into shell mode
  • ls lists again that (usb1,gpt1) is there and there I can also find the grub.cfg file at the place where I would expect it to be.

In short: nope. Though it did not break anything major, it also did not solve neither issue 2 nor issue 3 for me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mbusb/multibootusb/issues/242#issuecomment-354501109, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC34Iq8JRptO9BpB5gAoWChJOmWMmOXks5tFVXYgaJpZM4Q1LmB .

eaglerainbow commented 6 years ago

Status as of branch devel, commit 22226a40fcd06f8950e893daaef6fd8804ce0ecc:

Summary:

Based on that I am in favor of releasing the new version.

eaglerainbow commented 6 years ago

@martinedelbrock You are the initial reported of this issue (I only "hijacked" it with the intention of contribution 😛 ). Version 9.0.0 is out. Could you please check if this fixes your issue as well? If yes, please close this issue...

JanSchnacki commented 6 years ago

Is it somehow possible to upgrade the bootloader binaries on an existing stick? Or do I need to completely wipe it an start from the beginning?

mbusb commented 6 years ago

It is better to rename multibootusb and efi directory.

On 04-Jan-2018 1:13 AM, "JanSchnacki" notifications@github.com wrote:

Is it somehow possible to upgrade the bootloader binaries on an existing stick? Or do I need to completely wipe it an start from the beginning?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mbusb/multibootusb/issues/242#issuecomment-355106252, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC34IoRrKt9rVD6ZQ_wzByDZnBR--6Lks5tG9dygaJpZM4Q1LmB .

Naguz commented 6 years ago

I have had the exact same problem, and just tried with the current devel branch, and it worked great.

NOTE: For anyone else experiencing troubles even with lates devel branch, make sure you run it in a chroot or similar, or uninstalls the currently installed version of MultibootUSB. I couldn't understand why I would still get booted into GRUB 2.02~rc1 before I realized the downloaded devel branch would not use it's own mbr.bin, but rather use the one in /usr/share/multibootusb from the currently installed version.

Suggestion for an easy way to help others not make the same mistake: make this clear in a warning message when running the version in devel branch. Although I am open for the idea that people more used to debugging things straight from git just assumes things like this happens if you have the same software already installed.

mbusb commented 6 years ago

The new version (9.1.0) fixed this issue. If anyone experience issue of similar sort may open new issue as it would allow me to narrow down to the latest version.