Let me provide as much information as I can about what I'm doing:
I work in a lab development environment managing over 100 server systems. We frequently need to re-image systems with different operating systems and are using CloneZilla to do this quick and easy. CloneZilla is installed to a USB drive and its grub.cfg
file configured to launch different OS installers. One of the operating systems (as you can imagine) is Ubuntu (both 14.04 and 16.04). It's configured to boot Ubuntu's network installer and load a preseed/kickstart file from a local web server:
#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone --utc America/Los_Angeles
#Root password
rootpw --disabled
#Initial user
user lab --fullname "Lab" --iscrypted --password $1$XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
url --url http://ubuntu.osuosl.org/ubuntu
preseed mirror/http/proxy string "http://proxy.corp.com:123"
#System bootloader configuration
#bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
#preseed functions
preseed base-installer/kernel/image string linux-image-generic
preseed base-installer/kernel/override-image string linux-image-generic
preseed clock-setup/ntp-server string pool.ntp.org
preseed partman-auto/choose_recipe select atomic
preseed partman-auto/disk string /dev/sda
preseed partman-auto/method string regular
preseed partman/choose_partition select finish
preseed partman/confirm boolean true
preseed partman/confirm_nooverwrite boolean true
preseed partman/default_filesystem string ext4
preseed partman-lvm/confirm boolean true
preseed partman-lvm/device_remove_lvm boolean true
preseed partman-md/confirm boolean true
preseed partman-md/device_remove_md boolean true
preseed partman-partitioning/choose_label string gpt
preseed partman-partitioning/confirm_write_new_label boolean true
preseed partman-efi/non_efi_system boolean true
preseed pkgsel/update-policy select unattended-upgrades
preseed grub-installer/only_debian boolean true
preseed grub-installer/with_other_os boolean true
preseed netcfg/get_hostname string hostname
preseed netcfg/get_domain string domain
# auto method must be lvm
preseed partman-basicfilesystems/choose_label string gpt
preseed partman-basicfilesystems/default_label string gpt
preseed partman-partitioning/default_label string gpt
preseed partman/choose_label string gpt
preseed partman/default_label string gpt
preseed partman-auto/text/boot-root-all :: \
1 1 1 free \
$gptonly{ } \
$primary{ } \
$bios_boot{ } \
method{ biosgrub } \
. \
512 100 512 vfat \
$gptonly{ } \
$primary{ } \
method{ efi } \
format{ } \
$lvmignore{ } \
mountpoint{ /boot/efi } \
.\
128 512 256 ext2 \
$defaultignore{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext2 } \
mountpoint{ /boot } \
. \
1024 4096 -1 ext4 \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.
preseed partman-auto/choose_recipe select boot-root-all
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
preseed partman-partitioning/confirm_write_new_label boolean true
preseed partman/choose_partition select finish
preseed partman-md/confirm boolean true
preseed partman/confirm boolean true
preseed partman/confirm_nooverwrite boolean true
# This is fairly safe to set, it makes grub install automatically to the MBR
# if no other operating system is detected on the machine.
preseed grub-installer/only_debian boolean true
preseed grub-installer/with_other_os boolean true
preseed grub-installer/bootdev string /dev/sda
#addtional packages
%packages --resolvedeps
openssh-server
libvirt-bin
vim
libpam-systemd
dbus
bash-completion
This is the preseed/kickstart file for Ubuntu 16.04 (with some identifying information stripped out).
The network installer successfully boots and begins the automated install process. However, instead of installing to the local hard drive or SSD, it installs to the USB installation drive and overwrites the CloneZilla image.
Other operating systems are installed fine through CloneZilla using their own local or network installers. It seems to just be Ubuntu having the problem.
Our current workaround is to immediately pull the USB drive out of the system once you can see the network installer boot and begin initializing. The network installer has already been loaded into RAM so it keeps going and only detects the local drive. You have to be quick because the network installer initializes quickly from RAM and if you're too late the USB drive is usually already corrupted.
I searched the partman
documentation in hopes of finding a configuration option to tell the installer to ignore the source media device but I guess since it's a network install there is no way to do that?
Does anyone know of a preseed/kickstart configuration option that would solve this issue?
The issue seems to be that you're spelling out:
And the USB is defined as
/dev/sda
.I think the installer is smart enough to find the correct disk, and that you can remove this line. Otherwise, you would need to spell-out the drive to use.