Ubuntu Preseed,为什么 grub 寻找名为 sda 的卷组?

Ubuntu Preseed,为什么 grub 寻找名为 sda 的卷组?

我正在尝试预安装 Ubuntu Server 16.04LTS,但遇到了错误,grub2 导致安装程序中止(红色背景)。错误文本为“安装步骤失败。您可以尝试从菜单中再次运行失败的项目,或者跳过它并选择其他内容。失败的步骤是‘将 GRUB 引导加载程序安装到硬盘上’。这是我的预安装文件:

### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_GB.UTF-8

# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string gb

### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto

# Just in case our DHCP server is busy.
d-i netcfg/dhcp_timeout string 60

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string

# Added by @analytically: always install the server kernel
d-i     base-installer/kernel/override-image string linux-server

### Mirror settings
# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
# CC is the ISO-3166-2 code for the selected country. You can preseed this
# so that it does so without asking.
d-i mirror/http/mirror select gb.archive.ubuntu.com
d-i mirror/http/proxy string

### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true

# You may set this to any valid setting for $TZ; see the contents of
"custom-cd/new-iso/preseed/ps-lubuntu-server.seed" [dos] 243L, 10212C                                                                                                                                                   1,1           Top
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_GB.UTF-8

# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string gb

### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto

# Just in case our DHCP server is busy.
d-i netcfg/dhcp_timeout string 60

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string

# Added by @analytically: always install the server kernel
d-i     base-installer/kernel/override-image string linux-server

### Mirror settings
# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
# CC is the ISO-3166-2 code for the selected country. You can preseed this
# so that it does so without asking.
d-i mirror/http/mirror select gb.archive.ubuntu.com
d-i mirror/http/proxy string

### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true

# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
d-i time/zone string Etc/UTC

# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true

####----------------------------------------------------------------------------------
### Partitioning
### Do NOT install on the USB stick(!)
#
# The Debian installer will install on the first disk it finds which can
# sometimes be the USB stick itself. Work around this by rolling our own auto
# detect logic which disallows installing on USB devices.
d-i partman/early_command string \
  USBDEV_LIST="$(mktemp)"; \
  list-devices usb-partition | sed "s/\(.*\)./\1/" > "$USBDEV_LIST"; \
  BOOTDEV="$(list-devices disk | grep -vf "$USBDEV_LIST" | head -n 1)"; \
  debconf-set partman-auto/disk "$BOOTDEV"; \
  debconf-set grub-installer/bootdev "$BOOTDEV";

### Partitioning

#uto method must be lvm
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-basicfilesystems/no_swap boolean false

# Keep that one set to true so we end up with a UEFI enabled
# system. If set to false, /var/lib/partman/uefi_ignore will be touched
d-i partman-efi/non_efi_system boolean true

# enforce usage of GPT - a must have to use EFI!
d-i partman-basicfilesystems/choose_label string gpt
d-i partman-basicfilesystems/default_label string gpt
d-i partman-partitioning/choose_label string gpt
d-i partman-partitioning/default_label string gpt
d-i partman/choose_label string gpt
d-i partman/default_label string gpt

