Summary: Separate partition for /var

From: Edward J. Huff (
Date: Thu Jul 01 1993 - 10:08:16 CDT

If anyone knows how to submit suggestions for documentation
changes to Sun, please let me know. This procedure is not
documented in the answerbook as far as I can see, and it
was not clear how to do it or whether it would work.

I successfully moved the /var files into a partition separate
from /.

The following facts are of interest:

(1) Making var a symbolic link in / is not a good idea. Thus,
to move /var out of /, you MUST have a partition. You can't
share a partition with /var and other files. If you try this,
single user mode won't work well until you mount that partition.

(2) It seems that if there is a /var mount point in /etc/vfstab,
then the system mounts it automatically without saying "yes" in
the mount at startup field. If you do say "yes", the systems says
already mounted. If you shutdown to -is mode, /var is mounted.
I didn't see this documented anywhere when I searched the answerbook
for /var.

(3) /usr/tmp is normally a symbolic link to /var/tmp. I had
changed it to /a/var/tmp. The result was than in single user
mode, man failed with "cannot create temporary file". mount /a
permitted use of man in single user mode.

(4) I made a partition, shutdown to single user mode,
mounted it on /tmp_mnt, and tried cp -p -r /var/* /tmp_mnt.
This did not preserve the groups for the directories.
Then I tried restoring /var from my backup tape, and discovered
that I had misinterpreted the meaning of the /dev/rmt/0cn vs.
/dev/rmt/0c parameter: the n means don't rewind AFTER backup,
not BEFORE backup. I left the "n" off the first ufsdump, and
as a result did not have "/" backed up. Page 121 of Routine
System Admin does not say this, although page 129 does...

Anyway, after repeating the backup, I did

cd /tmp_mnt
ufsrestore bsft 96 1 /dev/rmt/0cn /var

and the group names were preserved. However, it created
a /var directory in /tmp_mnt and asked me if I wanted
to set owner etc. of "."

I fixed this with "cd /tmp_mnt/var" and "mv * .."

Is there a better answer?

Then I did rm /var/* and tried shutdown. Shutdown failed,
complaining about no access to some /var files. So I mounted
/var and then shutdown worked. (Earlier I had added a line
to /etc/vfstab for /var).

Restarting the system resulted in normal operation, with
/var in its own partition.

Edward J. Huff   (212)998-8465
Keck Laboratory for Biomolecular Imaging
NYU Chemistry Deptartment, 31 Washington Place, New York NY 10003

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:59 CDT