Автоматическая установка Debian

Автоматическая установка Debian c помощью TFTP и DHCP.

Создаем папку

 # mkdir /tftpboot/pxe/Debian

Скачиваем и распаковываем архив

 #  wget http://ftp.us.debian.org/debian/dists/lenny/main/installer-i386/
current/images/netboot/netboot.tar.gz  -O - | sudo sh -c "cat - 
| tar xzf - -C /tftpboot/pxe/Debian" 

Уже в имеющийся набор софта добавляем раздел Dedian Preseed

 label Dedian Preseed
    kernel /pxe/Debian/debian-installer/i386/linux
    append load initrd=/pxe/Debian/debian-installer/i386/initrd.gz
    locale=en_US console-keymaps-at/keymap=us hostname=debian
    domain=bezha.od.ua url=http://192.168.0.101/sysresccd/preseed.cfg

В директорию apache кладем файл preseed.cfg

Скачать preseed.cfg можно здесь

####    Network configuration
d-i	netcfg/choose_interface select auto
####    Mirror settings
d-i	mirror/country		string manual
d-i	mirror/http/hostname	string http.us.debian.org
d-i	mirror/http/directory	string /debian
d-i     mirror/http/proxy       string
###    Partitioning
# This example creates a small /boot partition, suitable
# swap, and uses the rest of the space for the root partition:
d-i     partman-auto/method string regular
d-i partman-auto/expert_recipe string                          \
boot-root ::                                                   \
40 50 100 ext3                                                 \
$primary{ } $bootable{ }                                       \
method{ format } format{ }                                     \
use_filesystem{ } filesystem{ ext3 }                           \
mountpoint{ /boot }                                            \
.                                                              \
500 10000 1000000000 ext3                                      \
method{ format } format{ }                                     \
use_filesystem{ } filesystem{ ext3 }                           \
mountpoint{ / }                                                \
.                                                              \
64 512 300% linux-swap                                         \
method{ swap } format{ }                                       \
.
d-i	partman/confirm_write_new_label	boolean true
d-i	partman/choose_partition	select Finish partitioning and write changes to disk
d-i	partman/confirm			boolean	true
### Account setup
passwd passwd/make-user	boolean false
passwd passwd/root-password password r00tme
passwd passwd/root-password-again password r00tme
### Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Kiev
#Base system installation
base-config     base-config/intro       note
base-config     base-config/login       note
base-config	apt-setup/uri_type	select http
base-config	apt-setup/country	select enter information manually
base-config	apt-setup/hostname	string ftp.us.debian.org
base-config	apt-setup/directory	string /debian
base-config	apt-setup/another	boolean false
base-config	apt-setup/security-updates boolean true
### Package selection
tasksel		tasksel/first   	multiselect	Standard system
popularity-contest popularity-contest/participate boolean false
### Boot loader installation
d-i grub-installer/only_debian boolean true
# This command is run just before the install finishes
d-i preseed/late_command string apt-install ssh mc
# Avoid that last message about the install being complete
d-i finish-install/reboot_in_progress note

Пример файла ответов: example-preseed
Файл preseed.cfg – all files in one partition / здесь

Статья о том как автоматически разворачивают сервера на Debian с помощью preseed в компании Evernote