Solved Flash Installation Media shows Corrupt

When I create installation media on USB flash and then examine it I see some weirdness. Is it something I should be concerned with?

I create the image with dd if=./[URL='https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/11.1/FreeBSD-11.1-RELEASE-amd64-memstick.img']FreeBSD-11.1-RELEASE-amd64-memstick.img[/URL] of=/dev/da0 bs=64k

Looking at the output from gpart and fsck I'm seeing this;

Code:
=>      3  1508214  da0  GPT  (30G) [CORRUPT]
        3     1600    1  efi  (800K)
     1603      118    2  freebsd-boot  (59K)
     1721  1504448    3  freebsd-ufs  (735M)
  1506169     2048    4  freebsd-swap  (1.0M)
Code:
** /dev/da0p3
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
12100 files, 701668 used, 48635 free (235 frags, 6050 blocks, 0.0% fragmentation)

***** FILE SYSTEM IS CLEAN *****

GEOM: diskid/DISK-AA39V56KDXAKYY03AP: the secondary GPT header is not in the last LBA.
 
So yeah that fixed it. Wonder why that happens. I tried a few different drives and downloads, no difference.
 
It's dd.
When you use it on a drive with GPT layout, it overwrites the primary GPT table with the information from the image.
The secondary (backup) GPT table at the end of the disk remains unchanged and still holds the old information which then no longer match the primary....
gpart recover fixes that.
 
I see there's a reason for it. There's no way for the image writing process to be aware of an arbitrary media size and the table always expects to see the backup block at the end of the media. So good to know it's not some kind issue with the image itself. I'll just fix it with recover to get rid of the inconsistency when I run into it.

The problem I ran into is that gpart will not allow modification of the table if it sees that error. But even after fixing the error, the installation image table does not allow the addition of another partition. The media I'm using is 32GB and I'm only using about 1GB for the install image. I have a use for that space, but I can't add another partition.

I'd like to make the install process a little more automated by preseeding it with some answers. Evidently I need an installerconfig script for that, but having trouble finding a good write-up on the configuration of that file.
 
Back
Top