Trying to find a general bugfix
Normally the computer will identify the boot drive as hd0
, but this is not the case in your computer. I will try to find a way to get around that problem. I tested with Lubuntu 17.04 in my Toshiba laptop in UEFI mode, and could not reproduce the bug. So I will need your help to test whatever bugfix I can find.
Edit: I have modified the shellscript dus-persistent
of mkusb and uploaded the new version 12.1.1 to the unstable PPA. The main improvements address a change in the boot structure of Ubuntu 17.04 and the fact that your computer does not boot from hd0. The main difference is how to identify partition #4 with the image from the iso file (the iso9660 file system),
search --set=root --fs-uuid <the-UUID-of-partition-no-4>
and it is done automatically by mkusb-dus. Please test if it solves the problem! You get the new version according to this link,
help.ubuntu.com/community/mkusb/gui#from_the_unstable_PPA
The unstable version is still developed and debugged. It is available from ppa:mkusb/unstable
via the following command lines,
sudo add-apt-repository universe # this line only for standard Ubuntu
sudo add-apt-repository ppa:mkusb/unstable
sudo apt-get update
sudo apt-get install mkusb # install
# sudo apt-get dist-upgrade # upgrade to current version (with all other upgrades), only for installed systems
sudo apt-get install mkusb guidus dus mkusb-common
# upgrade all mkusb basic components including dus
# for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files, add
sudo apt-get install usb-pack-efi
Workaround - bugfix in your case
Thanks for the feedback (that you edited into the original question). It makes it easier to help.
"I tried editing the grub commands ("e") and changing hd0
to hd2
. That
works! The persistent flash drive boots as expected. (Wonder why grub
doesn't just set root to the disk it was loaded from ...?)"
I would suggest editing the grub.cfg
file in partition #3 of the 'USB drive to be persistent' (the 'usbboot' partition). This should make the bugfix persistent in your USB flash drive. But it would not work in other computers, that behave like my computers.
$ ls -l /media/lubuntu/usbboot/boot/grub/grub.cfg
-rw-r--r-- 1 lubuntu lubuntu 1312 Apr 29 06:31 /media/lubuntu/usbboot/boot/grub/grub.cfg
grub.cfg
has the following content, where you modify hd0,4
to hd2,4
. (You might also modify hd0,3
to hd2,3
, but Memtest86+ will not work in UEFI mode anyway.)
In your case you can expect 'Ubuntu' instead of 'Lubuntu', but otherwise it would look the same.
set timeout=10
set default=0
menuentry "Lubuntu-17.04-desktop-amd64.iso - persistent live" {
set root=(hd0,4)
linux ($root)/casper/vmlinuz.efi boot=casper quiet splash persistent --
initrd ($root)/casper/initrd.lz
}
menuentry "Lubuntu-17.04-desktop-amd64.iso - persistent live to RAM" {
set root=(hd0,4)
linux ($root)/casper/vmlinuz.efi boot=casper quiet splash toram persistent --
initrd ($root)/casper/initrd.lz
}
menuentry "Lubuntu-17.04-desktop-amd64.iso - live" {
set root=(hd0,4)
linux ($root)/casper/vmlinuz.efi boot=casper quiet splash --
initrd ($root)/casper/initrd.lz
}
menuentry "Lubuntu-17.04-desktop-amd64.iso - recovery mode" {
set root=(hd0,4)
linux ($root)/casper/vmlinuz.efi boot=casper ro recovery nomodeset
initrd ($root)/casper/initrd.lz
}
submenu "Memory test" {
menuentry "Memtest86+ works in BIOS alias CSM mode, but not in efi (UEFI) mode"{
echo "${grub_platform} mode; (memtest86+ does not work with efi (UEFI) mode)"
}
menuentry "Memtest86+ 4.20" {
set root=(hd0,3)
echo "${grub_platform} mode; (memtest86+ does not work with efi (UEFI) mode)"
linux16 /boot/memtest/memtest.bin
}
menuentry "Memtest86+-5.01" {
set root=(hd0,3)
echo "${grub_platform} mode; (memtest86+ does not work with efi (UEFI) mode)"
linux16 /boot/memtest/memtest86+-5.01.bin
}
}
Alternative
An alternative is to copy the menuentries of grub.cfg
and modify one of them to have two alternatives to make the USB flash drive boot easily in different computers.
...
menuentry "Ubuntu-17.04-desktop-amd64.iso - persistent live (hd2,4)" {
set root=(hd2,4)
linux ($root)/casper/vmlinuz.efi boot=casper quiet splash persistent --
initrd ($root)/casper/initrd.lz
}
menuentry "Ubuntu-17.04-desktop-amd64.iso - persistent live (hd0,4)" {
set root=(hd0,4)
linux ($root)/casper/vmlinuz.efi boot=casper quiet splash persistent --
initrd ($root)/casper/initrd.lz
}
...
Best Answer
After a debugging dialogue, the bug was found and squashed. The problem was some confusing data due to a floppy drive (a bug that only affects very old computers) in the function
p_list_drives
in the programdus
:A new version can be installed via the following commands
The current update (2017-04-02) installs mkusb version 12.0.9
Edit: After further testing (2017-04-03) this version is uploaded to the stable PPA,
ppa:mkusb/ppa
and can be installed via the following 'standard' commands