Solved invalid partition table at the boot

Hi
I just finished to install freebsd 12 on a new disk. Only freebsd on it.
Code:
gpart show

=>       40  468862048  ada0  GPT  (224G)
         40       1024     1  freebsd-boot  (512K)
       1064   25164800     2  freebsd-ufs  (12G)
   25165864   16777216     3  freebsd-swap  (8.0G)
   41943080  398458880     4  freebsd-ufs  (190G)
  440401960   28460128     5  freebsd-ufs  (14G)

All work fine, but at the boot I've got this message "Invalide partition table !".
I click on ENTER and the system start without errors
It's not really a problem but is there a way to fix this problem ?

freebsd-ufs (12G) -> /
freebsd-ufs (190G) -> /home
freebsd-ufs (14G) -> don't use, for later

Thanks
 
I think it's rather "Invalid partition table". pmbr can write that when both primary and backup GPT headers are corrupted. But if it was the case you couldn't start at all and pressing enter would do nothing.

Maybe in gptboot, then... Without more indication I advise to regenerate the boot codes:
gpart bootcode -b pmbr -p gptboot -i1 ada0

If this doesn't work, could it be your BIOS that is complaining that no slice is active?

In this case you can use fdisk. But before, you need to tune a little to make the system (geom(4)) accept such a modification:

# sysctl kern.geom.debugflags=16
kern.geom.debugflags: 0 -> 16
# fdisk -a


After that, you need to answer "yes" several times and select the default slice (1). In any case, this won't harm your system because you touch the mbr "partition" flags while your partition scheme is GPT.
 
OK thanks for your help, but some problem with the first command
Code:
 gpart bootcode -b pmbr -p gptboot -i1 ada0

gpart: pmbr: No such file or directory

PS : yes invalid better than invalide, sorry , I'm french, and not very good in english ;)
 
Code:
[ragnarok@asgard-freebsd:~] $ sudo fdisk -a
******* Working on device /dev/ada0 *******
parameters extracted from in-core disklabel are:
cylinders=465141 heads=16 sectors/track=63 (1008 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=465141 heads=16 sectors/track=63 (1008 blks/cyl)
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 238 (0xee),(EFI GPT)
    start 1, size 468862127 (228936 Meg), flag 0
    beg: cyl 0/ head 0/ sector 2;
    end: cyl 1023/ head 255/ sector 63

The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
Do you want to change the active partition? [n] y
Supply a decimal value for "active partition"


OK I say yes, but after I answer Partition 1, is it that ?
Sorry, just afraid to have a system down ...
 
Oups, sorry:
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 ada0
These codes are in /boot.
First, test that (reboot).
And yes, you have just to specify partition 1 and answer "y" one or two times more.
 
Hi
Code:
 gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 ada0
Always the same error, but I keep this command an a post-it ;)

Code:
fdisk -a
This command has solved the problem :)

Great, thanks a lot !

SOLVED
 
Please stop using fdisk(8). It only supports MBR.

Code:
DESCRIPTION
     This command is obsolete.  Users are advised to use gpart(8) instead.
 
Please stop using fdisk(8). It only supports MBR.
I know. But the trick is to activate the fake partition in the protective MBR. gpart acts only on the GPT partitions (if the working scheme is GPT which is precisely the case). Otherwise, you can copy the sector to a file, modify it and flush back to the sector. I did that once because I was unaware of the fdisk command.
 
If your computer is connected with external hard drives beyond one, most of the time, the error Invalid Partition Table occurs on account of the mistaken boot order. In this circumstance, you can restart your computer. Then enter BIOS on startup and set the disk that contains operating system as the first option for booting.
 
I know. But the trick is to activate the fake partition in the protective MBR. gpart acts only on the GPT partitions (if the working scheme is GPT which is precisely the case). Otherwise, you can copy the sector to a file, modify it and flush back to the sector. I did that once because I was unaware of the fdisk command.

Active partition vs non-active is one of those nebulous areas of the MBR standard. On some systems the disk you now have will refuse to boot because the partition is of a "non-standard" type and you need to clear the active flag for it to boot. On some other systems like yours the active flag is required for booting regardless of the partition type.

All more the reasons to finally get rid of MBR completely.

Oh and this should have done the trick as well for you:
Code:
gpart set -a active ada0

There's also a special "lenovofix" flag for certain lenovo models that choke on the standard protective MBR:

Code:
lenovofix     Setting this attribute    overwrites the Protective MBR with a
new one where the 0xee    partition is the second, rather    than
the first record.  This resolves a BIOS compatibility issue
with some Lenovo models including the X220, T420, and T520,
allowing them to boot from GPT    partitioned disks without
using EFI.
 
Back
Top