You are not logged in.

#1 2009-02-16 15:46:36

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

2 computers, 1 root partition

Hi,

I was thinking about rsyncing the root partition of 2 computers running Arch to the same directory.

Somehow I don't expect to run into many problems. The only one that comes to mind would be config files, like fstab, rc.conf, xorg.conf and menu.lst. Maybe I could make a script that moves e.g. xorg.conf to say, xorg.conf_hostname before the sync and then back again?

Does anyone else have ideas / hints for problems I might run into?

Edit: Changed the title to avoid confusion.

Last edited by tkdfighter (2009-02-16 17:39:23)

Offline

#2 2009-02-16 16:13:43

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: 2 computers, 1 root partition

Probably have hardware probs..............


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2009-02-16 16:30:03

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: 2 computers, 1 root partition

i wouldn't sync the fstab or menu.lst as they probley use the new UUID for disk partitions which would be different.
I can't see it being a massive problem as long as your autoloading the modules for hardware.

you can also tell rysnc to ignore files like the the xorg.conf etc

Last edited by genisis300 (2009-02-16 16:31:05)


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#4 2009-02-16 17:38:21

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: 2 computers, 1 root partition

Thanks for the feedback so far!

Like I mentioned, I'd like to have a complete backup of the systems, which means I don't want to leave anything out. Another possibility that comes to mind is making a second sync for the config files.

@lilsirecho: Why would I have hardware problems? Could you elaborate? I think that, like genisis300 said, if modules are autoloaded partly, others are listed in rc.conf, which is system specific, I should be fine.

This is my list of files to exclude (so far):

/etc/fstab
/etc/rc.conf
/etc/X11/xorg.conf
/etc/crypttab
/etc/mkinitcpio.conf
/boot/grub/menu.lst

Last edited by tkdfighter (2009-02-16 19:10:28)

Offline

#5 2009-02-16 18:00:10

NME
Member
Registered: 2004-10-13
Posts: 25

Re: 2 computers, 1 root partition

I think you're going to run into a lot more problems then you may think. rsyncing your homedir and making sure the same packages are installed seems like a much better idea.
You should be able to have pacman running 'in sync' somehow. You could extract the installed package list (pacman -Q) and feed it into the other pacman so it installs those packages every time you rsync. Would require some scripting on your end though.

If the two computers have the exact same hardware it might work. Except for the uuids. But also the ssh keys. And every other hash and random number in a configfile.

I'm interested in hearing how this pans out.

Offline

#6 2009-02-16 18:24:30

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: 2 computers, 1 root partition

NME wrote:

If the two computers have the exact same hardware it might work.

lol I'm actually even planning to having my laptop run on the standard i686 kernel and my desktop running on a recompiled AMD64 kernel. Putting ~4.5 GB of RAM to waste isn't an option. I saw instructions on the wiki for doing this using AUR. As a former Gentoo user I don't fear compiling my own kernel (although I do enjoy the conveniences of precompiled packages).

NME wrote:

I'm interested in hearing how this pans out.

Right now I'm still brainstorming and piecing my plan together. Maybe I'll have time to build my machine and try this out next weekend.

BTW, I already backup my /home using Unison.

Offline

#7 2009-02-16 21:53:17

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: 2 computers, 1 root partition

Can we take a step back and ask what is the bigger problem you're trying to solve? (ie, why do you want to do this?)

Perhaps there is a better way to go about achieving your goal.

Offline

#8 2009-02-17 07:52:18

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: 2 computers, 1 root partition

You're right, I should have stated my goals in my first post.

My goals are:

a) minimize the time to maintain the systems. I'm speaking of new programs, updates, scripts in /usr/local and also extra software like Matlab and Maple. I think it would be nice to have two near identical systems.

b) Reduce the space needed to make full backups. On my "server" I use FreeBSD and ZFS to make nightly snapshots. It would reduce the space needed by approximatly 10 GB. As I mentioned, I already use Unison in combination with ZFS to make backups of /home.

