Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2002 15:04:39 -0800 (PST)
From:      Philip Hallstrom <philip@adhesivemedia.com>
To:        Steve Warwick <ukla@attbi.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Separating the OS from the data - tough to do?
Message-ID:  <20021031145737.X65479-100000@cypress.adhesivemedia.com>
In-Reply-To: <B9E6EA1A.3B33%ukla@attbi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> -- Problem:
> Separating OS from underlying data. Which parts of the BSD OS are not part
> of the initial, never modified OS? Or, which pieces of the OS change due to
> useage.
>
> -- Goal:
> To have a slightly modified BSD OS structure where the OS can be upgraded,
> yet the variable data remains the untouched (DNS, websites, mail etc), on
> another partition or disk, allowing an OS upgrade that can be as "plug &
> play" as possible.
>
>
> -- THEORY --
>
> At first glance it looks like I can just move and soft link a few
> directories, /etc, /usr/local, /usr/home (websites) and /var. However if one
> upgrades the OS, is it possible to have all the installed apps separate?
>
> For example, I have Apache, MySQL and PHP installed. By moving/linking
> /usr/local to another partition or disk, is it possible that these apps will
> run properly once the OS is upgraded and the soft link re-setablished? Will
> /var still function properly? Will MySQL re-write the DB files somewhere
> else next time it is optimized or repaired?
>
> All thoughts, ideas and input gratefully received. Hopefully this discussion
> will be of use to a few more people that just me :)

What I've done which has worked for me so far is to create /usr/local and
/local as separate partitions.

FreeBSD doesn't use /usr/local by default, so everything that's in there
is stuff I built from ports (vim, netpbm, etc...), but aren't *critical*
in the sense that Apache is critical on my webserver.

I then create:

/local/home
/local/www/apache_1.2.27
/local/www/apache (symlink to above)
/local/www/sites
/local/www/sites/site_one
/local/www/sites/site_two
/local/tmp
/local/db/
local/db/mysql...
...



Then everything I build (apache, php, mysql, etc.) I put into /local.
This does require changing ld_config in /etc/rc.conf to look for libraries
and includes in the right places, but that's no big deal.

And all application specific logging (ie. apache) goes in /local/ not in
/var.

This way I can backup /local and /usr/local (or just /usr/local/etc if I
remember what ports I've installed) and I'm done.

The other nice thing about the above setup is you can install a new
version of apache, configure it to run on say port 81, and test it out
using your existing sites.  Once you're happy, tweak the config, repoint
the symlink and you're done.

And it's nice because if you decide you don't want apache anymore just rm
-rf /local/www/apache* and it's *all* gone.  No guessing where things are.

just my 2 cents.

-philip



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?20021031145737.X65479-100000>