# Persistent /var

**URL:** <https://forum.openwrt.org/t/persistent-var/119427>\
**Category:** Installing and Using OpenWrt\
**Created:** [February 6, 2022, 12:55am UTC](https://forum.openwrt.org/t/persistent-var/119427 "2022-02-06T00:55:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![slh](https://forum.openwrt.org/user_avatar/forum.openwrt.org/slh/32/113591_2.png) [@slh](https://forum.openwrt.org/u/slh)\
**Post date:** [February 6, 2022, 1:01am UTC](https://forum.openwrt.org/t/persistent-var/119427/2 "2022-02-06T01:01:29Z")

</div>

That is a build-time decision:

> <https://github.com/openwrt/openwrt/commit/57807f50ded6cf0996284a850084183af13d5894>
>
> In OpenWrt, /var is symlinked to /tmp by default. This is done to reduce
> the amo…unt of writes to the flash chip, which often have not the
> greatest durability. As a result, things like DHCP or UPnP lease files,
> are not persistent across reboots.
> 
> Since OpenWrt can run on devices with more durable storage, it makes
> sense to have an option for a persistent /var. Add an option to make
> /var persistent. When enabled, /var will no longer be symlinked to /tmp,
> but /var/run will be symlink to /tmp/run, as it should contains only
> files that should not be kept during reboot. The option is off by
> default, to maintain the current behaviour.
> 
> Signed-off-by: Stijn Tintel \<stijn@linux-ipv6.be\>

---

_[View the full topic](https://forum.openwrt.org/t/persistent-var/119427)._
