Debian unattend install

!!!! WARNING !!!

Debian 6.0.5 and 6.0.6 ( x64) seems to have a buggy netboot ( initrd.gz)

If you receiving an error like this during preseed: “No root file system is defined.” it’s because initrd.gz does not contains ANY drivers for ATA/SATA/SCSI

Here is an updated initrd.gz which will contains all drivers for detecting the HDD( by security reason I had to rename the file in ODT).

1. Deploy server:: RHEL 6.0

2. setup of tftp

— structure of /tftpboot directory:

|­­ boot.msg
|­­ debian-install
|           |­­ initrd.gz
|           `­­ linux
|­­ pxelinux.0
`­­ pxelinux.cfg
`­­ default

— content of /tftpboot/pxelinux.cfg/default

label 1 Debian
  kernel debian-install/linux
  append ramdisk_size=14984 auto=true priority=critical vga=normal initrd=debian-install/initrd.gz netcfg/choose_interface=eth1 netcfg/dhcp_timeout=30 url=

— content of /tftpboot/msg/boot.msg

1. Debian unattended (x32 )

download the netboot installer clients need for booting:


3. setup of DHCP

ddns-update-style none;
allow booting;
allow bootp;

subnet netmask {
    filename “pxelinux.0”;

4. setup apache and create mirror structure

— mkdir  -p  /storage/debian ( here we copy the content of debian dvd )

— apache setup

create /etc/httpd/conf.d/debian.conf

<Directory “/storage/debian”>
    AllowOverride None
    Order allow,deny
    Allow from all

5. debian.cfg

d-i debian-installer/locale                   string en_US
d-i console-keymaps-at/keymap                 select us
# Static network configuration.
d-i netcfg/dhcp_timeout                        string 30
d-i netcfg/choose_interface                    select eth0
# Install source
d-i mirror/country                              string enter information manually
d-i mirror/http/hostname                        string
d-i mirror/http/directory                       string /debian
d-i mirror/codename                             string squeeze
d-i mirror/http/proxy                           string
d-i apt-setup/local0/repository                 string debian squeeze
d-i apt-setup/local0/comment                    string local debian squeeze repository main
d-i apt-setup/local1/repository                 string security squeeze/updates main
d-i apt-setup/local1/comment                    string local debian squeeze security repository
d-i apt-setup/security_host                     string
d-i debian-installer/allow_unauthenticated      string true
d-i finish-install/reboot_in_progress           note
d-i prebaseconfig/reboot_in_progress            note
d-i apt-setup/non-free                          boolean true
d-i apt-setup/contrib                           boolean true
### Clock and time zone setup
d-i clock-setup/utc                             boolean true
d-i clock-setup/ntp                             boolean true
d-i clock-setup/ntp-server                      string
d-i time/zone                                   string Europe/Prague
### Partitioning
d-i partman-auto/disk                            string /dev/sda
d-i partman-auto/method                          string regular
d-i partman-lvm/device_remove_lvm                boolean true
d-i partman-auto/purge_lvm_from_device           boolean true
d-i partman-lvm/confirm                          boolean true
d-i partman/alignment                            select cylinder
d-i partman/confirm                              boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition                     select finish
d-i partman/confirm_nooverwrite                  boolean true
#d-i grub-installer/with_other_os                 boolean true
d-i grub-installer/only_debian                   boolean true
#d-i grub-installer/grub2_instead_of_grub_legacy  boolean false

d-i partman-auto/expert_recipe string             \
 condpart ::                                      \
 100 100 100 ext3                                 \
     $primary{ } $bootable{ }                     \
     method{ format } format{ }                   \
     use_filesystem{ } filesystem{ ext3 }         \
     mountpoint{ /boot }                          \
 .                                                \
 1024 1024 1024 ext4                              \
     $primary{ }                                  \
     method{ format } format{ }                   \
     use_filesystem{ } filesystem{ ext4 }         \
     mountpoint{ / }                              \
 .                                                \
 4096 4096 4096 ext4                              \
     $primary{ }                                  \
     method{ format } format{ }                   \
     use_filesystem{ } filesystem{ ext4 }         \
     mountpoint{ /usr }                           \
 .                                                \
 1024 1024 1024 linux-swap                        \
     method{ swap } format{ }                     \
 .                                                \
 1024 1024 1024 ext4                              \
     $primary{}                                   \
     method{ format } format{ }                   \
     use_filesystem{ } filesystem{ ext4 }         \
     mountpoint{ /home }                          \
# Root User
 # printf “pasword1212″ | mkpasswd -s -m md5
d-i     passwd/root-password-crypted                passwd    $1$Jb309hGn$/O0GmxsctnzK/QS3y/Wgn.
 # Local User
 passwd  passwd/make-user                           boolean false
# Software Selections
tasksel tasksel/first                               multiselect  database-server dns-server file-server ssh-server web-server standard
d-i     pkgsel/include                              string       ssh openvpn lvm2 mysql-server bind9 vim snmp ethtool sysstat ntp ntpdate nagios-nrpe-server
#d-i preseed/late_command                           string   wget -O /tmp/; chmod +x /tmp/; /bin/sh /tmp/
mysql-server-5.1 mysql-server/root_password         password 123aaa
mysql-server-5.1 mysql-server/root_password_again   password 123aaa
mysql-server-5.1 mysql-server/start_on_boot         boolean true
samba-common    samba-common/encrypt_passwords      boolean true
samba-common    samba-common/dhcp                   boolean false
samba-common    samba-common/workgroup              string  WORKGROUP
samba-common    samba-common/do_debconf             boolean true
exim4-config     exim4/no_config                    boolean true
exim4-config     exim4/exim3_upgrade                boolean true





#setup network interfaces

cat <<_NETFILE_ >$ETC/network/interfaces
auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static

allow-hotplug eth1
        iface eth1 inet static

echo “router” >$ETC/hostname

#setup apt mirrors

cat <<_SOURCELIST_ >$ETC/apt/sources.list
deb squeeze main
deb-src squeeze main

deb squeeze/updates main contrib
deb-src squeeze/updates main contrib

deb squeeze-updates main contrib
deb-src squeeze-updates main contrib



One response to “Debian unattend install

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s