Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Oct 1996 10:53:58 +0200 (MET DST)
From:      grog@lemis.de (Greg Lehey)
To:        lray@aurora.liunet.edu
Cc:        QUESTIONS@FreeBSD.org
Subject:   Re: adding new hard drive
Message-ID:  <199610060853.KAA26111@allegro.lemis.de>
In-Reply-To: <96100516243870@aurora.liunet.edu> from "lray@aurora.liunet.edu" at Oct 5, 96 04:24:38 pm

next in thread | previous in thread | raw e-mail | index | archive | help
lray@aurora.liunet.edu writes:
>
> Hi all.
> I've added a disk drive to my freebsd system I'm using as a news server.
> I need to add the 2-gig of new space to the /var file system.  Can anyone
> give me an Idea of how to extend te /var file system?

I'm not sure if I understand this question completely.  A file system
is a file system: you can't spread it across two file systems.  Let's
consider what you might want to do:

1.  Move /var to your new disk.  That's straightforward enough.
    Modify your /etc/fstab to contain something like

    /dev/sd1e                       /var            ufs     rw 2 2

    This assumes that your new disk is sd1, and that you've put the
    space on partition e.  If you currently have /var mounted as a
    separate file system, modify the existing entry.

    Before you mount the disk as /var, you'll need to move the current
    /var stuff.  First, mount the disk on /mnt, a general-purpose
    temporary mount point that you should have on your system:

    # mount /dev/sd1e /mnt

    Then copy the data across:

    # cp -pR /var /mnt

    Then *rename* /var, create a new /var, and mount it:

    # mv /var /VAR
    # mkdir /var
    # mount /var

    The reason for renaming /var to /VAR is that you won't be able to
    delete the old files after you've mounted a new file system on top
    of it.  On the other hand, it's a good idea to keep the old
    contents around for a while until you're sure that you don't need
    them any more.  This way, when you're sure that everything is OK,
    you just need to enter

    # rm -rf /VAR

2.  You want to split /var between two file systems.  For example, you
    may want to put /var/spool on the new disk, and leave all the
    other files where they were.  In this case, you repeat (1) above
    substituting /var/spool for /var.  If your current /var is a
    symlink, use the real directory name for the mount point.

I hope this answers your question.  If not, please let me know.

Greg




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