Md based tmpfs with zfs root system.

Frank Leonhardt (m) frank2 at
Thu Oct 19 08:36:19 UTC 2017

On 18 October 2017 21:11:36 BST, RW via freebsd-questions <freebsd-questions at> wrote:
>On Wed, 18 Oct 2017 12:45:59 -0400
>Christopher Sean Hilton wrote:
>> Good day,
>> I've using a new system with root on zfs. I've traditionally used a
>> /dev/md* based tmpfs for /tmp. A little initial reading on the
>> shows an argument about this practice but I didn't find any threads
>> that provide a resolution. 
>md devices and tmpfs are two different things. tmpfs is a bit like an
>md device, but it has its own built-in file-system, so it only uses
>memory for current files, whereas an md device stores all the sectors
>that have ever been written to, even if they hold deleted files.
>I don't follow ZFS much, but unless there is a specific reason not to
>use tmpfs with zfs it's preferred over md devices.
>If the issue is the use of swap with zfs, neither tmpfs nor
>swap-backed md devices actually require swap.  

My thought on reading the original question was to wonder what the ZFS ARC does with MDs. Does it result in double caching in RAM, or does something clever happen? I suspect the former.

Using tempfs will probably take a bigger hit in low RAM situations (as it pages), but if you are short of RAM you'd be optimising the wrong thing with a RAM disk anyway.

Does anyone remember if there is a POSIX requirement for /tmp to be nonvolatile?

Sent from my Android device with K-9 Mail. Please excuse my brevity.

More information about the freebsd-questions mailing list