Mount a tmpfs folder on startup (volatile) with a created subfolder
One way to tackle this would be to create a new systemd service (or modify an exiting one) to handle creating this directory in your
/var/volatile tempfs using the
After=local-fs.target unit directive.
[Unit] Description=Tempfs initialize After=local-fs.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=mkdir -p /var/volatile/subfolder [Install] WantedBy=multiuser.target
Add this to
/etc/systemd/system/tmpfsinit and then perform the usual
systemctl daemon-reload && systemctl enable tempfsinit.
Alternatively, if you already have a custom systemd service, you could also add the
After unit directive and the command to create the subdir you need into a