c) Try something new. There are servers out there running e.g. openShared-root, why not try to implement something similar with rsync? I know that the goal of these shared-root administrators are somewhat different, but why not? The worst case is that it doesn't work and I will have to revert to 2 "normal" Arch installations.

If it gets too complicated to maintain, I will drop the project, though. I'm not interested in investing days, as I don't have the time at the moment. The semester at my university just begann.

Offline

#9 2009-02-17 22:03:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: 2 computers, 1 root partition

You should be able to NFS mount /usr, /lib etc from one machine to the other, then you only have 1 system to look after, and the other just runs from the first. Of course, this relies on the 'master' to be on when you want to use the 'slave'

Offline

#10 2009-02-17 22:14:50

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: 2 computers, 1 root partition

Great, so now if you mess up one set of configs you'll have two borked systems.

Offline

#11 2009-02-17 22:30:02

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: 2 computers, 1 root partition

iBertus wrote:

Great, so now if you mess up one set of configs you'll have two borked systems.

True -- therein lies the skill and responsibility of a system admin wink
If you don't share/mount /etc then the configs will still be independan, which resolves the xorg etc issue.

This is how things used to be done when disk space was a premium. Instead of duplicating identical binaries across multiple systems/disks, they'd all be put on one disk/partition and then that shared (read only usually) across to the other machines that needed those binaries.

Offline

#12 2009-02-18 14:18:46

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: 2 computers, 1 root partition

My line of thought is that I might run into more trouble when keeping /etc seperated then when I sync it. When packages are updated, the configuration file is usually changed, especially when doing major upgrades. Also, a lot of customization is done in /etc, so it would make sense to keep it in sync.

I could of course also let each computer have its own /etc. But how are files in /etc updated in Arch? Is there something like etc-update or dispatch-conf in Gentoo? Are they updated at all? There seems to be no information on this topic on the wiki. Am I missing something?

Concerning stability, I guess it's always a tradeoff. Either I run into problems because both computers use the same (broken) config, or I run into problems because I fixed / changed something on one but not on the other. Using Arch is a big plus though, because at least I know when something is changed unlike e.g. Ubuntu.

Any suggestions?

Offline

#13 2009-04-08 01:45:32

DaveCode
Member
Registered: 2008-08-15
Posts: 103

Re: 2 computers, 1 root partition

It's a reasonable idea.  Try an external USB2 disk for experiments.  Set BIOSes to boot USB first, before SATA/IDE.  Move it from one machine to the other.

The issues are not likely bootup related, but the usual 32/64 problems at the application/library level.  Boot is a GRUB menu choice of kernel, 32 or 64.

Offline

#14 2009-04-08 21:28:56

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: 2 computers, 1 root partition

Well, I still think it would work, but I came to the conclusion tha it might be a nightmare to maintain. So what I'm doing now is try to keep the packages in sync manually and syncing /home with unison. Works quite well, but I have a long list of configuration files to exclude and I've really got to watch out what I'm syncing so I don't delete anything important.

Thanks for the feedback, though!

Offline

#15 2009-04-08 21:33:27

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: 2 computers, 1 root partition

tkdfighter wrote:

how are files in /etc updated in Arch?

man pacman for the equation.  it's a three way comparison on a per file basis given the default config, the package config, and the user's config.  depending on the comparison, a decision is made that will result in an overwrite or a *.pacnew file being dropped in /etc.

Offline

#16 2009-04-09 14:47:47

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: 2 computers, 1 root partition

Hmm, I wanted to find out what it's comparing a little closer, so I went through some of pacman's code in git. The most obvious place would be in upgrade.c, but I can't find it. Maybe someone could explain it a bit closer or point me to where it's happening?

This is the first time I actually went through a real project's code. Pacman looks very clean and modular. Just wondering: why was C chosen over C++? OO code has many benefits, IMO, but I'm a novice programmer learning Java.

Offline

Board footer

Powered by FluxBB