# Quick install of FreeBSD



## balanga (Feb 14, 2018)

I'm trying to come up with a quick install of FreeBSD on a blank disk and have got so far:-

```
gpart show da0                                                                                                                                                                     
gpart destroy -F da0                                                                                                                                                               
gpart create -s gpt da0                                                                                                                                                            
gpart add -t freebsd-boot -l gpboot -b 40 -s 512K da0                                                                                                                              
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0                                                                                                                             
gpart add -t freebsd-ufs -l gprootfs da0                                                                                                                                           
mount /dev/da0p2 /mnt                                                                                                                                                              
cd /mnt                                                                                                                                                                            
fetch -o - ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/11.1-RELEASE/base.txz | tar xSf -                                                                                 fetch -o - ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/11.1-RELEASE/kernel.txz | tar xSf -
```

The system is installed, but it doesn't load. What am I missing?

I thought the `gpart bootcode` would be sufficient..


----------



## gkontos (Feb 14, 2018)

balanga said:


> The system is installed, but it doesn't load. What am I missing?



/etc/fstab?


----------



## balanga (Feb 14, 2018)

gkontos said:


> /etc/fstab?



A missing /etc/fstab would stop the boot process at the *mountroot> * prompt.

The system isn't loading at all.

Having said that, I just tried the disk in my ThinkPad T60 and it boots up OK, although it does stop at the mountroot prompt.

It doesn't load on my T420 or X220, so it seems it has something to do with EFi...


----------



## SirDice (Feb 14, 2018)

You're missing the kernel, it's in a separate archive. The system really won't do much without it.


----------



## CraigHB (Feb 14, 2018)

I use an install script myself, nice it's possible to do simply with FreeBSD.  But yeah there's two packages you need, three if you want 32 bit compatibility.  There's some configuration required after extracting the archives.  You'll need to mount the root partition and at least copy over a good fstab.  I think it will boot at that point, but you'll want more configuration than that.  In my case there's a bunch of configuration files I keep on the installation media which get overlayed by the script.


----------



## balanga (Feb 14, 2018)

Can you clarify?

I *can* boot on a ThinkPad T60 so the kernel is there... Even if there wasn't a kernel, wouldn't I still see the loader?


----------



## leebrown66 (Feb 15, 2018)

balanga said:


> It doesn't load on my T420 or X220, so it seems it has something to do with EFi...
> <snip>
> I *can* boot on a ThinkPad T60 so the kernel is there... Even if there wasn't a kernel, wouldn't I still see the loader?


You didn't put any EFI stuff down, so I'm guessing the 420 and 220 laptops are configured to expect it but the 60 doesn't?
Look at UEFI(8) for the verbiage to configure and the memstick.img for a working example that boots both BIOS and UEFI.
And as SirDice says, you still need a kernel.


----------



## CraigHB (Feb 15, 2018)

The boot loader runs to stage four then picks up the kernel which takes control of the console.  The loader displays a few lines of text, but that's it.  Without a kernel you would not get much on the console before the machine stopped doing anything.


----------

