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

Re: Cross-install howto



OK, here's the result (I still have to do the markup).

--------


   This section explains how to install Debian GNU/Linux from an existing
   Unix or Linux system. This has been requested by users switching to 
   the "best" Linux system from Redhat, Mandrake, or SUSE.

   Once you've got the new Debian system configured to your
   preference, you can migrate your existing user data (if any) to it,
   and keep on rolling. This is therefore a "zero downtime"
   GNU/Linux install. It's also a clever way for dealing with hardware
   that otherwise doesn't play friendly with various boot or
   installation media.

Getting Started

   With your current *nix partitioning tools, repartition the hard
   drive as needed, creating at least one filesystem plus swap. You
   need at least 150MB of space available for a console only install,
   or at least 300MB if you plan to install X.

   To create filesystems on your partitions (this example creates and 
   ext3 partition, for ext2 omit -j):
    $ mke2fs -j /dev/partition # e.g.:  /dev/hda3

   Initialize and activate swap:
    $ mkswap /dev/partition   # e.g.:  /dev/hda2
    $ sync; sync; sync
    $ swapon /dev/partition   # e.g.:  /dev/hda2

   Mount one partition as /mnt/debinst (the installation point, to be
   the root (/) filesystem on your new system). The mount point name is
   strictly arbitrary, it is referenced later below.

    $ mkdir /mnt/debinst
    $ mount /dev/partition /mnt/debinst   # e.g.:  /dev/hda3

Installing debootstrap

   The tool which the Debian installer uses, and which is recognized
   as the official way to install a Debian base system, is
   debootstrap. It uses wget, but otherwise depends only on
   glibc. Install wget if it isn't already on your current system,
   then download and install debootstrap. 

   If you have an rpm-based system, you can use alien to convert the 
   .deb into .rpm, or download an rpmized version at 

    http://people.debian.org/~blade/install/debootstrap

   Or, you can use the following procedure to install it
   manually. Make a work folder for extracting the deb into:

    $ mkdir work
    $ cd work

   The debootstrap binary is located in the Debian archive (be sure to
   select the proper file for your architecture). Download the
   debootstrap .deb to the work folder, and extract the binary files
   from it. For example,

    $ ar -xf debootstrap_0.X.X_arch.deb

   You will need to have root privileges to do this:

    $ cd /
    $ zcat < /full-path-to-work/work/data.tar.gz | tar xv

Running debootstrap (Network-connected)

   Debootstrap can download the needed files directly from the archive
   when you run it. Substitute any Debian archive mirror for
   http.us.debian.org in the command example below, preferably a
   mirror close to you network-wise. Mirrors are listed at

   http://www.debian.org/misc/README-mirrors

   If you have a woody version Debian CD mounted at /cdrom, you could 
   substitute a file URL instead of the http URL: 

   file:/cdrom/debian/

   Substitute one of the following for ARCH in the debootstrap command:
   
   alpha, arm, hppa, i386, ia64, m68k, mips, mipsel, powerpc, s390, sparc
   
    $ /usr/sbin/debootstrap --arch ARCH woody \
        /mnt/debinst http://http.us.debian.org/debian

Running debootstrap (Using basedebs.tar)

   Debootstrap can use the basedebs.tar file, if you'd like to
   download it ahead of time. The basedebs.tar file is generated only
   every once in a while, so you'll get the latest version of the base
   system by pointing debootstrap directly to a Debian archive as
   shown above. Basedebs.tar provides an option for non-network
   connected computers.

   The basedebs.tar file is found in the base-images-current directory
   of the Debian archive for your architecture, e.g.:

   http://http.us.debian.org/debian/dists/woody/main/disks-i386/base-images-current/basedebs.tar
   
    $ /usr/sbin/debootstrap --arch ARCH --unpack-tarball \
        /path-to-downloaded/basedebs.tar woody /mnt/debinst 

Configuring The Base System

   You've now got a real Debian system, though rather lean, on disk.
   Chroot into it:

    $ chroot . /bin/bash

   You can mount the proc filesystem multiple times and to arbitrary
   locations, though /proc is customary. It will make certain other tasks
   easier, so do this now:

    $ mount -t proc proc /proc

   OK. You've got a few things to configure that would ordinarily be
   handled by the Debian installer:
     * keyboard
     * language
     * time zone
     * partition mounting
     * networking
     * apt sources

   You need to create /etc/fstab. While you don't need to mount
   additional filesystems, this is a good time to do so. You'll
   probably want to activate swap and the proc filesystem.

   A sample /etc/fstab -- modify to suit:

# /etc/fstab: static file system information.
#
# <file system>   <mount point> <type>    <options>        <dump> <pass>
/dev/XXX    /               ext2    defaults                    0 0
/dev/XXX    /boot           ext2    ro,nosuid,nodev             0 2

