Solved Mount memory disk on boot



Reaction score: 12
Messages: 26

I've searched google and this forum but still no sucess. I've created a file-backed filesystem (memory disk). what I want is to automatically mount the md(4) device at boot. What would be the correct entries in the rc.conf and fstab. Thank you for your inputs.
Last edited by a moderator:


New Member

Messages: 2

Indeed there is a nice example but how do you handle this?

# md /tmp mfs rw,-s32m 2 0
md: Command not found.

Tried on FreeBSD 9, 11, 12.

Maybe there is an example of what I can add to fstab manually?


New Member

Messages: 2

I have read this also, but device md is already present in generic kernel. If I create a ram disk with mdmfs, I don't see md with kldstat, so it is built in for sure. And another proof:

# kldload geom_md
kldload: can't load geom_md: module already loaded or in kernel

The missing part is the command.


Aspiring Daemon

Reaction score: 212
Messages: 678

md is the driver name, not the command line tool.
See mdmfs(8) and also mdconfig(8).

Oh, I understand your question...
You have to set something like mdconfig_md0=".." (arguments of mdconfig) in rc.conf.
Then, write something like "/dev/md0 /mnt ... " (normal fstab syntax) in fstab.