Rolling Out Unattended Debian Installations (Part 1) - page 2
Requirements and Overview
As always, run apt-get update first to update your package lists. Then install all the necessary packages for FAI:# apt-get install fai fai-kernels debmirror mknbi dhcp3-server bootp tftpd-hpa rsh-server rsync
You'll find out what all of these do as we go along. Next, create a directory to house your mirror. Remember, you'll need a lot of disk space. In this example it is /debmirror, isolated on its own partition, and there are 15 nice plump gigabytes allocated for it.
Now you can download the files. Check the mirror list to find a close download site. Use the mkdebmirror script, located in /usr/share/doc/fai/examples/utils/ to download and build the mirror. mkdebmirror uses debmirror and rsync, and creates the mirror directories. First edit the script to suit your preferences. This example creates a Sid mirror. Note that the original script included with FAI mirrors the security archive. This is not a good idea. For one thing, there is no security archive for Sid. For another, security updates should be downloaded directly from debian.org, so get rid of the debian-security section. It also helpful to add the -v flag to the debmirror commands, so you that can monitor progress. This is a complete example:
#! /bin/sh
# $Id: mkdebmirror,v 1.19 2004/07/08 11:35:44 lange Exp $
# Thomas Lange, lange@informatik.uni-koeln.de, (c) 2001-2004
# create partial debian mirror using command debmirror(1) and rsync
# - - - - - - - - - - - - - - - - - - - - - - - - - - - -
rsync_disks() {
# get the boot disks
rsync --delete -av $2::debian/dists/$1/main/disks-$arch $destdir/debian/dists/$1/main/
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - -
update_from() {
# update local mirror from a host
host=$1
allopt="$debug --passive --getcontents --nosource --arch=$arch --ignore=disks-$arch/"
defopt="$allopt --host=$host --dist=$dist"
echo "------------------ create mirror for debian ------------------"
# add the -v flag for verbosity
debmirror -v $destdir/debian $defopt
echo "------------------ create mirror for debian-non-US ------------------"
debmirror -v $destdir/debian-non-US $defopt -r /debian-non-US -s non-US/main,non-US/contrib,non-US/non-free
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# main program
#
# here you have to adjust the hostnames of the mirror and the names of the distributions
debug="$@"
arch=i386
dist=sid
destdir=/files/scratch/debmirror
# first sync from a mirror near to you
update_from ftp.us.debian.org
# get installation disk images via rsync
rsync_disks sid ftp.us.debian.org
Save your changes and run your mkdebmirror script:
# /usr/share/doc/fai/examples/utils/mkdebmirror
------------------ create mirror for debian ------------------
Mirroring to /files/scratch/debmirror/debian from ftp://anonymous:ftp.us.debian.org//debian/
Arches: i386
Dists: sid
Sections: main,contrib,non-free,main/debian-installer
Passive mode on.
Attempting to get lock, this might take 2 minutes before it fails.
Get Release files.
[0%] Getting: dists/sid/Release
[0%] Getting: dists/sid/Release.gpg
Get Packages and Sources files and other miscellany
.
dists/sid/main/binary-i386/Packages.gz needs fetch
[0%] Getting: dists/sid/main/binary-i386/Packages.gz
...
rsync can be a bit funky; if it fails with an error message, try re-running the script a couple of times before looking for script errors.
- Skip Ahead
- 1. Requirements and Overview
- 2. Requirements and Overview
- 3. Requirements and Overview
- 4. Requirements and Overview
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.