You are not logged in.

#1 2013-01-12 17:55:25

swordfish
Member
Registered: 2012-01-14
Posts: 160

[SOLVED, kind of] UEFI bootable USB from ISO doesn't start

Hi there,

out of curiosity I wanted to create an UEFI bootable usb stick with the latest Archiso 2013.01.04. I've followed https://wiki.archlinux.org/index.php/UE … B_from_ISO

and created two directories

# mkdir -p /mnt/{usb,iso}

Then I've mounted Archiso to /mnt/iso

# mount -o loop Download/ISO-Images/archlinux-2013.01.04-dual.iso /mnt/iso

After this I used cfdisk to create a FAT32 filesystem /dev/sdb1 on the usb stick, followed by

# awk 'BEGIN {FS="="} /archisolabel/ {print $3}' /mnt/iso/loader/entries/archiso-x86_64.conf | xargs mkfs.vfat /dev/sdb1 -n

Then I've mounted /dev/sdb1 to /mnt/usb and copied all iso-files there:

# mount /dev/sdb1 /mnt/usb
# cp -r /mnt/iso/* /mnt/usb

Followed by:

# umount /mnt/{usb,iso}
# sync

After rebooting and hitting F11 I was presented with the UEFI firmware-tool from which I can choose UEFI (and other) applications to start. I could choose my usb stick in UEFI mode, but - only the screen turned blank for the blink of a second and the UEFI tool was on again.

Because my system is already booting in UEFI mode using rEFInd, I wanted to try rEFInd on the usb stick instead of gummiboot.

Following https://wiki.archlinux.org/index.php/UE … B_from_ISO I've copied /usr/lib/refind/refind_x64.efi (from refind-efi 0.6.4-1) to /mnt/usb/EFI/boot/bootx64.efi and created a /mnt/usb/EFI/boot/refind.conf with this text:

timeout 5
textonly

showtools about,reboot,shutdown,exit
# scan_driver_dirs EFI/tools/drivers_x64
scanfor manual,internal,external,optical

scan_delay 1
dont_scan_dirs EFI/boot

max_tags 0
default_selection "Arch Linux Archiso x86_64 UEFI USB"

menuentry "Arch Linux Archiso x86_64 UEFI USB" {
  loader /arch/boot/x86_64/vmlinuz
  initrd /arch/boot/x86_64/archiso.img
  ostype Linux
  graphics off
  options "pci=nocrs add_efi_memmap archisobasedir=arch archisolabel=ARCH_201301"
}

menuentry "UEFI x86_64 Shell v2" {
  loader /EFI/shellx64_v2.efi
  graphics off
}

menuentry "UEFI x86_64 Shell v1" {
  loader /EFI/shellx64_v1.efi
  graphics off
}

And yes, I've checked the "loader" and "initrd"-Paths - they are correct, as well as the archisolabel wink

But - again - after rebooting and hitting F11 I could select my usb stick as UEFI boot device, but all that happened was the screen going blank for the glimpse of a second and returning to the UEFI chooser.

Even my last attempt - keeping the original name refind_x64.efi in /mnt/usb/EFI/boot didn't help.

Via efibootmgr I can see:

$ sudo efibootmgr 
BootCurrent: 0001
Timeout: 5 seconds
BootOrder: 0001,0002,0007,0005,0006
Boot0001* rEFInd 0.6.4-1
Boot0002* rEFInd_recover
Boot0005* Hard Drive 
Boot0006* USB 
Boot0007* UEFI: TOSHIBA TransMemory PMAP

with "Boot0007" as my usb stick.

So my question is: Did I miss something or have I found a bug wink ?

Last edited by swordfish (2013-01-13 12:43:33)


Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)

Offline

#2 2013-01-12 22:50:12

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED, kind of] UEFI bootable USB from ISO doesn't start

A bootable USB flash drive should use FAT and have a file called EFI/BOOT/bootx64.efi (assuming a 64-bit AMD64 system). Check for such a file. If it's present, my best guess is that your firmware might be fussy about partition table types; the EFI spec talks about booting from GPT, but says little or nothing about booting from MBR. Thus, you might try convering the USB flash drive from MBR to GPT, and set the type code of the partition to that for an ESP ("boot flag" set in parted or type code EF00 in gdisk/cgdisk/sgdisk).

Offline

#3 2013-01-13 12:36:13

swordfish
Member
Registered: 2012-01-14
Posts: 160

