Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Dec 1998 11:29:58 +1030
From:      Greg Lehey <grog@lemis.com>
To:        "Dan O'Connor" <dan@jgl.reno.nv.us>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Moving /var to /usr/var
Message-ID:  <19981225112958.P12346@freebie.lemis.com>
In-Reply-To: <000701be2f8d$32edebe0$553de4cf@danco.home>; from Dan O'Connor on Thu, Dec 24, 1998 at 02:31:48PM -0800
References:  <000701be2f8d$32edebe0$553de4cf@danco.home>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, 24 December 1998 at 14:31:48 -0800, Dan O'Connor wrote:
> I'm a newbie to both Unix and freeBSD, trying to re-install FreeBSD on a new
> hard drive, and who lent his copy of "Complete FreeBSD" to a friend, hence
> this question:
> 
> At the back of the Installing FreeBSD chapter in "Complete FreeBSD" is the
> command for using tar to move the contents of /var to /usr/var before
> removing /var and symlinking to /usr/var.
> 
> I would be most grateful if anyone with a copy of "Complete FreeBSD" handy
> could send me this info.

Well, this is from the chapter on installation, but it should be the same:

  
  Now  the installation is completed, but you may still have some housekeeping to
  do.  Did you include a /var file system on  your  disk?   In  the  example,  we
  didn't.  If  we  don't specify anything else, /var will end up on the root file
  system, which isn't enormous.  If we leave things like  that,  there's  a  very
  good  chance  that the root file system will fill up.  We solve this problem by
  creating a directory  /usr/var  and  a  symbolic  link  /var  which  points  to
  /usr/var:
  
  # mkdir /usr/var                        create a new directory
  # cd /var                               move to the old /var directory
  # tar cf - . | (cd /usr/var; tar xf - ) copy its contents
  # cd /                                  get out of the directory
  # rm -rf /var                           and remove it
  # ln -s /usr/var /var                   now link to the new directory
  
  After performing these steps, you might see messages like:
  
  Jan  9 13:15:00 myname syslogd: /var/run/utmp: no such file or directory
  
  syslogd is the System Log daemon. [1] Don't worry  about  these  messages.   If
  you're  intending  to  restart  the  system  soon, just wait until then and the
  messages will go away.  Otherwise you can restart syslogd:
  
  # ps waux | grep syslogd                look for the syslog daemon
  root 152 11.0  1.6   176  476   v0 D+     1:16M   0:00.15 grep syslogd
  root  58  0.0  1.1   184  332   ?? Ds     1:13    0:00:57 syslogd
  # kill -9 58                            stop the PID of syslogd
  # syslogd                               and start it again
  
  The PID of the syslogd is the second field on the line  which  ends  with  just
  syslogd.   The first line is the process which is looking for the text syslogd.
  See Chapter 10, Making friends with FreeBSD, page 190, for more information  on
  stopping processes.
  
  Programs  should  not write large files to /tmp; if a program needs to create a
  
  ____________________
  [1]  See  Chapter  10, Making friends with FreeBSD, page 187, for a description
       of daemons.
                                                                          Page 83
  
  
  
  
  
  
  Rebooting the new system
  
  
  large temporary file, it should create  it  in  /var/tmp.   Unfortunately,  the
  location  of  the  temporary  files  is not usually in your hands.  It would be
  tempting to also replace /tmp with a symbolic link to /var/tmp, but the  system
  handles  /tmp and /var/tmp slightly differently: after a reboot, it removes all
  files from /tmp, but it leaves the files  in  /var/tmp.   You  can  solve  this
  problem by creating a directory /usr/tmp and creating a link to it.
  
  Perform the following steps in single-user mode (see Chapter 10, Making friends
  with FreeBSD, page 191, for a description of single user mode and  how  to  get
  into it).
  
  # mkdir /usr/tmp                        create a new directory
  # rm -rf /tmp                           and remove the old /tmp
  # ln -s /usr/tmp /tmp                   now link to the new directory

Greg
-- 
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981225112958.P12346>