Debian 6 Preseed LVM Automation: Bypassing “Write Changes to Disks” Prompt in Unattended Installations


2 views

When automating Debian 6 (Squeeze) installations using preseed, many admins encounter an unexpected interruption - the system still prompts for confirmation before writing LVM changes, despite having all apparent preseed configurations in place. This breaks the fully automated installation flow we expect from preseeding.

The core of the issue lies in how Debian 6's partman handles LVM confirmations. While newer Debian versions have refined this behavior, Squeeze requires some specific workarounds:

# Crucial additions for Debian 6 LVM automation:
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/confirm boolean true
d-i partman/confirm_write_changes_to_disks_and_configure_lvm boolean true

Here's a complete tested configuration that successfully bypasses all prompts:

# Disk selection
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-auto/purge_lvm_from_device boolean true

# LVM specific settings
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-auto-lvm/guided_size string max

# Partitioning confirmation overrides
d-i partman/confirm_write_new_label boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman/confirm_write_changes_to_disks_and_configure_lvm boolean true

# Expert recipe with LVM support
d-i partman-auto/expert_recipe string \\
  boot-root :: \\
    128 50 128 ext2 \\
      $primary{ } $bootable{ } \\
      method{ format } format{ } \\
      use_filesystem{ } filesystem{ ext2 } \\
      mountpoint{ /boot } \\
    . \\
    10000 50 10000 ext4 \\
      $defaultignore{ } \\
      $lvmok{ } \\
      lv_name{ root } \\
      method{ format } format{ } \\
      use_filesystem{ } filesystem{ ext4 } \\
      mountpoint{ / } \\
    .

1. The confirm_write_changes_to_disks_and_configure_lvm parameter must appear AFTER the partitioning recipe
2. LVM volume group sizing (guided_size) needs explicit configuration
3. All confirmation-related parameters should be set to true
4. For Debian 6 specifically, the device removal confirmations need handling

If prompts persist, check these diagnostic steps:

  • Verify preseed file loading in installer logs (/var/log/syslog)
  • Test preseed syntax using debconf-get-selections
  • Ensure no typos in long parameter names
  • Check for conflicting preseed values that might override your settings

When automating Debian 6 (Squeeze) installations using preseed, many administrators encounter an unexpected interruption during disk partitioning. Despite properly configured preseed directives, the installer still asks: "Write the changes to disks and configure LVM?" This disrupts the fully automated installation flow we expect from preseeding.

The issue stems from Debian 6's partman implementation handling LVM confirmation separately from regular partition confirmation. While we've correctly set partman/confirm boolean true, we need additional specific LVM-related settings.

# Key settings often missing:
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max

Here's the full configuration that properly silences all LVM prompts:

# Disk selection
d-i partman-auto/disk string /dev/sda

# LVM configuration
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string vg00

# Confirmation silencing
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/confirm_write_changes_to_disks_and_configure_lvm boolean true

# Expert recipe (same as original post)
d-i partman-auto/expert_recipe string \
  boot-root :: \
    128 50 128 ext2 \
      $primary{ } $bootable{ } \
      method{ format } format{ } \
      use_filesystem{ } filesystem{ ext2 } \
      mountpoint{ /boot } \
    . \
    10000 50 10000 ext4 \
      $defaultignore{ } \
      $lvmok{ } \
      lv_name{ root } \
      method{ format } \
      format{ } \
      use_filesystem{ } \
      filesystem{ ext4 } \
      mountpoint{ / } \
    . \
    2048 90 2048 linux-swap \
      method{ swap } format{ } \
    . \
    10000 50 10000 ext4 \
      $defaultignore{ } \
      $lvmok{ } \
      lv_name{ var } \
      method{ format } \
      format{ } \
      use_filesystem{ } \
      filesystem{ ext4 } \
      mountpoint{ /var } \
    .

After implementing these changes, test your automated installation in a VM before deploying to production. Use the following command to validate your preseed file:

debconf-set-selections -c preseed.cfg

Pay special attention to the partitioning phase in your installation logs. You should see partman proceeding without interactive prompts.

If the prompt persists, consider using early_command to simulate keypresses:

d-i preseed/early_command string \
  echo "partman partman/confirm_write_new_label boolean true" | debconf-communicate; \
  echo "partman-lvm partman-lvm/confirm boolean true" | debconf-communicate