d-i partman-auto/choose_recipe select boot-root-all
d-i partman-auto/expert_recipe string \
boot-root-all :: \
538 538 1075 free \
$iflabel{ gpt } \
$reusemethod{ } \
method{ efi } \
format{ } \
. \
128 512 256 ext2 \
$defaultignore{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext2 } \
mountpoint{ /boot } \
. \
1024 4096 15360 ext4 \
$lvmok{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
. \
1024 4096 15360 ext4 \
$lvmok{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /var } \
. \
1024 1024 -1 ext4 \
$lvmok{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /var/lib } \
.
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman-md/confirm boolean true
d-i partman/confirm boolean true
d-i 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.
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev  string /dev/sda

###----------------------------------------------------------------------------------
### Base system installation
### Account setup

# To create a normal user account.

# The installer will warn about weak passwords. If you are sure you know
# what you're doing and want to override it, uncomment this.
d-i user-setup/allow-password-weak boolean true

# Set to true if you want to encrypt the first user's home directory.
d-i user-setup/encrypt-home boolean false

### Apt setup
# You can choose to install restricted and universe software, or to install
# software from the backports repository.
#d-i apt-setup/restricted boolean true
#d-i apt-setup/universe boolean true
#d-i apt-setup/backports boolean true
# Uncomment this if you don't want to use a network mirror.
#d-i apt-setup/use_mirror boolean false
# Select which update services to use; define the mirrors to be used.
# Values shown below are the normal defaults.
#d-i apt-setup/services-select multiselect security
#d-i apt-setup/security_host string security.ubuntu.com
#d-i apt-setup/security_path string /ubuntu

# Additional repositories, local[0-9] available
#d-i apt-setup/local0/repository string \
#       http://local.server/ubuntu squeeze main
#d-i apt-setup/local0/comment string local server
# Enable deb-src lines
#d-i apt-setup/local0/source boolean true
# URL to the public key of the local repository; you must provide a key or
# apt will complain about the unauthenticated repository and so the
# sources.list line will be left commented out
#d-i apt-setup/local0/key string http://local.server/key

### Package selection
#tasksel        tasksel/force-tasks     string server
tasksel tasksel/first multiselect none
# Individual additional packages to install
d-i pkgsel/include string bash-completion openssh-server nfs-common xserver-xorg-hwe-16.04 xorg xinit \
openbox roxterm xterm xfonts-wqy fonts-wqy-zenhei cpuburn pulseaudio acpid avahi-autoipd wget wput \
alsa-base alsa-utils libx86-dev uml-utilities plymouth-theme-ubuntu-logo mingetty feh expect libyajl2 \
libasound2 libasound2-dev libasound2-plugins libgtk2.0-dev libnss3 libsdl1.2-dev libva-dev libudev-dev \
libssl-dev arping ibus-libpinyin ntpdate xdotool bridge-utils libevent-dev ibus-pinyin supervisor zip \
i2c-tools libnuma-dev smartmontools ftplib-dev bc iw wpasupplicant thin-provisioning-tools \
pm-utils ebtables cgmanager augeas-lenses libaugeas0 libboost-iostreams1.58.0 libboost-random1.58.0 \
libboost-thread1.58.0 libnetcf1 libnl-route-3-200 librados2 librbd1 libxen-4.6 libxenstore3.0
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
#d-i pkgsel/upgrade select full-upgrade

# Language pack selection
d-i pkgsel/language-packs multiselect en

# No language support packages
d-i     pkgsel/install-language-support boolean false

# Policy for applying updates. May be "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
d-i pkgsel/update-policy select unattended-upgrades

# Verbose output and no boot splash screen
d-i     debian-installer/quiet  boolean false
d-i     debian-installer/splash boolean false

### Boot loader installation
# This is fairly safe to set, it makes grub install automatically to the MBR
# if no other operating system is detected on the machine.         
d-i grub-installer/only_debian boolean true

# This one makes grub-installer install to the MBR if it also finds some other
# OS, which is less safe as it might not be able to boot that other OS.
d-i grub-installer/with_other_os boolean true

# Wait for two seconds in grub
d-i     grub-installer/timeout string 0

# Use the following option to add additional boot parameters for the
# installed system (if supported by the bootloader installer).
# Note: options passed to the installer will be added automatically.
d-i debian-installer/add-kernel-opts string vga=normal nomodeset audit=0 intel_idle.max_cstate=0 processor.max_cstate=1 cgroup_enable=memory swapaccount=1

### Finishing up the installation
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note

#### Advanced options
### Running custom commands during the installation
# d-i preseeding is inherently not secure. Nothing in the installer checks
# for attempts at buffer overflows or other exploits of the values of a
# preconfiguration file like this one. Only use preconfiguration files from
# trusted locations! To drive that home, and because it's generally useful,
# here's a way to run any shell command you'd like inside the installer,
# automatically.

# This first command is run as early as possible, just after
# preseeding is read.
#d-i preseed/early_command string anna-install some-udeb
# This command is run immediately before the partitioner starts. It may be
# useful to apply dynamic partitioner preseeding that depends on the state
# of the disks (which may not be visible when preseed/early_command runs).
#d-i partman/early_command \
#       string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
# This command is run just before the install finishes, but when there is
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target systemo.
d-i preseed/late_command string \
in-target update-grub;

当安装程序停止时,/var/log/syslog 显示的内容如下:

Jul  17 03:43:14 main-menu[273]: (process:26338): Volume group "sda" not found
Jul  17 03:43:14 main-menu[273]: (process:26338):
Jul  17 03:43:14 main-menu[273]: (process:26338):
Jul  17 03:43:14 main-menu[273]: (process:26338): Cannot process volume group sda
Jul  17 03:43:14 main-menu[273]: (process:26338):
Jul  17 03:43:14 main-menu[273]: WARNING **: Configuring 'grub-installer' failed with error code 1
Jul  17 03:43:14 main-menu[273]: WARNING **: Menu item 'grub-installer' failed.

我好像预装了一些 deb(xserver-xorg-hwe-16.04 xorg) 包导致内核被修改了,设备的 UUID 变了,所以设备无法启动,不知道怎么解决。

答案1

我认为它之所以选择是sda因为你指定了

d-i grub-installer/bootdev  string /dev/sda

相关内容