我想通过 preseed 将 Ubuntu 安装到我的计算机系统配置中最小的硬盘上。它工作正常,但是当较小的 HDD 不是 /dev/sda(例如 /dev/sdb)时,我收到错误“执行 'grub-install/dev/sda' 失败”。如何将 grub-installer/bootdev 与 debconf-set partman-auto/disk 绑定?
d-i partman/early_command \
string debconf-set partman-auto/disk "$(echo /dev/`lsblk -rndbo SIZE,NAME,TRAN | grep sata | grep sd* | sort -V | head -n1 | cut -d " " -f2`)"
d-i grub-installer/bootdev (what am i need to type here?)
d-i partman-auto/method string crypto
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string crypt
d-i partman-auto/choose_recipe select root-encrypted
d-i partman-auto/expert_recipe string \
root-encrypted :: \
512 512 512 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
100% 100% 100% linux-swap \
$lvmok{ } lv_name{ swap } \
in_vg { crypt } \
$primary{ } \
method{ swap } format{ } \
. \
10240 51200 -1 ext4 \
$lvmok{ } lv_name{ root } \
in_vg { crypt } \
$primary{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
. \
答案1
注释掉
dipartman/early_command \
string debconf-set partman-auto/disk "$(echo /dev/`lsblk -rndbo SIZE,NAME,TRAN | grep sata | grep sd* | sort -V | head -n1 | cut -d " " -f2`)"
只需使用
di grub 安装程序/bootdev /dev/sdb