FreeBSD 13.0-RELEASE installation records


I just came into contact with FreeBSD. The main purpose is to experience ZFS:). I will sort out the information here. If it is helpful to you, I will be very honored!
The installation was successful on VMware today and will be installed on the actual machine tonight!

Install basic system

Mirror download

U disk burning software

start installation

Just read the FreeBSD installation manual , official information

Things to note

#手册2.5.3. Selecting Components to Install
#12.26日 9:00更新
#只选择src就可以,ports选了也不会安装,只是些空目录
src           #后面编译内核是需要用到

Partition

Choosing AUTOUFS or AUTOZFS for the entire hard disk
is mainly for the sake of tossing. Here is a record of the ZFS manual partition.
Select SHELL when partitioning.
On 2021.12.22, I bought a 1T SSD and decided to reinstall the system... When choosing AUTOZFS partition, what you need to pay attention to is that it must be correct. Select the hard disk and set the SWAP size (default is 2G).
Keep the manual partition command here for now~

  • boot partition
#确定要安装FreeBSD的硬盘
camcontrol devlist
#我要安装FreeBSD的硬盘插在主板第3个SATA接口上,所以显示的是ada3,个人根据实际情况修改
#清空硬盘
gpart destroy -F ada3 
gpart create -s gpt ada3
#UEFI引导
# 本例中为FreeBSD12.X以后版本的方法,12.x以前的版本不适用
#手册上efi分区是800k,实际上在建立FAT32分区时会提示clusters too few clusters for FAT32
#FreeBSD论坛上有人说这是个失误,实际上最小应为33M,本例中设置为512M
gpart add -a 4k -s 512M -t efi ada3
newfs_msdos -F 32 -c 1 /dev/ada3p1
mount -t msdosfs -o longnames /dev/ada3p1 /mnt
mkdir -p /mnt/EFI/BOOT
cp /boot/loader.efi /mnt/EFI/BOOT/BOOTX64.efi
  • Swap partition (large memory can not be divided, personal preference is to divide it into one SWAP)
gpart add -a 4k -s 16G -t freebsd-swap -l swap0 ada3
  • zfs partition
gpart add -a 4k -t freebsd-zfs -l myzpool ada3
  • Create ZPOOL
#挂载tmpfs
mount -t tmpfs tmpfs /mnt
zpool create -o altroot=/mnt zroot ada3p3
  • Set ZFS global parameters
#zpool get all 
#zfs get all
zpool set ashift=12 zroot
zfs set compress=zstd zroot        #个人实验性质使用zstd压缩
zfs set checksum=fletcher4 zroot
zfs set atime=off zroot
  • Create root directory and mount
zfs create -o mountpoint=none zroot/ROOT
zfs create -o mountpoint=/ -o canmount=noauto zroot/ROOT/default
mount -t zfs zroot

Guess you like

Origin blog.csdn.net/kimux/article/details/121868780