[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Two idential root partitions - how?



Mark,
>I'm installing Debian.  

Good choice!

>I'm partitioning as follows:
>
>100 Meg root partition
>3 Gig /usr partition
>100 Meg root partition - identical copy
>
1st question; is this all one big disk?  For what follows, I'm assuming
it is.  I like to do something like this....

100M /
64M  swap
100M /var (and I prefer putting this on a 2nd disk if possible)
whatever's left for /usr  if its all on a single disk.  If there is a
2nd disk, I also like putting /etc and /home there, preferring to put
any additional root or additional Linux root on the 1st.

Just my preference...and the idea I have anyway about the separate /var
is that it happens to be quite active and alot of write operations on
that with a running system.  I like the idea of keeping write operations
off the root as much as possible, just in case a drive goes nuts..I know
it doesn't happen as much as it used to maybe, but I still do it.

I also think you're more likely to lose a disk, than you would blow up
your root partition.  Thats been my experience.  Another reason for the
2nd disk.  Also why getting /var off the root makes good sense to me.

Also, by putting /etc and /home on the 2nd, if you should lose the 1st
disk, then you won't be worrying about all the config changes you might
have made, and so on.

Now, to duplicate root...I know I do it the hard way, and partly because
I'm not very clever with scripting, but I use cpio to duplicate 
filesystems.
Have for years, but like I said, I do it the hard way...one at a time!

For example, I do this:
Mount the target where you want to duplicate a filesystem on at /mnt 
lets say.  Here, lets duplicate /usr

# cd /usr
# find . -depth | cpio -pdmv /mnt

This is old, and like I said, not very clever, but it does make an exact
duplicate of /usr at /mnt, maintaining links, file access and update 
times, etc.  When its done you can just umount /mnt and mount it over
top of /usr and your system wouldn't know the difference!  I know, I've
done it hundreds of times...it just flat works!  Even doing it the hard
way, you'll have a duplicate system in a few minutes on that spare
parition.

Where the lack of sophistication comes in using this is, don't do it
from /.  I've done it without thinking about what I was doing, and if
you think about it you'll see why its pretty dumb to do!  If you do,
when it gets down to /mnt on that root (where you've already recreated
everything down to that point of course), it'll do it all over again!
You get all that stuff twice on the new filesystem!  Not what you 
wanted to do of course.

Now, like I said, I'm not real clever with script programming, but I'm
sure you'll get some other ideas too, that are a bit smarter than this.

This is just a bit of history for me, and it works so well I've never
bothered looking into doing it any other way.  And it is pretty fast
too!  And simple.  Since I fool around with several Linux distributions
I'm always reconfiguring my disks, and I use this simple command to do
it.  Thats another reason for keeping /home on a separate partition,
'cause that way, its /home for several; they all mount it, and all the
stuff from any of them that are on /home are then availabe on any and
all of them.

I always like having two bootable Linux's on any box!  Saved my buns
more than once.  Actually, I have one box that has three; SuSE, Debian
and RH.  The RH is only bootable from floppy, and its a minimal sort
of system, all on less than a 300M partition.  Its sort of like the
emergency system.  I've found its easier to fix a Linux box if you
can boot Linux on it :)

Paul


Reply to: