Creating a boot USB is surprisingly challenging

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
So far, no go. I've tried with a 2GB and a 4GB USB stick, I've tried with Rufus and then with dd.

dd creates an EFI partition and a freebsd-boot partition that is all of 12.5k long. 25 sectors doesn't seem nearly enough. The drive is not detected as bootable by EFI or CSM.

Before I create a jira ticket on this: What has other folks' experience with the Beta 1 ISO been?

2GB stick:

Code:
thorsten@raidz-expand:~$ sudo dd status=progress if=./Downloads/TrueNAS-12.0-BETA.iso of=/dev/sdh
857641472 bytes (858 MB, 818 MiB) copied, 229 s, 3.7 MB/s
1675964+0 records in
1675964+0 records out
858093568 bytes (858 MB, 818 MiB) copied, 238.327 s, 3.6 MB/s
thorsten@raidz-expand:~$ sudo fdisk -l /dev/sdh
GPT PMBR size mismatch (1675963 != 4014079) will be corrected by write.
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sdh: 1.94 GiB, 2055208960 bytes, 4014080 sectors
Disk model: Flash Disk     
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: gpt
Disk identifier: D9CCF73F-BB18-11EA-8A0F-0CC47A1228F8

Device     Start   End Sectors  Size Type
/dev/sdh1     80  1679    1600  800K EFI System
/dev/sdh2      3    27      25 12.5K FreeBSD boot

Partition table entries are not in disk order.


4GB stick:

Code:
thorsten@raidz-expand:~$ sudo dd status=progress if=./Downloads/TrueNAS-12.0-BETA.iso of=/dev/sdh
857768448 bytes (858 MB, 818 MiB) copied, 176 s, 4.9 MB/s
1675964+0 records in
1675964+0 records out
858093568 bytes (858 MB, 818 MiB) copied, 176.028 s, 4.9 MB/s

thorsten@raidz-expand:~$ sudo fdisk -l /dev/sdh
GPT PMBR size mismatch (1675963 != 7831551) will be corrected by write.
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sdh: 3.75 GiB, 4009754624 bytes, 7831552 sectors
Disk model: v125w           
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: gpt
Disk identifier: D9CCF73F-BB18-11EA-8A0F-0CC47A1228F8

Device     Start   End Sectors  Size Type
/dev/sdh1     80  1679    1600  800K EFI System
/dev/sdh2      3    27      25 12.5K FreeBSD boot

Partition table entries are not in disk order.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Hmm. I didn't experience any of this drama. I used Linux Mint's USB Image Writer (which uses dd behind the scenes), and I was able to create a bootable 8G USB stick from the 12 Beta ISO. My USB stick successfully booted on both BIOS and UEFI systems.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
The corrupt backup GPT table and the size mismatch are expected but the drive should be bootable, nonetheless.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Yeah I expected the GPT complaints, but not the 25-sector freebsd partition - or that the drive wouldn't even show up as a boot option.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
That small FreeBSD boot partition probably contains just the BTX bootloader, and the remainder of the installer is in the unpartitioned area. The ISO looks like it has a hybrid MBR, which jumps to the BTX bootloader, instead of the standard GPT protective MBR. I can see why Rufus wouldn't work, but dd shouldn't care.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Got it - it was SecureBoot. I have a few changes to suggest to the docs anyway, so I'll include that in the PR.

Testing Rufus and Win32 Disk Imager next, I want to make sure that the recommended methods actually do work.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Rufus works, Balena Etcher works, Win32 Disk Imager works only once. Rufus can clean the drive, diskpart can. Balena Etcher and Win32 Disk Imager cannot.

I got to run, but I have some doc amendments to recommend.
 
Top