Debian プリセットでは、LUKS LVM を使用して暗号化されたディスクを正しく作成できません

Debian プリセットでは、LUKS LVM を使用して暗号化されたディスクを正しく作成できません

Debian 10(Buster)では、プリセットを使用してLUKS LVMディスクパーティションを自動的に作成しようとしています。/dev/sda80GBのディスクと4GBのシステムメモリしかありません。

私の完全なプリセット設定は次のとおりです。

#### Preseed preconfiguration file (for Debian buster)
### Partman early command
### Kernal parameter
d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 console=ttyS0,19200n8
### Localization
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/language string en
d-i debian-installer/country string MY

### Keyboard selection
d-i keyboard-configuration/xkb-keymap select us

###  Network configuration
d-i netcfg/choose_interface select eth0
d-i netcfg/use_dhcp string false
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
# IPv4 Static network configuration
d-i netcfg/get_ipaddress string 172.14.5.185
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 172.14.5.1
d-i netcfg/get_nameservers string 139.12.11.5
d-i netcfg/confirm_static boolean true

# Set a hostname
d-i netcfg/get_hostname string sun
d-i netcfg/get_domain string domain.com
# Force a hostname
d-i netcfg/hostname string sun.domain.com
# Disable that annoying WEP key dialog
d-i netcfg/wireless_wep string

### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

### Account setup
# Skip creation of a normal user account
d-i passwd/make-user boolean false
# Set root password
# or encrypted using a crypt(3)  hash.
d-i passwd/root-password-crypted password $6$R3C6TyiPkyqUwaw7$4rgc4Uluov6wm5ZXmEdssw3pZs5E5dsnOuVPa/VAHAJTsQCsxSeKjIj7hp3xJzZ9t5wQpx6UuYcXZxYpjbkn/

### Clock and time zone setup
# Set hardware clock to UTC
d-i clock-setup/utc boolean true
# Set timezone
d-i time/zone string Asia/Kuala_Lumpur
# Use NTP clock during installation
d-i clock-setup/ntp boolean true

### Partitioning
# LVM LUKS method
d-i partman-auto/method string crypto
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-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string box1
d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-crypto
d-i partman-auto/expert_recipe string \
boot-crypto :: \
  1024 1024 1024 ext4 \
          $primary{ } $bootable{ } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ ext4 } \
          mountpoint{ /boot } \
  . \
  15360 15360 15360  ext4 \
          $lvmok{ } lv_name{ root } \
          in_vg { box1 } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ ext4 } \
          mountpoint{ / } \
  . \
  2048 2048 2048 ext4 \
          $lvmok{ } lv_name{ tmp } \
          in_vg { box1 } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ ext4 } \
          mountpoint{ /tmp } \
          options/nosuid{ nosuid } \
          options/noexec{ noexec } \
  . \
  4096 4096 4096 linux-swap \
          $lvmok{ } lv_name{ swap } \
          in_vg { box1 } \
          method{ swap } format{ } \
  . \
  80896 80896 1000000 ext4 \
          $lvmok{ } lv_name{ home } \
          in_vg { box1 } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ ext4 } \
          mountpoint{ /home } \
          options/nosuid{ nosuid } \
d-i partman-basicfilesystems/no_mount_point boolean false
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

### Apt setup
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/cdrom/set-next boolean false
d-i apt-setup/cdrom/set-failed boolean false
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
### Package selection
tasksel tasksel/first multiselect standard
# Individual additional packages to install
d-i pkgsel/include string openssh-server
popularity-contest popularity-contest/participate boolean false

他のプリセット設定は正常に実行されます。ディスクはLUKS LVMを使用して作成しましたが、問題は/ homeのようなパーティションが欠落している(最初から作成されなかった)上記のプロビジョニングファイルで定義しました。そしてスワップディスクスペースは4GBになっていますが、残りのスペースを満たしてしまいますね。以下は、このプロビジョニング構成がディスク構造を作成する方法を示すスクリーンショットです。

NAME            MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda               8:0    0   79G  0 disk
|-sda1            8:1    0  976M  0 part  /boot
|-sda2            8:2    0    1K  0 part
`-sda5            8:5    0   78G  0 part
  `-sda5_crypt  254:0    0   78G  0 crypt
    |-box1-root 254:1    0 14.3G  0 lvm   /
    |-box1-tmp  254:2    0  1.9G  0 lvm   /tmp
    `-box1-swap 254:3    0 61.8G  0 lvm   [SWAP]

その理由は何ですか?私のパーティションプロファイルに問題がありますか?

私のパーティショニング方法は次のとおりです。

TOTAL SPACE is 80 GB

partition: /boot 1GB | FILE SYSTEM: ext4 | bootable flag: on | no need to encrypt


# This is LVM container encryption called box1:

partition: /root (/) 15 GB | FILE SYSTEM: ext4

partition: /tmp 2GB | FILE SYSTEM: ext4 | mount with: nosuid, noexec

partition: swap 4GB

partition: /home 60GB (or the rest space left) | FILE SYSTEM: ext4| mount with: nosuid

ベストアンサー1

動作しています!まず@casが述べたように、ホームディレクトリのサイズを宣言するときに間違えて誤ってディスク全体のサイズを使用しました。しかし、ここで最大の問題は、ホームディレクトリの作成を妨げる構文エラーです。驚いたことに、debconf-set-selections-cオプションを使用する構文チェッカーは、プロファイル内のこのエラーについて文句を言いませんでした。私がしたことは、欠けている点を入れることです(\記号を除く)。

.

この行の次:

      $lvmok{ } lv_name{ home } \
      in_vg { box1 } \
      method{ format } format{ } \
      use_filesystem{ } filesystem{ ext4 } \
      mountpoint{ /home } \
      options/nosuid{ nosuid } \

したがって、次のようになります。

      $lvmok{ } lv_name{ home } \
      in_vg { box1 } \
      method{ format } format{ } \
      use_filesystem{ } filesystem{ ext4 } \
      mountpoint{ /home } \
      options/nosuid{ nosuid } \
      .

おすすめ記事