How can partman partition more than one disk in a Debian installer preseed file?

7,393

I haven't tried this on squeeze, but what I did for etch should still work. Untested:

d-i preseed/late_command string echo ';' | sfdisk /dev/xvdb ; mkswap /dev/xvdb1 ;
    echo '/dev/sdb1 none swap sw 0 0' >> /target/etc/fstab ;
    echo ';' | sfdisk /dev/xvdb ; mke2fs -j -q /dev/xvdb1 ;
    mkdir /target/var/build ;
    echo '/dev/xvdb1 /var/build ext3 defaults 0 2' >> /target/etc/fstab

I'd have to dig up the reference where I found that sfdisk trick -- it basically wipes out the disk's partition table and makes one giant partition.

Share:
7,393

Related videos on Youtube

Peter Westlake
Author by

Peter Westlake

Updated on September 18, 2022

Comments

  • Peter Westlake
    Peter Westlake over 1 year

    Making partman partition a single disk is easy enough:

    d-i partman-auto/disk string /dev/xvda
    d-i partman-auto/method string regular
    d-i partman-auto/expert_recipe string \
          boot-swap :: \
            2048 2048 -1 ext3 \
               $primary{ } \
               $bootable{ } \
               method{ format } \
               format{ } \
               use_filesystem{ } \
               filesystem{ ext3 } \
               mountpoint{ / } \
               device{ /dev/xvda } \
               . \
    

    Or the even simpler:

    d-i partman-auto/disk string xvda
    d-i partman-auto/method string regular
    d-i partman-auto/choose_recipe select atomic
    

    But with more than one disk, none of the recipes I've found or written work. The installer gets to the screen where it asks for the partitioning method, and stalls there. I thought I had answered that question here:

    # The presently available methods are:
    # - regular: use the usual partition types for your architecture
    # - lvm:     use LVM to partition the disk
    # - crypto:  use LVM within an encrypted partition
    d-i partman-auto/method string regular
    

    Even if that does answer the question and it's actually stuck on the next bit, choosing a disk, isn't that answered by this?

    d-i partman-auto/disk string /dev/xvda
    

    I aim to end up with three disks: root on /dev/xvda, including /home, /usr and the rest; an extra swap volume on /dev/xvdb; and an EXT3 volume on /dev/xvdc, mounted on /var/build. Just to make things extra complicated, /var/build doesn't exist at installation time, so it needs making somehow too. This is on Debian Squeeze.

  • Peter Westlake
    Peter Westlake almost 13 years
    +1 for this being a useful recipe (thank you!), but it doesn't solve the problem of the installer being confused by the mere existence of more than one disk. I've added details to the question.
  • Mike Renfro
    Mike Renfro almost 13 years
    I don't think I ever had a problem with it failing when more than one disk was present -- just that it wouldn't do anything to the other disks by default. Assuming that the preseed format hasn't changed for squeeze, see if my partman settings on the linked page work or not. All you should have to do is change the device names. If mine works, then there's a subtle error in your preseed file, and not with the installer.
  • Peter Westlake
    Peter Westlake almost 13 years
    You're right - it was a subtle error! Well, not very subtle at all, really, and not in the least edifying: I was editing the wrong file. How much reputation do I lose for that, I wonder?
  • Peter Westlake
    Peter Westlake almost 13 years
    Using preseed/late_command is the only way to do it. The documentation (/usr/share/doc/debian-installer/devel/partman-auto-recipe.t‌​xt.gz) appears to suggest that multiple disks can be configured, but that's only for setting up LVM.