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

Re: (very) remote install



On Thu, 14 Oct 1999, paul wrote:

> Korea).  Is it possible for me to replace the current RH installation with
> Debian from my present location?  Where are docs pertaining to this?
> The owner of the machine (call him john) wants to avoid the reboot, and
> does not know (or trust) anyone at the remote location.  I BELIEVE I could

You can't do it without rebooting.  You need to reboot to load the new
Debian kernel, the Debian C libraries, etc.

That said, you can certainly do it remotely.  What you need to do is this.
First, hope he's laid out his partitions in a reasonable manner, with a
small root partition, or that he has gobs and gobs of unallocated disk
space.  Get everything you need assembled on that root partition -
basically that means tar (which should already be there) and ftp.  I don't
think ftp has any other dependencies other than the standard libraries.

If he has only got one partition, and no other filesystems:

You may be hosed.  If you're lucky you can fit a (very) minimal Debian
installation into whatever he's using for swap.  You might end up having
to use one of the microlinux distributions intended for embedded systems
if his swap is really tight.

If he doesn't have any extra disk space, but does have reasonable
partitions:

You'll also need to set it up so it will accept telnet connections.  That
means you'll have to set up the startup scripts to start in.telnetd in
single user mode and regular multiuser mode - probably on a nonstandard
port so it doesn't conflict with inetd and the regular telnet service
while you're testing it. in.telnetd, of course, will also have to be on
the / partition.

Now reboot, and make sure your new in.telnetd works, and that it is set so
that, in case your connection dies, your local power fails, you
accidentally log out or something, that the machine isn't left alone.
You'll probably need some sort of script to loop and keep it alive because
I think it always dies when its connection ends.

Now set lilo on the remote system to start up in single user mode.
Double check that your telnetd script is run from single user mode.  Now
cross your fingers, and reboot.  You should now be able to telnet into
single user mode, which will have an unused /usr partition, and so on.
You can now use the /usr partition to host your Debian root partition.

If he has extra disk space, or lots of swap that you can steal:

Skip all that garbage about hacking redhat to allow you to get at /usr to
recycle it. Just use some of this extra space to host your Debian root.

> do this by installing and configuring a (minimal) base system complete
> with his root password here, and then gzipping it, telnet to the remote
> host as root, chroot  to a ramdisk, reformat /dev/hda, install the gzipped

Unfortunately, chroot does not excuse you from the obligations of the
"real" root filesystem.  You really can't reformat an active partition and
expect it to work.  Most likely your kernel will panic.

Other than that, the plan is fairly sound.  Make a minimal Debian system,
put it in some free space *on its own partition*, set lilo to boot that
new kernel, and reboot.  You don't really need to chroot anywhere during
the process.

Whether to gzip is an interesting case.  Fun with named pipes will
possibly allow you to untar/zip on the fly.  You might, however, be better
off using something like ncftp which can make proper copies of complex
directory structures, sucking up the extra download time in exchange for
simplicity.  Of course, if you have lots of space, you can have your cake
and eat it too - load the gzipped tarfile containing Debian somewhere on
the system, then unzip it into the rest of the space.

> and ready base system (configured for remote root access and RARP), start 

Why do you need RARP?

> a script that will reboot the machine after I have logged off, then

... or just reboot it yourself?

> 	John does not think this will work he should know, he's had 20+
> years working with Unix and Ive only two years on Linux. But he has not
> suggested any other method.

Well, you'd be hard pressed to make this work with any other Unix flavor,
save perhaps FreeBSD.

That said, you'll be well pressed to make it work with Linux.  There is
certainly a possibility that something will go wrong while the system is
in an undefined state, or you will screw something up and when you try to
reboot it, it dies somewhere along the line, and the whole thing will die.
It could certainly happen, though it doesn't have to.

> else on this list done something similar? Is there a HOWTO for this?
> Should there be?

Gads!  Should this ever have to happen?

If you record what happens to you and what you do, I'm sure that it will
find its way into the collective consciousness somehow.

Now.  Are you sure you don't just want to keep using Red Hat? :}


Reply to: