Saturday, July 16, 2016

Booting the Slackware installer from a USB drive in UEFI mode

I found difficulties to boot the Slackware installer from a USB drive  in UEFI mode. I works perfect in Legacy mode (BIOS), but I'm curious about how to do it in UEFI. These are a couple of options to do it.

1. Using the script usbimg2disk.sh located in usb-and-pxe-installers directory. There are two options to use it, but the second is which I found more useful, that is, to create a complete installation USB drive which is editable. To do this, I find better to download the Slackware file tree instead of an iso image.

#  ./usbimg2disk.sh -f -s ../../slackware64-14.2 -o /dev/sdx

The -f option is used to format the drive before copying the files, this is optional.

2. Copying directly the iso image into the USBdrive. This can be done directly by using:
# dd if=./slackware.iso of=/dev/sdx

In both cases, when you boot the computer, you should call the EFI bootloader (pressing Esc in my case) and select the correct option. A Grub menu will be loaded from which you can load the Slackware installing system.

The last option should work, but I don't like it because I prefer to have a writable installation media which allows me to add and remove packages. Also I would like, in the short future, to maintain and update the installer with the fresher -current version.

Of course there are another ways to do it but, for me, these worked well.

Note:
To clear the GPT and the MBR partition table of a drive you can use gdisk:
# gdisk /dev/sdbx

go to expert menu by presing the key x
Use zap (z) to destroy the GPT data structure. In the same process the application will ask you if you want to blank the MBR, I use to do it in order to erase any boot option.

Although the preceding process cleans the booting information from the drive, some debris could remain, in particular if you previously wrote directly the iso DVD image into the drive using dd. To clean that you also should apply wipefs to the drive:

# wipefs -a /dev/sdbx



No comments: