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

Re: Build Deb install then move it

On Saturday 05 February 2011 23:01:56 Harry Putnam wrote:

> Once all that is working wouldn't I be able to move the whole thing
> onto the existing linux desktop by doing a network install of debian,
> formatting whatever space then use dd or maybe something more modern
> to plop the fleshed out OS from the virutal machine onto the bare
> install `/' disk.
> Or any other or better way to get this done.

  I don't know about "better", but I can offer "proven" -- 
if you already have a partition on your system, it's pretty 
simple to just copy over a working installation.  I do this
to "clone" workstations from time to time.

  There are a small number of minor gotchas.
  Firstly, when copying from the working system to the 
destination drive, I use "rsync" with the "--numeric-ids" option,
which ensures consistency between the destination's /etc/passwd
and the actual UIDs.  This is important for "service" accounts
like ntp, which needs to own the /var/lib/ntp.

  Secondly, there are a few files that are sensitive to the 
switchover -- fix them up after you've done the copy.
/etc/hostname and /etc/mailname may be wrong if there's a 
new hostname.  /etc/network/interfaces might need a new static IP.
The private and public host keys in /etc/ssh will be new, if
you want the old ones, copy them over.  If the host is Kerberized,
you'll want to either copy or re-generate /etc/krb5.keytab.
Finally, remove all the entries from
/etc/udev/rules.d/70-persistent-net.rules, otherwise udev will
notice the changed MAC address and generate a new interface
name for it.
  In your case, the apache configs may need adjustments 
also, particularly ports.conf, which might need a new
IP or hostname.

  When you copy a running system, there are a few messy bits,
/var/run will have wrong data in it, and /var/log will have 
old-system logs, but in practice, I've found these don't matter --
modern init scripts automatically clean up /var/run, and the log
stuff just carries on with the new info.

  The one thing this doesn't take care of is the boot-loader,
you'll want to make sure your new disk has the one you want, and
that the kernel and otehr config files are findable by it.

  Every few months, I also wonder if there's a slicker way to 
accomplish this, but I've never actually gotten around to
figuring it out.  I'll be following the thread to see if anyone
else knows a good way.

				-- A.
Andrew Reid / reidac@bellatlantic.net

Reply to: