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

Re: Cross-install howto



Here's a draft, let's see what y'all think. 
Is it true that a Unix user could also run debootstrap?

-----

   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 
    # (creates ext3, 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. The
   debootstrap binary is located in the Debian archive (be sure to
   select the proper file for your architecture). Make a work folder,
   download debootstrap, and extract the binary files from the
   deb. For example,

    $ mkdir work
    $ cd work
    $ wget http://http.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_0.1.17_i386.deb 
    $ ar -xf debootstrap_0.1.17_i386.deb
    $ cd /
    # You will need to have root privileges to do this
    $ 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.
    # If this mount point is referenced in your /etc/fstab:
    $ mount /path     # e.g.:  mount /usr

    # Keyboard.
    $ dpkg-reconfigure console-data

    # I'm not sure about language (FIXME: locales?)

   To configure networking, edit the following files. nano is the user-
   friendly simple editor installed by debootstrap.

    $ nano /etc/network/interfaces 

       This configures your interfaces. In general, you need to know
       your IP, network, netmask, network, broadcast, and
       gateway. 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


    $ nano /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

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

   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
   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.

-----

-- 
*------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: