While experimenting with a LiveSlak (for Slackware 14.2) installed in an USB flash drive, I have discovered that there are boot issues on UEFI mode with some of computers, while in another it works.
Basically, the USB flash drive hosting the LiveSlak is not recognized as a valid EFI boot entry by UEFI BIOS on the affected computers, even there exists a valid configured EFI System partition hosting a GRUB2 installation. How the same computers boot quite fine my own made USB hard drives with full installations of Slackware(15.0 and -current), I looked on how LiveSlak partitions and setup the flash drive.
So, when you install LiveSlak on a flash drive using
iso2usb.sh , by default it creates 3 partitions on a GPT disk label:
- 1st partition is of
1MB as size and type
BIOS Boot, which partition is formatted FAT16 with the label "DOS".
- 2nd partition is of
100MB as size and type
EFI System, which partition is formatted FAT32 with the label "EFI".
- 3rd partition uses the rest of drive, has the type
Linux filesystem, which partition is formatted EXT4FS with the label "LIVESLAK"
There I identified 2 distinct issues:
1. the first partition of type
BIOS Boot, because it's formatted as FAT16 manages to create confusion for the firmware of one of my computers, which somehow ends with ignoring the real EFI partition. In other hand, those GPT of type
BIOS Boot are usually used by GRUB2 for installing in legacy BIOS mode. They does not need to be formatted (could be initially wiped as well) and anyway, a 1MB partition is too small even for the GRUB2 from Slackware 14.2 because there is supposed to be installed the second stage of it, which could be bigger.
So, I have chosen to grow just in case this BIOS Boot partition to 10MB and to thoughtfully wipe it with
dd instead of formatting. And what the heck? In the end, a space consumption of 10MB is anyway insignificant on an USB flash drive of
4GB, which is minimum for hosting a full Slackware 14.2 LiveSlak, while Slackware 15.0 LiveSlak needs at least an USB flash drive of
8GB.
Because it actually is not used at all today, it's possible to wipe it even on an actual flash drive with LiveSlak, if there's suspicion of interfering with the UEFI boot.
2. the second partition of type
EFI System seems to create problems with 3 of my computers, because they does not like, well... its filesystem label.
Believe or not, by changing the label from "EFI" to "ESP" had been fixed the EFI boot issues in those computers.
For convenience, if you intend to apply directly those changes to
iso2usb.sh, there's a patch for the latest sources code.
Code:
--- iso2usb.sh.orig 2023-01-01 20:48:17.762329651 +0200
+++ iso2usb.sh 2023-01-06 09:47:16.371370613 +0200
@@ -30,12 +30,12 @@
FORCE=0
# The default layout of the USB stick is:
-# partition 1 (1MB),
+# partition 1 (10MB),
# partition 2 (100 MB)
# partition 3 (claim all free space - specified as 0 MB).
# The script allows for an amount of free space to be left at the end
# (partition 4, unused by liveslak) in case you need this:
-DEF_LAYOUT="1,100,-1,"
+DEF_LAYOUT="10,100,-1,"
# By default, we use 'slhome.img' as the name of the LUKS home containerfile.
DEF_SLHOME="slhome"
@@ -195,7 +195,7 @@
#
# $(basename $0) -i ~/download/slackware64-live-14.2.iso -o /dev/sdX
# $(basename $0) -i slackware64-live-xfce-current.iso -o /dev/mmcblkX -c 750M -w 15
-# $(basename $0) -i slackware-live-current.iso -o /dev/sdX -y 1,200,-1,4096
+# $(basename $0) -i slackware-live-current.iso -o /dev/sdX -y 10,200,-1,4096
#
EOT
}
@@ -702,10 +702,10 @@
TARGETP2=$(fdisk -l $TARGET |grep ^$TARGET |cut -d' ' -f1 |grep -E '[^0-9]2$')
TARGETP3=$(fdisk -l $TARGET |grep ^$TARGET |cut -d' ' -f1 |grep -E '[^0-9]3$')
- # Create filesystems:
- # Not enough clusters for a 32 bit FAT:
- mkdosfs -s 2 -n "DOS" ${TARGETP1}
- mkdosfs -F32 -s 2 -n "EFI" ${TARGETP2}
+ # Wipe the BIOS Boot partition:
+ dd if=/dev/zero of=${TARGETP1} bs=512
+ # Create EFI System filesystem:
+ mkdosfs -F32 -s 2 -n "ESP" ${TARGETP2}
# KDE tends to automount.. so try an umount:
if mount |grep -qw ${TARGETP3} ; then
umount ${TARGETP3} || true
As well, you can wipe manually (and safely) the 1st partition with
dd and to tune the label of ESP with
fatlabel in an USB flash drive already configured for LiveSlak - I tested also this way with success.
If you wonder from where "ESP" come, this is usually the name of EFI partition used in documentation (I guess it's from
EFI
System
Partition) and I used this label for ESPs with great success in various Linux distributions since at least 10 years.