Remote Debian install?

Bill Mullen moon at lunarhub.com
Fri Nov 26 20:58:00 EST 2004


On Fri, 2004-11-26 at 10:44, Ken D'Ambrosio wrote:
> Between Randy's and Bill's replies, I think I've figured it out.  Please 
> let me know if anyone sees any holes in it:
> 
> 1) Log into my RH box.
1a) Run swapoff. ;)
> 2) Take the swap partition out of /etc/fstab.
> 3) Fdisk the swap partition to be type 83, and format it with a "real" FS.
> 4) Do a minimal install of Debian on a machine local to me.
> 5) Tar the files over (via SSH or somesuch) to the RH box's former swap 
> partition.
> 6) Configure /etc/fstab to reflect its new reality.
> 7) MAKE SURE that networking (modules and config) are correct.
> 8) MAKE SURE that ssh is set to start automatically.
> 9) Make the bootloader on the RH side point to the Debian side.
> 10) Type "reboot", and hope...
> 
> Assuming it comes up, I've got a minimal Debian install.

It occurs to me that if RH is now using lilo as its bootloader, you are
lucky, as this gives you a useful safety valve in the event that the
Debian install *doesn't* boot properly for whatever reason.

Rather than setting up the Debian install as the default option in RH's
lilo.conf (as I had originally suggested), a more prudent approach would
be to leave the default set to RH, run "/sbin/lilo -v" to write out the
new MBR, and then run "/sbin/lilo -R debian" (assuming that "debian" is
the label you gave to the new "image=" entry).

When you reboot, the "debian" option will be selected, even though the
default remains intact. If it fails, all it takes is asking the host to
reboot the machine manually, and it will come back up running RH again.

One hopes that they don't charge an arm and a leg for a button push. :)

The only other consideration that comes to mind as a possible obstacle
to a successful Debian boot is the initrd file that will be created on
the local Debian machine, and then used on the target system; if the
target box has SCSI drives, or anything else that would require one or
more kernel modules to be present in the initrd, you may need to remake
the Debian initrd to include them. An examination of the current RH
install (lsmod, etc.) should tell you if this will be necessary or not,
and if it is, which module(s) you'll need.

You should be able to work "within" the Debian install on the remote
system, at least to some extent, while RH is running by doing:

mount -t proc proc /mnt/debian/proc
chroot /mnt/debian /bin/bash
source /etc/profile

Hopefully, this will let you run mkinitrd or whatever else is needed to
tweak Debian into a working state. At the very least, apt-get and such
should work properly from here. If you need to remake the initrd file,
though, it'd probably be easier to just do that on the local install and
then copy the thus-created file over to the remote one. If RH uses lilo,
you'll have to run /sbin/lilo again after replacing the Deb initrd file.

-- 
Bill Mullen
RLU# 270075




More information about the gnhlug-discuss mailing list