md none swap sw,file=/swap 0 0
to /etc/fstab mounts the swap file on boot, but it will be unencrypted. When I make it md.eli (or md0.eli or /dev/md.eli or /dev/md0.eli) the swap file is not mounted. This approach does work for swap partitions (e.g., /dev/ada1.eli).
How-To-Repeat: Create a swap file:
dd if=/dev/zero of=/swap bs=1024k count=64
chmod 0600 /swap
and add it to /etc/fstab
md.eli none swap sw,file=/swap 0 0
and reboot. The (encrypted) swap file will not be available.
For me the basic md vnode swap doesn't work. It just creates the md but does not load the swap on boot. If I mdconfig -d -u 99 and then service swap start (swapon -aq), it works.
At boot there is "swapon: /dev/md0: Read-only file system"
My problem is Bug #195326
I would use this feature if available, that is configuring an encrypted swap file in /etc/fstab the same way as for a swap partition. FreeBSD 10.2.
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017
- Set Status to "Open"