FreeBSD 14-0 file swapping broken.

From: Artem Hevorhian <artemhevorhian_at_gmail.com>
Date: Sun, 09 Jun 2024 15:30:21 UTC
Hello!

I would like to report that, likely, in FreeBSD version 14.0-stable, file
swapping is broken. To confirm, here is what I tried to do and what I
achieved. In order to reproduce the problem, please follow the following
steps.

I was following this tutorial
https://www.cyberciti.biz/faq/create-a-freebsd-swap-file/

I created a large swap file (8192 MiB) and saved it to /root/swap.8G.bin.

After that, I ran

sudo chmod 0600 /root/swap.8G.bin

After that, I updated fstab by adding the following line to the end.

md42 none swap sw,file=/root/swap.8G.bin 0 0

On running

sudo swapon -aq

I got the swap file working initially, and I saw it after running swapinfo.
But on reboot, it disappeared.

Thank you for your help.

Artyom.