Solved Cannot boot

I installed FreeBSD on a GPT partitioned disk which has a single freebsd-ufs partition and 4k free space at the end. The system will only boot with the aid of a Grub USB stick which allows me to select (hd0,gpt1).

What is the easiest way to install a bootloader? I'm never sure if I need a separate boot partition, or can i just run:-
Code:
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
 
One way or the other: you'll need a FreeBSD boot partition to make this work. The command you showed above only works when -i 1 actually points to such a boot partition.

I suggest re-reading the handbook on the installation procedures as well as gpart(8).

Writing pmbr to GPT is not what I think you want to do....
Yes it is.

Meh, I also always get confused when doing this stuff from mind.
 
512k should be enough. In theory it can be placed at the end I suppose, but I never tried it myself so I can't be sure.

As to resizing... I'm only familiar with growfs(8) so my bet is on making a backup, re-partitioning and then restoring.
 
I had a look at gparted to see if it could resize UFS partitions, but no. Then I tried gpart resize with a smaller size than current but that caused a crash, so had to resort to gpart destroy -F ada0 and create some partitions. I created a 512k freebsd-boot partition near the end of the disk and that seemed OK. Then I ran gpart bootcode -p /boot/gptboot -i 2 ada0 and rebooted, and the boot process started. I now realise that the index number of the command should correspond with the freebsd=boot partition. Then after untarring my backup to the main partition I ran gpart bootcode -b /boot/pmbr ada0, rebooted and 'almost' booted up successfully.. The mountroot prompt appeared because my fstab included labels and I'm not sure what happened to them, so had to do a quick change to fstab for an uninterrupted boot.
 
Back
Top