Fred Stluka on 14 Oct 2018 18:02:16 -0700


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

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


Casey,

The problem is the ln -s command you used.

You specified /var as the 2nd arg.  The name of the symlink.  But
/var already exists as a folder.  So, it created a symlink in that
folder.  But since you specified a folder and not a name for
symlink, it uses the default name for the symlink, which is the
last part of your first arg, the name of the target of the symlink.
In this case, the last part of "/HDDdisk/var" is "var", so you now
have a link called "var" in the existing /var folder.  So it looks like:

/var/var --> /HDDdisk/var

Easy to do.  I make this mistake all the time.

Check to see if I'm right.  True?  That's why you got no error
message, but also thought you got no symlink.

To see it happen more clearly, do:

% ls -Fla /var/var
% sudo rm -iv /var/var
% sudo ln -iv -s /HDDdisk/var   /var
% sudo rm -iv /var/var

To fix it, you'll have to rename /var to something else, then
issue the ln command, then test it, and finally delete the
renamed /var folder.

But the suggestions that others are making are good too.  You
may cause problems by making /var temporarily unavailable, or
allowing it to get out of date by being updated between when
you copy it and when you symlink it.

I've never symlinked all of /var, but I've often symlinked pieces
of it, like /var/log.  In that case, I still have to worry about other
processes using /var/log while I'm mucking with it.  But at least
not all of /var.

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

On 10/14/18 5:04 PM, Casey Bralla wrote:
Okay, this should be a simple problem, but I'm stumped.

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).  I also have a 1 TByte HDD in
the system for regular files.  I thought I could move  the /var from the
SSD to HDD and open some space, but I'm having some trouble.

If I created a separate partition on the HDD, I could add the partition
in /etc/fstab without any problem, but since there already is a file
system on HDD that fills the whole disk, I wanted to simply move the
/var directory there.  However, when I tried to symlink, it seems to
have completely ignored my command.

Here's what I did:
1.  Created "/HDDdisk/var" directory on the HDD.
2.  Copied everything from "/var" to "/HDDdisk/var".
3.  "sudo ln -s /HDDdisk/var   /var"


The result:  Nothing.  /var is still on the SSD and did not move.

What am I doing wrong
What else can I do to relocate files to the HDD from the SSD (I've
already moved /home).

TIA!


___________________________________________________________________________
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