FreeBSD is an open-source and free Unix-like operating system descended from the Berkeley Software Distribution (BSD). This quick tutorial explains how to download and prepare the USB stick/pen boot drive to install FreeBSD 12.2 or 13.x to install FreeBSD using the target computer’s USB port.

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements FreeBSD or Linux with dd command
Est. reading time 4 mintues

Steps to write FreeBSD image to USB disk for installation

Head over to the FreeBSD download page and make sure you download the latest stable bootable version. I will download *-memstick.img*, which contains all of the files needed to install FreeBSD, its source, and the Ports Collection using a USB stick and boot the system.
Download and write FreeBSD image to USB flash drive

Step 1: Downloading FreeBSD image on your Linux, macOS or *BSD system

I am going to use the wget command but you can download a file with curl too:
wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.2/FreeBSD-12.2-RELEASE-amd64-memstick.img.xz
Session:

--2020-12-30 00:46:08--  https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.2/FreeBSD-12.2-RELEASE-amd64-memstick.img.xz
Resolving download.freebsd.org (download.freebsd.org)... 203.80.16.151, 2404:a8:3ff::15:0
Connecting to download.freebsd.org (download.freebsd.org)|203.80.16.151|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 687961180 (656M) [application/octet-stream]
Saving to: 'FreeBSD-12.2-RELEASE-amd64-memstick.img.xz'
 
FreeBSD-12.2-RELEAS 100%[==================>] 656.09M  8.26MB/s    in 81s     
 
2020-12-30 00:47:29 (8.09 MB/s) - 'FreeBSD-12.2-RELEASE-amd64-memstick.img.xz' saved [687961180/687961180]

Grab checksum file to verify boot disk image:
wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.2/CHECKSUM.SHA512-FreeBSD-12.2-RELEASE-amd64
Verify integrity of a file:
sha512sum --ignore-missing -c CHECKSUM.SHA512-FreeBSD-12.2-RELEASE-amd64
We should see something as follows:

FreeBSD-12.2-RELEASE-amd64-memstick.img.xz: OK

For FreeBSD 13.x:

Download FreeBSD 13 by visiting official page:
$ wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-amd64-memstick.img.xz
$ wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.0/CHECKSUM.SHA512-FreeBSD-13.0-RELEASE-amd64
$ sha512sum --ignore-missing -c CHECKSUM.SHA512-FreeBSD-13.0-RELEASE-amd64
FreeBSD-13.0-RELEASE-amd64-memstick.img.xz: OK

Step 2: Finding out your USB flash drive name

Insert the USB pen into your computer’s USB port and run the dmesg to see USB device name:
dmesg
The output indicates that I am using /dev/sda on Linux:

[ 2314.466297] usb 1-2: new high-speed USB device number 9 using xhci_hcd
[ 2314.629772] usb 1-2: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 0.01
[ 2314.629779] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2314.629782] usb 1-2: Product: DataTraveler 3.0
[ 2314.629786] usb 1-2: Manufacturer: Kingston
[ 2314.629788] usb 1-2: SerialNumber: C81F660E262EF1713606D2C2
[ 2314.655320] usb-storage 1-2:1.0: USB Mass Storage device detected
[ 2314.655377] scsi host0: usb-storage 1-2:1.0
[ 2314.655474] usbcore: registered new interface driver usb-storage
[ 2314.656962] usbcore: registered new interface driver uas
[ 2315.663917] scsi 0:0:0:0: Direct-Access     Kingston DataTraveler 3.0      PQ: 0 ANSI: 6
[ 2315.664256] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 2315.665411] sd 0:0:0:0: [sda] 30218842 512-byte logical blocks: (15.5 GB/14.4 GiB)
[ 2315.665723] sd 0:0:0:0: [sda] Write Protect is off
[ 2315.665725] sd 0:0:0:0: [sda] Mode Sense: 4f 00 00 00
[ 2315.665939] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 2315.682431]  sda: sda1 sda2
[ 2315.684945] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 2316.154272] ISO 9660 Extensions: Microsoft Joliet Level 3
[ 2316.155734] ISO 9660 Extensions: Microsoft Joliet Level 3
[ 2316.159081] ISO 9660 Extensions: RRIP_1991A

Your device name will vary. For instance, here is what reported on my FreeBSD system (/dev/da0):

ugen0.3: <SanDisk Ultra> at usbus0
umass0 on uhub2
umass0: <SanDisk Ultra, class 0/0, rev 2.10/1.00, addr 2> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0xc100
umass0:8:0: Attached to scbus8
da0 at umass-sim0 bus 0 scbus8 target 0 lun 0
da0: <SanDisk Ultra 1.00> Removable Direct Access SPC-4 SCSI device
da0: Serial Number 4C531003510422116045
da0: 40.000MB/s transfers
da0: 59232MB (121307136 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>

Make sure you extract .xz file as follows:
xz -dv FreeBSD-12.2-RELEASE-amd64-memstick.img.xz
For FreeBSD 13.x image:
xz -dv FreeBSD-13.0-RELEASE-amd64-memstick.img.xz

FreeBSD-13.0-RELEASE-amd64-memstick.img.xz (1/1)
  100 %     661.7 MiB / 1,040.4 MiB = 0.636   173 MiB/s       0:05

Step 3: Writing FreeBSD image to USB flash drive

Warning: Be careful with the correct USB pen device/drive name. The wrong device name will destroy the existing data on the specified USB drive.

Say, If your USB stick is /dev/sda under Linux, you would run:
# Find mounted partition for /dev/sda #
$ mount | grep '/dev/sda'
# Unmount all mounted partition for /dev/sda #
$ sudo umount /dev/sda2
# Write it #
$ sudo dd if=FreeBSD-12.2-RELEASE-amd64-memstick.img \
of=/dev/sda bs=1M conv=sync status=progress

Writing FreeBSD installer to the USB pen drive on Linux using the dd

For FreeBSD 13.x:
sudo dd if=FreeBSD-13.0-RELEASE-amd64-memstick.img \
of=/dev/sda bs=1M conv=sync status=progress

If your USB flash stick name is /dev/da0 under FreeBSD, you would run:
# Find mounted partition for /dev/da0 #
$ mount | grep '/dev/da0'
# Unmount all mounted partition for /dev/da0 #
$ sudo umount /dev/da0
# Write it #
$ sudo dd if=FreeBSD-12.2-RELEASE-amd64-memstick.img \
of=/dev/da0 bs=1M conv=sync

Creating a bootable USB in FreeBSD using the dd command

Step 4: Installing FreeBSD 12.2

Insert the newly created USB pen drive with FreeBSD installer in the target computer. Please turn it on. Make sure you boot from USB media. For example:

Once booted, you will see the FreeBSD boot menu followed by FreeBSD installer:

Now follow the on-screen instructions to install the FreeBSD operating system.

Conclusion

We explained how to prepare a FreeBSD installer to boot from a USB pen drive or stick in this quick tutorial. See FreeBSD documentation for more info.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Ravi Kiran Jun 12, 2021 @ 17:48

    I was wondering how to create FreeBSD boot usb flash drive and this page solved it perfectly.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum