============================================== install with Knoppix http://www.inittab.de/manuals/debootstrap.html DISK=/dev/hda MPOINT=/mnt/hda1 fdisk $DISK mkfs.ext3 ${DISK}1 for i in 1 2 5 6 7; do echo "=====> ${DISK}$i";mke2fs -m 2 -j ${DISK}$i;done for i in 1 2 5 6 7; do echo "=====> ${DISK}$i";fsck ${DISK}$i; done mount ${DISK}1 $MPOINT mkdir ${MPOINT}/usr mkdir ${MPOINT}/var mkdir ${MPOINT}/tmp mkdir ${MPOINT}/home mount ${DISK}2 ${MPOINT}/usr mount ${DISK}5 ${MPOINT}/var mount ${DISK}6 ${MPOINT}/tmp mount ${DISK}7 ${MPOINT}/home df # optional mkdir ${MPOINT}/home/var.cache.apt cd ${MPOINT}/var/cache mv apt/* ../../home/var.cache.apt rmdir /var/cache/apt ln -s ../../home/var.cache.apt apt cd / [ ! -d ${MPOINT}/etc/apt ] && mkdir -p ${MPOINT}/etc/apt [ ! -e ${MPOINT}/etc/resolv.conf ] && cp /etc/resolv.conf ${MPOINT}/etc cat << EOM > ${MPOINT}/etc/apt/sources.list deb http://ftp.us.debian.org/debian/ stable main non-free contrib deb-src http://ftp.us.debian.org/debian/ stable main non-free contrib deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free deb http://security.debian.org/ stable/updates main contrib non-free #deb http://pkg-kde.alioth.debian.org/kde-3.4.0/ ./ #deb http://www.morphix.org/debian ./ #deb http://ftp.us.debian.org/debian/ testing main #deb-src http://ftp.us.debian.org/debian/ testing main EOM # export DEBOOTSTRAP_DIR=/tmp/debootstrap/ debootstrap sarge $MPOINT http://ftp.us.debian.org/debian # I: Base system installed successfully. #-------------- chroot chroot $MPOINT DISK=/dev/hda mount -t proc none /proc apt-get update apt-get upgrade apt-get install grub grub-install $DISK cat << EOM > /etc/lilo.conf #LILO boot loader configuration. boot=$DISK root=$DISK}1 compact install=/boot/boot.b map=/boot/map vga=ask delay=20 image=/boot/vmlinuz root=$DISK}1 label=Linux initrd=/initrd.img read-only EOM [ ! -d ${MPOINT}/boot/grub ] && mkdir -p ${MPOINT}/boot/grub cat << EOM > ${MPOINT}/boot/grub/menu.lst # Boot automatically after 30 secs. timeout 30 color light-green/brown # By default, boot the first entry. default 1 # Fallback to the second entry. fallback 2 # For booting GNU/Linux title hda root (hd0,0) kernel /boot/vmlinuz root=${DISK}1 #initrd /initrd.img EOM install the package mkinitrd-tools and modify /etc/mkinitrd/mkinitrd.conf so $ROOT points to your new root partition (autodetection will fail in chroot). These steps are only required if you want to use one of the Debian kernel-images. apt-get install initrd-tools ============================ check /etc/mkinitrd/mkinitrd.conf (SCSI) MODULES=most DELAY=0 ROOT=/dev/sda1 # This controls the permission of the resulting initrd image. UMASK=022 # generate the initrd image. MKIMAGE='mkcramfs %s %s > /dev/null' ---------------------------- chroot# mount /proc /proc -t proc apt-get install kernel-image-2.4.18-686 apt-get install kernel-image-2.6.8-2-686 add the initrd to lilo.conf and run lilo again before leaving the chroot. chroot# exit umount $MPOINT/proc umount $MPOINT reboot ============================================== bash aliases cat <> /root/.bashrc alias agi='apt-get install ' alias agu='apt-get update ' alias agg='apt-get upgrade ' alias agr='apt-get remove' alias acse='apt-cache search ' alias acsh='apt-cache show ' alias agd='apt-get dist-upgrade' alias asv='apt-show-versions -p' EOM vi /root/.bashrc . /root/.bashrc apt-get install screen ============================================== install with Knoppix RAID 1 MPOINT=/mnt/md0 export MPOINT mkdir $MPOINT It is important to make md-to-be partitions with ID 0xFD, not 0x83. sfdisk -d /dev/sda >/tmp/sda sfdisk /dev/sdb /dev/md${MD} partition format complete" sleep 3 let MD=MD+1 done mount /dev/md0 /mnt/md0 df -h /mnt/md0 MD=1 for part in usr var tmp home do mkdir ${MPOINT}/$part mount /dev/md${MD} ${MPOINT}/$part let MD=MD+1 done df MDADM_CONF=${MPOINT}/etc/mdadm.conf [ ! -d ${MPOINT}/etc ] && mkdir ${MPOINT}/etc echo 'DEVICE /dev/sd*[0-9] /dev/sd*[0-9]' > $MDADM_CONF mdadm --detail --scan >> $MDADM_CONF cat $MDADM_CONF cd / [ ! -d ${MPOINT}/etc/apt ] && mkdir -p ${MPOINT}/etc/apt [ ! -e ${MPOINT}/etc/resolv.conf ] && cp /etc/resolv.conf ${MPOINT}/etc cat << EOM > ${MPOINT}/etc/apt/sources.list deb http://ftp.us.debian.org/debian/ stable main non-free contrib deb-src http://ftp.us.debian.org/debian/ stable main non-free contrib deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free deb http://security.debian.org/ stable/updates main contrib non-free #deb http://pkg-kde.alioth.debian.org/kde-3.4.0/ ./ #deb http://www.morphix.org/debian ./ #deb http://ftp.us.debian.org/debian/ testing main #deb-src http://ftp.us.debian.org/debian/ testing main EOM # export DEBOOTSTRAP_DIR=/tmp/debootstrap/ debootstrap sarge $MPOINT http://ftp.us.debian.org/debian # I: Base system installed successfully. cat << EOM > $MPOINT/etc/fstab # /etc/fstab: static file system information. # # /dev/md0 / ext3 errors=remount-ro 0 1 /dev/sda3 none swap sw,pri=1 0 0 /dev/sdb3 none swap sw,pri=1 0 0 proc /proc proc defaults 0 0 /dev/md1 /usr ext2 defaults 0 2 /dev/md2 /var ext2 defaults 0 2 /dev/md3 /tmp ext2 defaults 0 2 /dev/md4 /home ext2 defaults 0 2 EOM #-------------- chroot chroot $MPOINT DISK=/dev/sda MD=/dev/md0 mount -t proc none /proc apt-get update apt-get upgrade apt-get install mdadm cat /proc/mdstat #dpkg-reconfigure mdadm apt-get install grub grub-install $DISK [ ! -d ${MPOINT}/boot/grub ] && mkdir -p ${MPOINT}/boot/grub cat << EOM > ${MPOINT}/boot/grub/menu.lst # Boot automatically after 30 secs. timeout 30 color light-green/brown # By default, boot the first entry. default 1 # Fallback to the second entry. fallback 2 # For booting GNU/Linux title md0 root (hd0,0) kernel /boot/vmlinuz root=${MD}0 #initrd /initrd.img EOM ------- grub> root (hd0,0) setup (hd0) root (hd1,0) setup (hd1) quit # install the package mkinitrd-tools and modify /etc/mkinitrd/mkinitrd.conf so # $ROOT points to your new root partition (autodetection will fail in chroot). # These steps are only required if you want to use one of the Debian # kernel-images. apt-get install initrd-tools ============================ LILO cat << EOM > /etc/lilo.conf #LILO boot loader configuration. boot=$MD root=${MD}0 compact install=/boot/boot.b map=/boot/map vga=ask delay=20 image=/boot/vmlinuz root=${MD}0 label=Linux initrd=/initrd.img read-only EOM ============================ check /etc/mkinitrd/mkinitrd.conf (SCSI) MODULES=most DELAY=0 ROOT=/dev/md0 # This controls the permission of the resulting initrd image. UMASK=022 # generate the initrd image. MKIMAGE='mkcramfs %s %s > /dev/null' ---------------------------- chroot# mount /proc /proc -t proc apt-get install kernel-image-2.4.18-686 apt-get install kernel-image-2.6.8-2-686 #add the initrd to lilo.conf and run lilo again before leaving the chroot. chroot# exit umount $MPOINT/proc umount $MPOINT reboot ============================================== reassemble RAID 1 partitions MD=0 for part in 1 2 5 6 7 do mdadm -A /dev/md${MD} /dev/sda${part} /dev/sdb${part} echo -e "===> Reassembled /dev/md${MD}" let MD=MD+1 done for p in 0 1 2 3 4 do fsck /dev/md${p} echo "================= /dev/md${p}" done mount /dev/md0 /mnt/md0 MD=1 for part in usr var tmp home do [ !-d ${MPOINT}/$part ] && (echo -e "${MPOINT}/$part missing!\n"; exit 1) mount /dev/md${MD} ${MPOINT}/$part let MD=MD+1 done df watch cat /proc/mdstat ============================================== stop RAID for part in 0 1 2 3 4 do mdadm --stop /dev/md${part} echo "Stop =====================> /dev/md${part}" done ============================================== configure apt-get install discover kudzu kudzu-vesa mdetect read-edid xdebconfigurator dpkg-reconfigure xserver-xorg dpkg-reconfigure xserver-xfree86 XFree86 -configure # Xorg -configure