Separating the OS from the data - tough to do?

2002-10-31 Thread Steve Warwick
Hi, 

-- 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 --

See reference below for BSD file system details.

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 :)





--- For reference --

From:
Filesystem Hierarchy Standard ‹ Version 2.2 final
Filesystem Hierarchy Standard Group

the standard unix FS, moveable? directories marked with a 

# bin Essential command binaries
# boot Static files of the boot loader
# dev Device files
 etc Host-specific system configuration
# lib Essential shared libraries and kernel modules
# mnt Mount point for mounting a filesystem temporarily
# opt Add-on application software packages
# sbin Essential system binaries
# tmp Temporary files
# usr Secondary hierarchy
 usr/local
* var Variable data

Note: 
The /usr/local hierarchy is for use by the system administrator when
installing software locally. It needs to be safe from being overwritten when
the system software is updated. It may be used for programs and data that
are shareable amongst a group of hosts, but not found in /usr.

Need a copy? Email me for the PDF



Steve


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Separating the OS from the data - tough to do?

2002-10-31 Thread Paul Everlund
Steve Warwick wrote:
 Hi,
Hi Steve!

 -- 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 --

 See reference below for BSD file system details.

 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 :)

[...snip...]

Not a direct answer to your question, as I assume you want to reformat
the disk for every new installation, but...

The easiest way to upgrade the OS is by using cvsup. Then you'll get
the changes of the source files, and after you've cvsup'ed you just
compile the sources and install them.

It's as easy as this...

cvsup sources
make buildworld
make buildkernel KERNCONF=KERNEL
mergemaster -p
make installkernel
reboot
make installworld
mergemaster
reboot(?)

(If I remember the steps correct)

No need to reformat the disk, no need to recreate symbolic links and
all is updated. It's all in the handbook! :-)

Best regards,
Paul



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Separating the OS from the data - tough to do?

2002-10-31 Thread Philip Hallstrom
 -- 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 [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message