Edit file /boot/loader.conf file with this command
sudo sysrc -f /boot/loader.conf geom_label_load="YES"
This loads the geom_label kernel module at boot, which is necessary for /dev/label/* devices.
Check status and See what your partition table contents are set for. I give examples that you can research more.
ls -l /dev/label
gpart status
gpart show -lp
gpart show -rp
geom disk list
camcontrol devlist
Please in next post provide your output from these 3 commands and the contents of the /etc/fstab file again. Was the swap partition created?
Check Swap Status: If the swap partition isn’t working, verify it was created correctly (e.g., formatted as swap with newfs -S or gpart). Create a New Partition for Swap: If there’s unallocated space, create a new freebsd-swap partition. For example, to add a 2GB swap partition on /dev/ada0 with label swap0:
sudo gpart add -t freebsd-swap -s 2G -l swap0 ada0
- -t freebsd-swap: Specifies the partition type as swap.
- -s 2G: Sets the size (e.g., 2GB; adjust as needed, e.g., 4G for 4GB).
- -l swap0: Labels the partition as swap0, creating /dev/label/swap0.
- ada0: The target disk.
Example output:
ada0p2 added
gpart show -lp ada0
Copied from Grok AI https://x.com/i/grok/share/wyyHe9veX8jTs8cQZOMhSLbrk
If it doesn’t exist, you may need to re-create the label using glabel:
sudo glabel label swap0 /dev/<device>
Replace <device> with the actual device (e.g., ada0p3).
RubeNerd gptid web page
did you create the partition table entry with labels added in the 'gpart add'? Did you use the BSD 'glabel ' command?
These two glabel () commands gave me the knowledge to display the UUID values for the Disks and the disks partitions
https://www.ithands-on.com/2020/10/freebsd-101-disk-labels.html
glabel status
glabel list
ls -l /dev/label
sudo swapinfo
sudo swapon /dev/label/swap0
sudo swapinfo
You should see /dev/label/swap0 listed with its size and usage. If it doesn’t exist, you may need to re-create the label using glabel:
sudo glabel label swap0 /dev/<device>
Replace <device> with the actual device (e.g., ada0p3).
cat /etc/fstab view contents of the file system table. Which device identifier or label identifier are you using?
No /boot/loader.conf Changes Needed in Most Cases: If /dev/label/swap0 is a standard swap partition with a label, the /etc/fstab entry is sufficient, and no changes to /boot/loader.conf are required unless specific geom modules are needed.
https://ghostbsd-arm64.blogspot.com/2023/12/errors-nginx-dhcp-boot-ntpd-ntpdate.html
Edit file /mnt/rootfs/boot/loader.conf add this single line And this for GPT disks, running UFS file system. Set to "0" gptid.enable for use with ZFS file system:
kern.geom.label.gptid.enable="1"
Note, that whatever identifier system you first use, the other identifier systems DISAPPEAR!! So do not look to use them, like gptid,diskid,ufs for a ZFS file system. The key is what identifier system you use first! Stay with that identifier system in your /etc/fstab file system identifier and your /boot/loader.conf file.
Information gathered from the GROK AI answer / details at GROK Conversation This GROK AI answer is quite detailed and good explanations.