/dev/XXX    none            swap    sw                          0 0
proc        /proc           proc    defaults                    0 0

/dev/fd0    /mnt/floppy     auto    noauto,rw,sync,user,exec    0 0
/dev/cdrom  /mnt/cdrom      iso9660 noauto,ro,user,exec         0 0

/dev/XXX    /tmp            ext2    rw,nosuid,nodev             0 2
/dev/XXX    /var            ext2    rw,nosuid,nodev             0 2
/dev/XXX    /usr            ext2    rw,nodev                    0 2
/dev/XXX    /home           ext2    rw,nosuid,nodev             0 2


   Mount any additional filesystems. For mount points referenced 
   in your /etc/fstab:
    $ mount /path     # e.g.:  mount /usr
   Or use "mount -a" to mount all filesystems already specified 
   in /etc/fstab.

   Configure the keyboard.
    $ dpkg-reconfigure console-data

   To configure your locale settings, ie. for using another language, run
    $ dpkg-reconfigure locales
   NOTE: Before using locales with charsets other than ASCII/latin1, please
   consult the appropriate localisation HOWTO.

   To configure networking, edit the following files.

    $ editor /etc/network/interfaces 

   Here are some simple examples from /usr/share/doc/ifupdown/examples:

######################################################################
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
#
# A "#" character in the very first column makes the rest of the line
# be ignored. Blank lines are ignored. Lines may be indented freely.
# A "\" character at the very end of the line indicates the next line
# should be treated as a continuation of the current one.
#
# The "pre-up", "up", "down" and "post-down" options are valid for all 
# interfaces, and may be specified multiple times. All other options
# may only be specified once.
#
# See the interfaces(5) manpage for information on what options are 
# available.
######################################################################

# We always want the loopback interface.
#
auto lo
iface lo inet loopback

# To use dhcp:
#
# auto eth0
# iface eth0 inet dhcp

# An example static IP setup: (broadcast and gateway are optional)
#
# auto eth0
# iface eth0 inet static
#     address 192.168.0.42
#     network 192.168.0.0
#     netmask 255.255.255.0
#     broadcast 192.168.0.255
#     gateway 192.168.0.1


    $ editor /etc/resolv.conf -- your nameserver(s) and search directives go
       here.

# search hqdom.local\000
# nameserver 10.1.1.36
# nameserver 192.168.9.100

    $ editor /etc/hostname -- your system's host name -- 2 - 63 characters.

   Note: If you have multiple network cards and you rely on the
   network, you should enter the names of driver modules into
   the /etc/modules file in the correct order (so each card
   is associated with the interface name you expect).

   Finally, set your timezone, add a normal user, and choose
   your apt sources by running 

    $ /sbin/base-config

   You probably want a Linux kernel and a bootloader. Identify
   available pre-packaged kernels with

    $ apt-cache search kernel-image

   Then install your choice using its package name.

    $ apt-get install kernel-image-2.X.X-arch-etc

   To make your Debian GNU/Linux system bootable, set up your boot
   loader to load the installed kernel and your new root partition.
   <![ %i386 [
   Check man lilo.conf for instructions on setting up the bootloader. 
   If you are keeping the system you used to install Debian, just 
   add an entry for the Debian install to your existing lilo.conf. 
   You could also copy it to the new system and edit it there. After 
   you are done editing, call lilo (remember it will use lilo.conf
   relative to the system you call it from). 

   Here is a basic /etc/lilo.conf as an example:

   boot=/dev/hda6
   root=/dev/hda6
   install=/boot/boot-menu.b
   delay=20
   lba32
   image=/vmlinuz
   label=Debian
   ]]>

   <![ %powerpc [
   Check man yaboot.conf for instructions on setting up the bootloader. 
   If you are keeping the system you used to install Debian, just 
   add an entry for the Debian install to your existing yaboot.conf. 
   You could also copy it to the new system and edit it there. After 
   you are done editing, call ybin (remember it will use yaboot.conf
   relative to the system you call it from). 

   Here is a basic /etc/yaboot.conf as an example:

   boot=/dev/hda2
   device=hd:
   partition=6
   root=/dev/hda6
   magicboot=/usr/lib/yaboot/ofboot
   timeout=50
   image=/vmlinux
   label=Debian
   ]]>

   <![ %alpha %arm %hppa %ia64 %mips %mipsel %s390 %sparc [
   
   Examples anyone?
   
   ]]>

---------

-- 
*------v--------- Installing Debian GNU/Linux 3.0 --------v------*
|      <http://www.debian.org/releases/woody/installmanual>      |
|   debian-imac (potato): <http://debian-imac.sourceforge.net>   |
|            Chris Tillman        tillman@voicetrak.com          |
|                   May the Source be with you                   |
*----------------------------------------------------------------*


-- 
To UNSUBSCRIBE, email to debian-boot-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: