Other Only /var in memory file system and persistent way at boot time

Hello,

Is there any way to put /var in memory file system and it be populate from local /conf/base/var for example without create any additional script for that?
This server needs /var/db be copied from disk to memory file system at boot time and will boot from SD storage.

Thanks,
Paulo.
 
After reading /etc/rc.initdiskless I found this approach:

Code:
mkdir -p /conf/base/var
mtree -deiU -f /etc/mtree/BSD.var.dist -p /conf/base/var
echo 2097152 > /conf/base/var/md_size
touch /etc/diskless
cp -pRP /var /conf/base
umount -f /var/log
umount -f /var/tmp
zfs destroy zroot/var/log
zfs destroy zroot/var/tmp

My doubt is if there is another problem creating: touch /etc/diskless
 
Back
Top