Re: [SOLVED, kind of] UEFI bootable USB from ISO doesn't start

Hm, funny thing - now it's working, but I don't know why hmm

I've tried to convert the partition table of the usb stick from MBR to GPT using cgdisk. There I had a problem with setting the partition type to EF00. It worked under cgdisk, but then I couldn't mount my usb stick (dev/sdb1) anymore to /mnt/usb. Then I've tried to set the partition type to vfat, but couldn't identify what is vfat under cgdisk tongue . I've tried different types of "Windows" but whatever I tried, the usb stick won't mount on /mnt/usb.

Journalctl always says:

Jan 13 12:23:03 sushi sudo[727]: nihonto : TTY=pts/0 ; PWD=/home/nihonto ; USER=root ; COMMAND=/usr/bin/cgdisk /dev/sdb
Jan 13 12:23:03 sushi sudo[727]: pam_unix(sudo:session): session opened for user root by nihonto(uid=0)
Jan 13 12:23:11 sushi sudo[727]: pam_unix(sudo:session): session closed for user root
Jan 13 12:24:00 sushi su[972]: (to root) nihonto on /dev/pts/0
Jan 13 12:24:00 sushi su[972]: pam_unix(su:session): session opened for user root by nihonto(uid=1000)
Jan 13 12:24:18 sushi kernel: loop: module loaded
Jan 13 12:24:18 sushi kernel: ISO 9660 Extensions: RRIP_1991A
Jan 13 12:24:35 sushi kernel: EXT4-fs (sdb1): VFS: Can't find ext4 filesystem
Jan 13 12:24:35 sushi kernel: EXT4-fs (sdb1): VFS: Can't find ext4 filesystem
Jan 13 12:24:35 sushi kernel: EXT4-fs (sdb1): VFS: Can't find ext4 filesystem
Jan 13 12:24:35 sushi kernel: FAT-fs (sdb1): bogus number of reserved sectors
Jan 13 12:24:35 sushi kernel: FAT-fs (sdb1): Can't find a valid FAT filesystem
Jan 13 12:24:35 sushi kernel: ISOFS: Unable to identify CD-ROM format.

So I tried it again with cfdisk which nagged about "unsupported GPT" but kept working. This time I choose "0C W95 FAT32 (LBA)" as partition type - maybe this did the trick because in my earlier attempts I did choose "0B W95 FAT32".

Anyway - after following the advice stated in https://wiki.archlinux.org/index.php/UE … B_from_ISO and installing rEFInd to the usb stick I could boot the usb stick in UEFI mode smile

But - as I said earlier - I don't know what did the trick hmm

Last edited by swordfish (2013-01-13 12:38:18)


Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)

Offline

#4 2013-01-14 11:43:00

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED, kind of] UEFI bootable USB from ISO doesn't start

swordfish wrote:

Then I've tried to set the partition type to vfat, but couldn't identify what is vfat under cgdisk tongue .

Its "0700", the type code is common for all FAT and NTFS file system which is basically Windows Basic Data Partition.

So I tried it again with cfdisk which nagged about "unsupported GPT" but kept working. This time I choose "0C W95 FAT32 (LBA)" as partition type - maybe this did the trick because in my earlier attempts I did choose "0B W95 FAT32".

I don't know whether using "0C W95 FAT32 (LBA)" solved the problem but it might be possible with some firmwares. Atleast UEFI specification does not specify "0C" specifically.

Offline

#5 2013-01-14 20:47:55

swordfish
Member
Registered: 2012-01-14
Posts: 160

Re: [SOLVED, kind of] UEFI bootable USB from ISO doesn't start

the.ridikulus.rat wrote:
swordfish wrote:

Then I've tried to set the partition type to vfat, but couldn't identify what is vfat under cgdisk tongue .

Its "0700", the type code is common for all FAT and NTFS file system which is basically Windows Basic Data Partition.

Thanks for this info wink !

the.ridikulus.rat wrote:
swordfish wrote:

So I tried it again with cfdisk which nagged about "unsupported GPT" but kept working. This time I choose "0C W95 FAT32 (LBA)" as partition type - maybe this did the trick because in my earlier attempts I did choose "0B W95 FAT32".

I don't know whether using "0C W95 FAT32 (LBA)" solved the problem but it might be possible with some firmwares. Atleast UEFI specification does not specify "0C" specifically.

I will try it again with a different usb stick. Now, I'm really interested in what happened to make it work.


Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)

Offline

Board footer

Powered by FluxBB