# FreeBSD 10 install



## Cristian (Jul 30, 2015)

Currently iI am trying to install my first FreeBSD machine without much luck.

I have tried making a boot USB key, by downloading FreeBSD-10.1-RELEASE-amd64-dvd1.iso and burning this to a USB key on Ubuntu with dd.

`sudo dd if=/FreeBSD-10.1-RELEASE-amd64-dvd1.iso of=/dev/sd[letter]1 bs=4M`

The files get copied over no trouble and everything seems fine when mounting the key and displaying its content. But when iI try and boot from the key its totally ignored.

The BIOS of the machine is set as boot USB key first, and iI have also manually selected it by pressing F9 (on my system) to select boot device.

I have tried and follow https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-pre.html with zero luck.

To make sure the USB key (in general) is selected as boot device iI inserted a Debian boot USB key, which boot the Debian install menu just fine. So iI know that the boot order is working properly.

So this might seem like a very low level question, but what is the correct way of creating a FreeBSD install USB key?

Thanks on advance
Kind regards


----------



## kpa (Jul 30, 2015)

As far as I remember from Linux sd[letter]1 is the first primary partition on the disk. You want to use sd[letter] instead because the memory stick image is designed to be written on the whole disk overwriting everything on it including the partition table.


----------



## Juanitou (Jul 30, 2015)

Cristian said:


> So this might seem like a very low level question, but what is the correct way of creating a FreeBSD install USB key?


Use the memstick images instead of the ISO ones.


----------



## Cristian (Jul 30, 2015)

Thanks for the reply kpa and Juanitou
I also tried FreeBSD-10.1-RELEASE-amd64-memstick.img with dd

Writing to the whole device.
`dd if=FreeBSD-10.1-RELEASE-amd64-memstick.img of=/dev/sd[letter] bs=64k`
from this guide https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-pre.html

After I zeroed out the entire device with
`dd if=/dev/zero of=/dev/sd[letter] bs=4M`

This had the same result, with the USB stick not booting.

But also when I mounted the device and listed its content it was "empty" aka I couldn't see the image file or any other files on the device.


----------



## kpa (Jul 30, 2015)

It's normal that the memory stick shows as empty when you try to mount it, it has a specially crafted partitioning and filesystems that are not recognized by Linux (a Linux system with support for BSD partititioning and UFS filesystems would but that is very rare) or MS Windows.


----------



## wblock@ (Jul 30, 2015)

It is not necessary to erase a memory stick.  In fact, it only puts more wear on them.

When sd[letter] was written above, it meant to use a letter, like sdb.

Linux probably cannot mount or read either the raw BSDLabel partitioning used on the memory stick or the UFS filesystem in it.  Remember, FreeBSD is not Linux, and does not do things the same way.

Please show the exact actual `dd` command you are using.


----------



## Cristian (Jul 30, 2015)

Thanks for the reply kpa, wblock@

I erased the memory stick to make sure their wasn't something messing with the FreeBSD files.

The actual commands used with dd(1) was

Attempt #1
`sudo dd if=/FreeBSD-10.1-RELEASE-amd64-dvd1.iso of=/dev/sdb1 bs=4M`

Attempt #2
https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-pre.html
Procedure 2.1. Using dd(1) to write the image

`sudo dd if=FreeBSD-10.1-RELEASE-amd64-memstick.img of=/dev/sdb bs=64k`

Thanks on advance


----------



## Patrick Bär (Jul 30, 2015)

Have you tried booting something else from that stick, a tiny Linux maybe?


----------



## Cristian (Jul 30, 2015)

Thanks for your reply Patrick Bär
I have not tried to boot anything from the device besides FreeBSD, but its a freshly new device I unpacked, zeroed out, and than made two attempts on FreeBSD. First with the .iso file and than the .img file

First by copying over the .iso as I would any other and than following the FreeBSD guide on www.FreeBSD.org.

When formatting the device as FAT and partitioning it out it works as expected for storing and sharing files that are on the device.

Thanks on advance.


----------



## Patrick Bär (Jul 30, 2015)

Then try to install some live-Linux, rescue disc, whatever. If that boots from the stick, it's a FreeBSD problem. If it doesn't, the problem is somewhere else


----------



## Cristian (Jul 30, 2015)

Thanks for the reply Patrick Bär
I tried booting a Debian USB installer which booted just fine :/ to make sure it wasn't a problem with the boot order.


----------



## Patrick Bär (Jul 30, 2015)

Just to make sure, you used the very same USB-stick, right? If not => Try to boot the Debian installer from that USB-stick.

If it was, try again. If the stick starts booting, but boot hangs, you know the bootloader wasn't properly copied to the stick. A different stick maybe? Or via DVD?


----------



## Cristian (Jul 31, 2015)

So I tried a NEW USB stick again, and this time different outcome but still does not work.

Command executed:
`sudo dd if=FreeBSD-10.1-RELEASE-amd64-memstick.img of=/dev/sdb bs=64k`

dmesg(1) output

```
[13057.327393] usb-storage 1-1:1.0: USB Mass Storage device detected  <<<<<<< mounted the usb device
[13057.327508] scsi host4: usb-storage 1-1:1.0
[13058.533606] scsi 4:0:0:0: Direct-Access  SMI  USB DISK  1100 PQ: 0 ANSI: 4
[13058.533823] sd 4:0:0:0: Attached scsi generic sg1 type 0
[13058.534047] sd 4:0:0:0: [sdb] 7866368 512-byte logical blocks: (4.02 GB/3.75 GiB)
[13058.534526] sd 4:0:0:0: [sdb] Write Protect is off
[13058.534529] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00
[13058.535474] sd 4:0:0:0: [sdb] No Caching mode page found
[13058.535479] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[13058.538399]  sdb: sdb1
[13058.539981] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[13058.709122] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. <<<<<<< unmounted the device with sudo umount /dev/sdb1
[13105.109388]  sdb:
[13311.164705] perf interrupt took too long (2576 > 2500), lowering kernel.perf_event_max_sample_rate to 50000 <<<<<<< dd command running
[13376.610915]  sdb: sdb4
sdb4: <bsd:bad subpartition - ignored
>            <<<<<<< dd command finnished
```
dd(1) output

```
11175+0 records in
11175+0 records out
732364800 bytes (732 MB) copied, 146.175 s, 5.0 MB/s
```
When I try and boot from the USB device I get a black screen, with a underscore in the top left corner.
Here it stays for a solid 2-3 minutes then all fans in the machine goes into overdrive and the screen output looks like matrix.
Scribble running down the screen in a single column on the left side of the screen.

Does FreeBSD require some special hardware or something else since its spassing up with me?


----------



## kpa (Jul 31, 2015)

Sounds more like the BIOS on your system is buggy and can not cope with a slightly unusual partitioning (no real MBR partitioning, only a pseudo partition covering the whole disk for compatibility) on the memory stick. I've seen all kinds of similar problems on all types of machines, for example my firewall system refuses to boot from GPT partitioned USB sticks no matter what I do and there are no BIOS updates for the MB anymore. Look for a BIOS update if there's any available.


----------

