Sample Header Ad - 728x90

/var/cache on temporary filesystem

5 votes
2 answers
2373 views
Due to flash degradation concerns, I would like to lower the amount of unnecessary disk writes on a headless light-duty 24/7 system, as much as sensible. In case it matters this is a Debian-flavored system, but I think the issue might be of relevance for a wider audience. In order to achieve this, I am already using **tmpfs** for /tmp and /var/log in addition to the defaults. At this point, by monitoring idle IO activity with various tools like *fatrace*, I get that after long periods one of the most prominent directories in number of write accesses is /var/cache, especially /var/cache/man related to *man-db*. Note that I don't have automatic package updates in this system, so I don't get any writes for /var/cache/apt, but for others that might be relevant too. The question is, could it cause any trouble if **tmpfs** would be used for /var/cache? On startup I would populate it with data from disk, and possibly *rsync* it back from time to time. Of course the elevated RAM usage might be an issue on some systems, but it would be interesting to hear your opinions whether it would be problematic for some of the common systems using the cache, to have data absent in the early boot process, or generally be in a slightly outdated state (after a crash for example)?
Asked by rockfort (85 rep)
Aug 24, 2020, 03:15 PM
Last activity: Mar 18, 2025, 08:29 PM