Red Hat and its many clones and offspring, like Fedora, CentOS, White Box Linux, have long had a simple built-in mechanism for cloning installations on diverse hardware: Kickstart. With Kickstart you can easily create a customized configuration, set up an installation server, plug a new PC into the network, and perform an unattended network installation. SUSE has AutoYaST.
Debian users have not been so fortunate. FAI, the Fully-Automated Installer, works beautifully when it's set up correctly. But learning to use FAI is not so easy.
Of course, the Linux world does not stand still. The shiny new Debian Sarge installer introduced a new feature called pre-seeding. Pre-seeding means creating an answer file that answers all questions asked by the installer. Pre-seeding supports both local installations from bootable media and network installations. There are a number of ways to do this:
- Local installation with the standard installation CD/DVDs, plus the preseed file on removable media
- Local installation with the standard installation CD/DVDs, plus the preseed file fetched from a network drive
- Network installation from a Debian mirror or a local mirror
- Using a remastered CD or DVD containing the preseed file
This two-part series covers network installation of Etch, the Testing release of Debian. (There are a lot of changes from Sarge, the Stable Debian release. Each one has its own excellent official Debian installation manual, so make sure you have the right one.) Part 1 will illustrate a couple of simple ways to generate and use a preseed configuration file. Part 2 will detail how to configure the preseed configuration file and set up a local mirror for fast automatic installations.
Quick Start For the Madly Impatient
You can easily test this with your existing Debian installation. It should also work with Ubuntu/Kubuntu/Edubuntu/Xubuntu/Metoobuntu/etc. Two important limitations you should know about are: There is no way to use an existing partitioning scheme, so you must use either free space or the entire hard disk, and you cannot set up RAID yet with pre-seeding.
First install debconf-utils, then extract the contents of /var/log/installer/cdebconf, which is a database of everything installed on the system, into a preseed.cfg file:
# apt-get install debconf-utils |
# Which specific keymap do you want ? |
linux26 preseed/file=/floppy/preseed.cfg debconf/priority=critical |
USB Stick Network Installation
If you have a USB stick with 128 MB or greater capacity, you can use it to boot the Etch installer, and then start the installation with a small .iso image. The installer will give you a list of Debian mirrors to choose from to complete the installation. First, download hd-media/boot.img.gz to your PC's hard drive. You'll find it on any Debian mirror, like mirrors.kernel.org. Then, download the business-card CD image.
Now prepare your USB stick. Delete all existing partitions, then create at least one new partition, and format it with the FAT filesystem. If your USB stick is larger than 128 MB you may create more than one partition; just be sure to reserve the first partition for the Etch installer.
Find the drive's block device name:
$ lsscsi |
$ df -h Filesystem Size Used Avail Use% Mounted on /dev/hda1 4.7G 3.9G 819M 83% / tmpfs 253M 0 253M 0% /dev/shm /dev/hda2 3.8G 1.5G 2.3G 41% /home |
# fdisk /dev/sdb Command (m for help): P Disk /dev/sdb: 128 MB, 128974848 bytes 4 heads, 62 sectors/track, 1015 cylinders Units = cylinders of 248 * 512 = 126976 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 1015 125829 1 FAT12 |
Command (m for help): d Selected partition 1 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. |
# fdisk /dev/sdb Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-1015, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-1015, default 1015): Using default value 1015 Command (m for help): t Selected partition 1 Hex code (type L to list codes): 1 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. |
# mkfs.vfat /dev/sdb1 |
Copying the Boot Files
Now extract the boot files to the USB stick:
# zcat boot.img.gz > /dev/sdb1 |
linux26 preseed/file=/floppy/preseed.cfg debconf/priority=critical |
Resources
- Debian GNU/Linux Installation Guide for Etch
- Debian GNU/Linux Installation Guide for Sarge
- Apt-proxy
- Apt-mirror
This article originally appeared on EnterpriseNetworkingPlanet.com.