• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Flash Installation Media shows Corrupt

CraigHB

Member

Thanks: 24
Messages: 90

#1
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=./FreeBSD-11.1-RELEASE-amd64-memstick.img 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.
 

CraigHB

Member

Thanks: 24
Messages: 90

#3
So yeah that fixed it. Wonder why that happens. I tried a few different drives and downloads, no difference.
 

k.jacker

Well-Known Member

Thanks: 207
Messages: 404

#4
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.
 

CraigHB

Member

Thanks: 24
Messages: 90

#5
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.
 
Top