Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2000 16:22:13 +0800
From:      Greg Lehey <grog@lemis.com>
To:        Chip Wiegand <chip@wiegand.org>
Cc:        questions@FreeBSD.ORG
Subject:   Re: Link problem - /var to /usr/var - now X won't load
Message-ID:  <20000125162213.A333@mojave.worldwide.lemis.com>
In-Reply-To: <388BDBFC.E517B01C@wiegand.org>; from chip@wiegand.org on Sun, Jan 23, 2000 at 08:58:37PM -0800
References:  <388BDBFC.E517B01C@wiegand.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, 23 January 2000 at 20:58:37 -0800, Chip Wiegand wrote:
> I bought the FreeBSD Powerpak and got it installed without any problems.
> During the partitioning section I set up a /var partition of 100 megs, a
> root partition of 100 megs, and left a couple gigs for /usr, and
> entering df on the command line also shows a /proc partition of 4 1-k
> blocks.
> Here is the output of df -

Please don't wrap output, it makes it very difficult to read.
> /dev/wd1s1a        99183        46987        44262        51%        /
> /dev/wd1s1f        2749566    515006      2014595    20%        /usr
> /dev/wd1s1e        99183        101111        -101       104% /var         <-- (these are apr, I didn't write down
> procfs                            4                4
> 0     100%        /proc                the exact numbers)
>
> Then I started getting a message about running out of room for sendmail
> -
> sendmail: NOQUEUE: low on space (have 0, SMTP-DAEMON need 101 in
> /var/spool/mqueue)
> this message gets repeated alot, to say the least.
> So I enter df at prompt and see the partition /var is at 104%.

Right.  So you should expect this.  But this wouldn't have happened
immediately.

> Then I open the book The Complete FreeBSD, chapter 5 page 87, Where to
> put /var and /tmp section.
> I followed the instructions to link /var to /usr/var because that would
> allow more room for /var. All went well till I tried rm -rf /var when I
> get a message that the device is busy.

Right, you need to umount it.  I see that isn't in the book; I'll fix
that.  From where you were reading:

  # 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

*** add the following line ***
  # mv /var /VAR			  move file system out of the way
  # ln -s /usr/var /var                   now link to the new directory

*** add: ***

  Before rebooting, remove the entry for /var from /etc/fstab.  After
  rebooting, and after you're sure everything is working normally,
  enter:

  # rm -rf /VAR

> So I rebooted and tried that last one again and got the same
> response. Then I rebooted into single user mode (I believe), and got
> the same message again. So I tried ln -s /usr/var /var anyway, and
> it seems to have worked, I didn't get any messages.

Yes, but unfortunately the result isn't the same.  You will now have a
symlink /var/var pointing to /usr/var.  It won't get used, because the
name is wrong.

> The directory /usr/var appears to contain all the directories and
> files that were in the original /var.  I reboot again just for the
> heck of it, and get the following messages (and in the last couple
> reboots above) -
>
> /etc/rc: cannot create /var/run/dmesg.boot: directory nonexistent
> cd: can't cd to /var/run
> /etc/rc: cannot create /var/run/clean_var: directory nonexistent
> Enter full pathname of shell or RETURN for /bin/sh:<I hit enter>

It looks as if you were able to remove a number of the files in /var
:-)

> I get a # sign prompt and enter login
> I then login as a user, not root, and enter startx.

Hmm.  Not what you should be doing.  You're still in single user mode,
and you probably don't have all file systems mounted.

> It appears to start but then quits to the command prompt again with the
> following messages -
>
> <complaints omitted>
>
> Once again, this only started after trying to link /var to /usr/var
> according to the directions in the above mentioned book.
> Now when I do df I show /var at 0%, which is correct since that is
> empty, and I can't get rid of it the way the book says I should be able
> to.
>
> So, did I screw up big time? Hopefully I can just fix this without any
> major problems, like reinstalling from scratch.

Right now, the easiest way is:

 # mv /var /VAR
 # ln -s /usr/var /var

Another problem you might run into in this area is that your /var/tmp
file system might have the wrong permissions.  It should look like:

 # ls -ld /var/tmp
 drwxrwxrwt  5 root  wheel  1536 Jan 25 16:07 /var/tmp

Note that the permissions string at the beginning of the line must end
with a 't'.  If it doesn't look like this, enter the following
command:

 # chmod 1777 /var/tmp

Greg
--
When replying to this message, please copy the original recipients.
For more information, see http://www.lemis.com/questions.html
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers


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?20000125162213.A333>