预先植入的网络安装正在覆盖 USB 安装驱动器

预先植入的网络安装正在覆盖 USB 安装驱动器

让我尽可能多地提供关于我正在做的事情的信息:

我在一个实验室开发环境中工作,管理着 100 多个服务器系统。我们经常需要使用不同的操作系统重新映像系统,并使用 CloneZilla 来快速轻松地完成此操作。CloneZilla 安装在 USB 驱动器上,其grub.cfg文件配置为启动不同的操作系统安装程序。其中一个操作系统(如您所想)是 Ubuntu(14.04 和 16.04)。它配置为启动 Ubuntu 的网络安装程序并从本地 Web 服务器加载预置/kickstart 文件:

#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

这是 Ubuntu 16.04 的 preseed/kickstart 文件(删除了一些识别信息)。

网络安装程序成功启动并开始自动安装过程。但是,它没有安装到本地硬盘或 SSD,而是安装到 USB 安装驱动器并覆盖了 CloneZilla 映像。

其他操作系统可以通过 CloneZilla 使用其自己的本地或网络安装程序顺利安装。看来只有 Ubuntu 有问题。

我们目前的解决方法是,一旦您看到网络安装程序启动并开始初始化,就立即将 USB 驱动器从系统中拔出。网络安装程序已加载到 RAM 中,因此它会继续运行并仅检测本地驱动器。您必须动作快,因为网络安装程序会从 RAM 快速初始化,如果您太晚,USB 驱动器通常已经损坏。

我搜索了partman文档,希望找到一个配置选项来告诉安装程序忽略源媒体设备,但我猜因为它是一个网络安装,所以没有办法做到这一点?

有谁知道可以解决此问题的 preseed/kickstart 配置选项?

答案1

问题似乎在于你拼写出来:

preseed partman-auto/disk string /dev/sda

而USB的定义是/dev/sda

我认为安装程序足够智能,能够找到正确的磁盘,您可以删除此行。否则,您需要拼出要使用的驱动器。

相关内容