How do I preseed/partman/recipe two disks

I'm essentially trying to put /usr/local/ on /dev/sdb, and the normal boot/root/swap on sda. To complicate things, I've had to use GPT since the disk is >6TB. Seems no matter what I try, the SDB drive is never used. Here's my current attempt:

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-partitioning/choose_label select gpt
d-i partman-auto/disk string /dev/sda /dev/sdb
d-i partman-auto/expert_recipe string                         \
      boot-root-datab ::                                         \
              1 1 1 free                      \
                      $primary{ }                             \
                      method{ biosgrub }                            \
                      $iflabel{ gpt }                               \
                      device { /dev/sda }                            \
               .                                                \
              300 300 300 ext4                                 \
                      $primary{ }                             \
                      $bootable{ }                            \
                      method{ format } format{ }     \
                      $iflabel{ gpt }                               \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /boot }                     \
                      device { /dev/sda }                            \
              .                                               \
              40000 10000 -1 ext4                          \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      $iflabel{ gpt }                               \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
                      device { /dev/sda }                            \
              .                                               \
          4000 1500 12% linux-swap                        \
                      $primary{ }                             \
                      method{ swap } format{ }                \
                      $iflabel{ gpt }                               \
                      device { /dev/sda }                            \
              .                                               \
              200000 200000 -1 ext4                               \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      $iflabel{ gpt }                               \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /usr/local }                    \
                      options/noatime{ noatime } options/nodelalloc{ nodelalloc } options/nodiratime{ nodiratime } \
                      device { /dev/sdb }                            \
              . 
d-i partman-auto/choose_recipe select boot-root-datab

Any suggestions on what could possibly make this work? It seems partman ignores the device { /dev/sdb } altogether, and then of course screws up the sda layout to the point that / doesn't have enough space to install the kernel. Also, is there a bible for partman somewhere? Something that actually illustrates every single command/example/explanation would be, well, golden...


Solution 1:

Currently, most folks seem to achieve the partitioning of additional drives using the preseed/late_command functionality:

d-i preseed/late_command string \
  in-target echo -e "o\nn\np\n1\n\n\nw" | fdisk /dev/sdb1 ; \
  in-target mkfs.ext4 /dev/sdb1 ; \
  in-target echo "/dev/sdb1  /srv  ext4  nodiratime  0  2" >> /etc/fstab

Of course, this is suboptimal, and I would much prefer writing partman recipes that actually work for multiple block devices without RAID/LVM.

I wish I was totally wrong and someone would correct me with an example that works...

Solution 2:

According to this thread: https://serverfault.com/questions/541117/12-04-preseeded-install-with-raid-and-lvm

You should remove the last line:

d-i partman-auto/choose_recipe select boot-root-datab

Quoted Text:

You use partman-auto/choose_recipe when you are going to use a factory predefined recipe. If you are not, then make your own recipe using partman-auto/expert_recipe,specifying multiraid, not raid-lvm.

OP: The only change I needed to make was removing my partman-auto/choose_recipe line. After that, the installer used my custom recipe without issue.