The handbook shows a way to create a memory disk:
Which works just fine, but I don't see any way to determine if a memory disk has had newfs run on it (and therefore is mountable). I usually use gpart to create memory disks, but occasionally run into one that I'm not sure if I can mount or not.
Code:
# mdconfig -a -t swap -s 5m -u 1
# newfs -U md1
/dev/md1: 5.0MB (10240 sectors) block size 16384, fragment size 2048
using 4 cylinder groups of 1.27MB, 81 blks, 192 inodes.
with soft updates
super-block backups (for fsck -b #) at:
160, 2752, 5344, 7936
# mount /dev/md1 /mnt
# df /mnt
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/md1 4718 4 4338 0% /mnt
Which works just fine, but I don't see any way to determine if a memory disk has had newfs run on it (and therefore is mountable). I usually use gpart to create memory disks, but occasionally run into one that I'm not sure if I can mount or not.