Tomas-M / linux-live

Linux Live Kit
http://www.linux-live.org/
1.01k stars 250 forks source link

"Boot error" when using a USB #168

Closed jaepetto closed 3 years ago

jaepetto commented 3 years ago

I have an issue that is probably related to my lack of understanding of the linux boot process.

as per the README, I unzipped the generated data to my USB drive (FAT32 formatted). Unfortunately, the executable flag of the bootinst.sh script gets lost during the copy process. I tried to chmod +x bootinst.sh in order to make the script executable agaln but the FAT32 is preventing me to do it (there's no error message, but the flag does not get set).

As a workaround, I tried to launch the script without needing to have the flag (/bin/sh bootinst.sh). In this case, the script fails while complaining about other binaries not being executable.

As another workaround, I formatted the USB disk as ext4. The bootinst.sh script can be executed successfully, but I get a 'boot error' message when I boot with the USB stick.

What would be the correct way to format / proceed with the USB stick?

Thanks in advance for your help.

jaepetto commented 3 years ago

I just managed to use the bootinst.sh with a FAT32 partition (by mounting the USB pen with the exec option). Unfortunately, I still get a 'Boot error' message when using it.

bert003 commented 3 years ago

Can you fdisk your USB drive and make sure the partition has the bootable flag toggled?

jaepetto commented 3 years ago

You are right, the boot flag is not toggled:

root@vm:~# fdisk /dev/sdb 

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/sdb: 14.45 GiB, 15506341888 bytes, 30285824 sectors
Disk model: USB DISK 2.0    
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: 0x20ac7dda

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sdb1       3224498923 3657370039  432871117 206.4G  7 HPFS/NTFS/exFAT
/dev/sdb2       3272020941 5225480974 1953460034 931.5G 16 Hidden FAT16
/dev/sdb3                0          0          0     0B 6f unknown
/dev/sdb4         50200576  974536369  924335794 440.8G  0 Empty

I suppose I should toggle the flag on /dev/sdb2. correct?

bert003 commented 3 years ago

I suppose I should toggle the flag on /dev/sdb2. correct?

Yes that is correct. However I would use FAT32 not FAT16 as the partition type. At least that is what I used in mine and it worked.

jaepetto commented 3 years ago

Thanks for your help. I'm moving slowly forward. there must have been something wrong with the way the 'disks' utility on Ubuntu works because I was unable to toggle the flag (neither with fdisk nor with parted). I just re-created the fat32 partition with parted and turned on the boot flag and the USB stick is now booting...

This being said, the USB drive boots up but throws 'failed to load COM32 file /linux/boot/vesamenu.c32'

bert003 commented 3 years ago

Is your directory named linux or Linux? Letter case matters.

jaepetto commented 3 years ago

That was my bad... for some reason I assumed that the unzip process was uncompressing to an incorrect folder. Therefore, I was moving the content of the linux folder one level up:

mkdir -p /tmp/linux-live
unzip linux-x86_64.zip -d /tmp/linux-live
cd /tmp/linux-live/
# the incorrect command
mv linux/* .
./boot/bootinst.sh

This was leading to the files being copied 'one level too high'. Hence the missing .c32 files.

Now the key boots successfully but keeps on looping every 15s on the yellow boot menu... apparently, there's an error with the boot options but they are disappearing too quickly to be read...

bert003 commented 3 years ago

Can you post the contents of syslinux.cfg?

jaepetto commented 3 years ago

This was my fault, in the syslinux.cfg, the KERNEL config was not pointing to the correct kernel. It was the generic kernel (vmlinuz) instead of the one installed on my machine:

UI /linux/boot/vesamenu.c32

TIMEOUT 140
MENU ROWS 4

MENU CLEAR
# MENU BACKGROUND /linux/boot/bootlogo.png

LABEL default
MENU LABEL Run Linux
KERNEL /linux/boot/vmlinuz-5.11.0-34-generic
APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 perch

LABEL default
MENU LABEL Run Linux debug
KERNEL /linux/boot/vmlinuz-5.11.0-34-generic
APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 debug perch

It now works... Thanks for your help!