Fred Stluka on 15 Oct 2018 07:40:53 -0700


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

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


Soren,

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.  Like log files that can grow massive.  Most others
(like /bin, /lib, /opt, /sbin, /usr, ...) are grown only by installs
of software packages.  And /etc contains only config settings.
True?  Or do I have it wrong?

I've always picked /var/log as the FIRST choice to move to a
larger 2nd hard drive.

--Fred
------------------------------------------------------------------------
Fred Stluka -- Bristle Software, Inc. -- http://bristle.com
#DontBeATrump -- Make America Honorable Again!
Register online to Vote: http://bristle.com/Vote
------------------------------------------------------------------------

On 10/15/18 10:32 AM, Soren Harward wrote:
On Sun, Oct 14, 2018 at 5:04 PM Casey Bralla <MailList@nerdworld.org <mailto:MailList@nerdworld.org>> wrote:

    My 200 GByte SSD on my Gentoo system is 99.5% full (sometimes hits
    100%,
    but I've been erasing as much as I can).


Whoa, that's a ton of space being used.  The Gentoo installation on my workstation takes only 20G, but that's with /home on a 1TB HDD array.  So a >200G Gentoo installation seems, well, oddly bloated.

    I thought I could move  the /var from the
    SSD to HDD and open some space, but I'm having some trouble.


I'm curious why you chose /var as the directory to move. It doesn't seem like a good idea to me because there are programs that may run early in the boot sequence that try writing to /var/run or /var/lock, or reading from their "home" directories in /var/lib, before /var itself is mounted.  The logger itself may also try to write to /var/log before /var is mounted, either screwing up the mount, wiping out the early boot log, and/or leaking hard drive space on the root that gets hidden when it's overmounted.  Finally, /var typically doesn't take up very much space, so the benefit of moving it doesn't seem that great.

Is your /var directory taking up >1G? What subdir(s) of /var are huge? If /var/log, then there's a really good first place to start recovering space. If /var/lib, track down the offending daemon; mysql is one of the the usual suspects.  If /var/tmp/portage, then just wipe that thing out, and if you have the RAM, replace the /var/tmp/portage with a tmpfs.  You never need to keep it between boots.

Are there other directories under / that are taking up more space than /var, and might benefit more from moving them off the SDD?  /opt tends to be a prime offender if you have several binary-only packages installed on your system. If you don't clean /usr/portage/distfiles regularly, then it's probably eating up a ton of space, and I would think you'd recover much more space, much more safely, by cleaning up and moving /usr/portage/distfiles to HDD than you would by trying to move /var.

tl;dr: figuring out why /var is so big, or moving something besides /var, is probably a safer and more maintainable solution than trying to move /var off the root filesystem.
Soren Harward


___________________________________________________________________________
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

___________________________________________________________________________
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