Create a USB Memory Stick for installation of FreeBSD 13.1-RELEASE-amd64

Create a USB Memory Stick for installation of FreeBSD 13.1-RELEASE-amd64

Last Updated on 2022-10-01 by Sture

This page was last updated [last-modified]

A USB Memory Stick can be prepared to install FreeBSD 13.1-RELEASE.amd64 on a computer with Internet access running FreeBSD, MacOS, Linux, or Microsoft Windows.

FreeBSD

Requirements:

Required hardware: USB Memory Stick, minimum size 2 GB

Required software: sudo, wget

sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.

GNU wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.

Download the FreeBSD image file

Start a terminal session to or on the FreeBSD Computer.

Download the FreeBSD-13.1-RELEASE-amd64-memstick.img image, 736 MByte, with:

[user@freebsd ~]$ wget wget https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-memstick.img --no-check-certificate -P ~/ [enter]

Download the CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 image, 1.8 kByte, with:

[user@freebsd ~]$ wget https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.1/CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 --no-check-certificate -P ~/ [enter]

Calculate the checksum for the file with:

[user@freebsd ~]$ shasum -a 512 Downloads/FreeBSD-13.1-RELEASE-amd64-memstick.img [enter]
d4c58df629c7db6bf2ee2d43ae7f7b9e1c8b98fca0b89dd1afa1bed21891ecc2  /root/FreeBSD-13.1-RELEASE-amd64-memstick.img
root@server:~ #

…and compare the result with the checksum in file CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 with:

[user@freebsd ~]$ cat Downloads/CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 | grep
dbe066cb726b375eebca397aff12d18d6e48ad6c84b776253aabc2bbdff8fb9742e17fb68356581b0b20709002fdf9c3c77eccfd9c0c745e8f93a830264148a5 [enter]
SHA512 (FreeBSD-13.1-RELEASE-amd64-mini-memstick.img.xz) = dbe066cb726b375eebca397aff12d18d6e48ad6c84b776253aabc2bbdff8fb9742e17fb68356581b0b20709002fdf9c3c77eccfd9c0c745e8f93a830264148a5
user@server:~ #

Copy the FreeBSD image file to the USB Memory Stick

Insert the USB Memory Stick to a USB Port on the FreeBSD Computer.

N.B.: All Data on the USB Memory Stick will be lost!

Since USB devices are seen as a SCSI devices, camcontrol can be used to list device information for the inserted USB Memory Stick with this command:

[user@freebsd ~]$ sudo camcontrol devlist [enter]
Password: <-- passwd [enter] 
<ST1000DM010-2EP102 CC43>          at scbus2 target 0 lun 0 (pass0,ada0)
<AHCI SGPIO Enclosure 1.00 0001>   at scbus6 target 0 lun 0 (pass1,ses0)
<SanDisk Cruzer 7.01>              at scbus7 target 0 lun 0 (da0,pass2)
[user@freebsd ~]$

…or show the list with:

[user@freebsd ~]$ geom disk list [enter]
Geom name: cd0
Providers:
1. Name: cd0
   Mediasize: 0 (0B)
   Sectorsize: 2048
   Mode: r0w0e0
   descr: TSSTcorp DVD+-RW TS-L633A
   ident: (null)
   rotationrate: unknown
   fwsectors: 0
   fwheads: 0

Geom name: ada0
Providers:
1. Name: ada0
   Mediasize: 750156374016 (699G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e3
   descr: WDC WD7500BPKT-75PK4T0
   lunid: 50014ee2059f311c
   ident: WD-WXD1EC0PZ269
   rotationrate: 7200
   fwsectors: 63
   fwheads: 16

Geom name: da0
Providers:
1. Name: da0
   Mediasize: 8036285952 (7.5G)
   Sectorsize: 512
   Mode: r0w0e0
   descr: SanDisk Cruzer
   ident: 2444630C9FC0D053
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

[user@freebsd ~]$

In this example, SanDisk Cruzer 7.01 registered as device da0 is the target USB Memory Stick.

Optional: Display information about device da0 with, example:

[user@freebsd ~]$ diskinfo -v da0 [enter]
da0
	512         	# sectorsize
	8036285952  	# mediasize in bytes (7.5G)
	15695871    	# mediasize in sectors
	0           	# stripesize
	0           	# stripeoffset
	977         	# Cylinders according to firmware.
	255         	# Heads according to firmware.
	63          	# Sectors according to firmware.
	2444630C9FC0D053	# Disk ident.
	Not_Zoned   	# Zone Mode

[user@freebsd ~]$

Optional: Show the current partition information of the USB Memory Stick using this command:

[user@freebsd ~]$ gpart show da0 [enter]
=>      63  15695808  da0  MBR  (7.5G)
        63      1985       - free -  (993K)
      2048  15693823    1  !12  (7.5G)

[user@freebsd ~]$

N.B.: Your USB Memory Stick may have a different layout than in this example!

WARNING: The next step will delete all information on the USB Memory Stick!

Destroy the partitioning scheme on the USB Memory Stick with:

[user@freebsd ~]$ sudo gpart destroy -F da0 [enter]
Password: <-- passwd [enter]
da0 destroyed
[user@freebsd ~]$

The image file FreeBSD-13.1-RELEASE-amd64-memstick.img is copied to the USB Memory Stick with the dd utility with this command:

[user@freebsd ~]# sudo dd if=FreeBSD-13.1-RELEASE-amd64-memstick.img of=/dev/da0 bs=1m [enter]
Password: <-- passwd [enter]

When the copy process has been completed, a summary of the process will be displayed as in this example:

738+1 records in
738+1 records out
774215168 bytes transferred in 88.733136 secs (8725209 bytes/sec)
[user@freebsd ~]$

Delete FreeBSD-13.1-RELEASE-amd64-memstick.img file with:

[user@freebsd ~]# rm FreeBSD-13.1-RELEASE-amd64-memstick.img [enter]
rm CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 [enter]
[user@freebsd ~]#

Disconnect the USB Memory Stick.

MacOS

Requirements:

Required hardware: USB Memory Stick, minimum size 2 GB

Required software: None

Download files

Click on https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-memstick.img to download the image file FreeBSD-13.1-RELEASE-amd64-memstick.img.
Click on https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.1/CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 to download the checksum file CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64.

Verify checksum

Launch the Terminal application.
Calculate the checksum for the file with:

user@iMac ~ % shasum -a 512 Downloads/FreeBSD-13.1-RELEASE-amd64-memstick.img [enter]
96bf96628a566cb33d736315dfb56e3076ab0d757ad6c94fa2235866007f7726dc42ac2b81abd7810ae40a945220088605dbf387ebed7d688a9b80dec5253247  Downloads/FreeBSD-13.1-RELEASE-amd64-memstick.img
user@iMac ~ %

Compare the result with the checksum in file CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 with:

user@iMac ~ % grep 96bf96628a566cb33d736315dfb56e3076ab0d757ad6c94fa2235866007f7726dc42ac2b81abd7810ae40a945220088605dbf387ebed7d688a9b80dec5253247 Downloads/CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 [enter]
SHA512 (FreeBSD-13.1-RELEASE-amd64-memstick.img) = 96bf96628a566cb33d736315dfb56e3076ab0d757ad6c94fa2235866007f7726dc42ac2b81abd7810ae40a945220088605dbf387ebed7d688a9b80dec5253247
user@iMac ~ %

The calculated checksum for the downloaded image file should match the posted checksum in the CHECKSUM.SHA512-FreeBSD-13.1-RELEASE-amd64 file.

Copy the FreeBSD image file to the USB Memory Stick

Insert the target USB Memory Stick to a USB Port on the Macintosh Computer.

Run the diskutil list command to find out the device name of the USB disk as in this example:

user@iMac ~ % diskutil list [enter]
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            999.3 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *8.0 GB     disk1
   1:                        EFI EFI                     819.2 KB   disk1s1
   2: 83BD6B9D-7F41-11DC-BE0B-001560B84F0F               64.0 KB    disk1s2
   3:                FreeBSD UFS                         732.1 MB   disk1s3
   4:               FreeBSD Swap                         1.0 MB     disk1s4

user@iMac ~%

In this example, /dev/disk1 is the target USB Memory Stick.

Unmount the USB Memory Stick with:

user@iMac ~% diskutil unmountDisk /dev/disk1 [enter]
Unmount of all volumes on disk1 was successful
user@iMac ~%

Use dd to raw write the image file to the /dev/disk1.

WARNING: This will delete all information on the USB Memory Stick!

N.B.: Update /dev/rdisk1 in the next commando to the /dev/rdisk-number displayde on your Mac!

user@iMac ~% sudo dd if=Downloads/FreeBSD-13.1-RELEASE-amd64-memstick.img of=/dev/rdisk1 bs=4m [enter]
Password: <-- password [enter]

When the copy process has been completed, a summary of the process will be displayed as in this example:

279+1 records in
279+1 records out
1172165120 bytes transferred in 30.176911 secs (38843112 bytes/sec)
user@iMac ~%

Delete the FreeBSD-13.1-RELEASE-amd64-memstick.img file in Your Download folder.

Disconnect the USB Memory Stick.

Linux

Requirements:

Required hardware: USB Memory Stick, minimum size 2 GB.

Required software: None

(To be completed and verified)

Microsoft Windows

Requirements:

Required hardware: USB Memory Stick, minimum size 2 GB

Required software: Rufus (Selected to be used in this example)

Rufus is a utility that helps format and creates bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.

Download the latest version of Rufus from: https://rufus.akeo.ie

Save the Rufus utility executable file in a folder or on the desktop of your computer.

N.B. No installation is necessary!

Download the FreeBSD image file

Click on https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-memstick.img to download image file FreeBSD-13.1-RELEASE-amd64-memstick.img.

Copy the FreeBSD image file to the USB Memory Stick

Insert the USB Memory Stick to a USB Port on the Windows Computer.

Locate and double-click the Rufus Utility executable file to start the Rufus utility.

Verify that the inserted USB Memory Stick has been detected and selected in the Rufus dialog window.

Click on the CD drive icon and select the FreeBSD-13.1-RELEASE-amd64-memstick.img image file.

WARNING: The next step will delete all information on the USB Memory Stick!

Click the button Start and wait for the process to be completed.

Delete the FreeBSD-13.1-RELEASE-amd64-memstick.img file in Your Download folder.

Disconnect the USB Memory Stick.

Leave a Reply