mdmfs(8) lacks the ability to populate throwaway memory filesystems from an existing directory.
This features permits an interesting setup where /var for instance lives on a device where wear-leveling is something you want to avoid as much as possible and nonetheless you don't want to lose your logs, ports metadata, etc. Here are the steps:
- Copy /var to /var.bak;
- Mount an mfs into /var using -k /var.bak at startup;
- Synchronize /var to /var.bak weekly and on shutdown.
Note that this more or less mimics OpenBSD's mount_mfs(8) -P flag.
PR: 146254
Submitted by: jlh