Soren Harward on 15 Oct 2018 08:00:07 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Disk is Full. How to Move /var?


On Mon, Oct 15, 2018 at 10:40 AM Fred Stluka <fred@bristle.com> wrote:
Historically, I thought "var" was named for "variable" because it
was the one directory where it as most likely for truly huge files
to be put.

That may have been its original purpose, and is still true on servers where the mail/news/print spools, daemon "home" directories like /var/www and /var/lib/mysql, and logs reside. Most package managers — Gentoo included — also track their state somewhere in /var, usually /var/db.  But for a desktop system, where the bulky data is (or should be) under /home, /var shouldn't be more than a few GB, most of which will be logs.

The other things that gets stored under /var are small, variable files describing system state, like the stuff in /var/run and /var/lock .  These are the files that I'm concerned about getting mangled early in the boot process.  Most distros are gradually moving to using /run (which is mounted as a tmpfs) instead of /var/lock or /var/run; Gentoo w/ systemd /var/lock and /var/run are both symlinked to /run.  But for the symlink to behave properly, /var itself has to be mounted.

Anyway, I think that moving /var itself off the root filesystem is not worth the potential hazard of screwed up boot state because even if it is taking a ton of space, my experience is that (1) there are ways easy ways to recover that space like deleting old logs and/or (2) there's only one or two big subdirs of /var (like /var/lib/mysql or /var/spool/mail) that are eating most of the space, and can be moved to HDD while leaving the small stuff like /var/run, /var/lock, and /var/log on the root filesystem so that they're available immediately on boot.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug