7

I am trying to set up a preseed install (Ubuntu 12.04.03 64-bit) with the following partitioning recipe, but it's just not working and I'm not sure why.

Please, Obi-Wan, you're my only hope.

The -1 in the sizes were originally 1000000000 so I tried changing to -1 but it made no difference.

d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/purge_lvm_from_device  boolean true

d-i partman-auto/disk string /dev/sda /dev/sdb
d-i partman-auto/method string raid

d-i partman-auto-lvm/new_vg_name string vg_sys
d-i partman-auto-lvm/guided_size string max

d-i partman-auto/choose_recipe select raid-lvm
d-i partman-auto/expert_recipe string                      \
      raid-lvm ::                                          \
        512 10 512 raid                                    \
          $primary{ } $lvmignore{ } $bootable{ }           \
          method{ raid }                                   \
        .                                                  \
        8192 20 -1 raid                                    \
          $primary{ } $lvmignore{ }                        \
          method{ raid }                                   \
        .                                                  \
        1024 100 1024 ext4                                 \
          $defaultignore $lvmok{ } lv_name{ root }         \
          method{ format } format{ }                       \
          use_filesystem{ } filesystem{ ext4 }             \
          mountpoint{ / }                                  \
        .                                                  \
        4096 100 4096 linux-swap                           \
          $defaultignore $lvmok{ } lv_name{ swap }         \
          method{ swap } format{ }                         \
        .                                                  \
        1024 100 2048 ext4                                 \
          $defaultignore $lvmok{ } lv_name{ tmp }          \
          method{ format } format{ }                       \
          use_filesystem{ } filesystem{ ext4 }             \
          mountpoint{ /tmp }                               \
        .                                                  \
        4096 100 8192 ext4                                 \
          $defaultignore $lvmok{ } lv_name{ var }          \
          method{ format } format{ }                       \
          use_filesystem{ } filesystem{ ext4 }             \
          mountpoint{ /var }                               \
        .                                                  \
        2048 100 4096 ext4                                 \
          $defaultignore $lvmok{ } lv_name{ usr }          \
          method{ format } format{ }                       \
          use_filesystem{ } filesystem{ ext4 }             \
          mountpoint{ /usr }                               \
        .                                                  \
        2048 110 16384 ext4                                \
          $defaultignore $lvmok{ } lv_name{ home }         \
          method{ format } format{ }                       \
          use_filesystem{ } filesystem{ ext4 }             \
          mountpoint{ /home }                              \
        .                                                  \
        512 1000 -1 ext4                                   \
          $defaultignore $lvmok{ } lv_name{ deleteme }     \
          method{ lvm }                                    \
        .

d-i partman-auto-raid/recipe string                              \
    1 2 0 ext4 /boot  /dev/sda1#/dev/sdb1                    .   \
    1 2 0 lvm  -      /dev/sda2#/dev/sdb2                    .

# the 'deleteme' LV soaks up the leftover space in the VG
d-i preseed/late_command string in-target lvremove -f vg_sys/deleteme

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
d-i partman-lvm/confirm boolean true
d-i partman-md/confirm boolean true
d-i partman-md/confirm_nooverwrite  boolean true

d-i partman/mount_style select label

d-i mdadm/boot_degraded boolean false

Here's the error I'm getting:

image of irritating failure

The disks are dual 50GiB (to be precise, 53,687,091,200 bytes).

MikeyB
  • 38,725
  • 10
  • 102
  • 186

4 Answers4

7

I think your mistake is here:

d-i partman-auto/choose_recipe select raid-lvm
d-i partman-auto/expert_recipe string                      \
      raid-lvm ::                                          \

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.

Your config file should be then

d-i partman-auto/expert_recipe string                      \
      multiraid ::                                         \

my conclusions came from reading this and this.

Mauricio López
  • 944
  • 4
  • 9
  • Whale oil beef hooked! 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. – MikeyB Oct 03 '13 at 01:13
  • 1
    BTW the first entry (`raid-lvm` or `multiraid`) is just the name of the recipe. – MikeyB Oct 03 '13 at 01:14
2

I ended up here because I was getting the exact same errors:

Error: No recipe specified in partman-auto-raid/recipe

Along with:

Available disk space (XXX) too small for expert recipe (2200008705)

Here is the relevant bit of my BAD preseed file:

d-i partman-auto/method string raid
d-i partman-auto/disk string /dev/sda /dev/sdb

d-i partman-auto/expert_recipe string                        \
     multiraid ::                                            \
              1 1 1 free                                     \
                      $gptonly{ }                            \
                      $primary{ }                            \
                      $bios_boot{ }                          \
                      method{ biosgrub }                     \
              .                                              \
              4096 1000 4096 linux-swap                      \
                      $gptonly{ }                            \
                      $primary{ }                            \
                      method{ swap } format{ }               \
              .                                              \
              141101 1000 141901 raid                        \
                      $gptonly{ }                            \
                      $primary{ }                            \
                      method{ raid } format{ }               \
              .                                              \
              1 2000 -1 ext4                                 \
                      $gptonly{ }                            \
                      $primary{ }                            \
                      method{ format } format{ }             \
                      use_filesystem{ } filesystem{ ext4 }   \
              .                                              \                                
# Last you need to specify how the previously defined partitions will be
# used in the RAID setup. Remember to use the correct partition numbers
# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported;
# devices are separated using "#".
# Parameters are:
# <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \
#          <devices> <sparedevices>

d-i partman-auto-raid/recipe string 1 2 0 ext4 / /dev/sda2#/dev/sdb2 .

The problem, annoyingly enough was that I left a trailing backslash on the end of the last line of the expert recipe. It should have been this:

              1 2000 -1 ext4                                 \
                      $gptonly{ }                            \
                      $primary{ }                            \
                      method{ format } format{ }             \
                      use_filesystem{ } filesystem{ ext4 }   \
              .                                                                              

Hope this helps somebody!

Bacon
  • 121
  • 3
1

You don't mention if you're using a 32- or 64-bit distribution here, but I thought that number reported in your error is pretty weird, "2200008705". Where would that come from? Well, take that number and subtract the largest value for a 32-bit unsigned int (2147483647), and you get 52,525,058, which looks an awful lot like the exact size of your 50GB disks, no?

Looking at section 5 of partman-auto-recipe.txt, which is about using very large sizes for whatever partition you want to fill all free space, it says:

Do not use higher than 1000000000 numbers because the shell arithmetic
is limited to 31 bits (on i386).

In your question, you said that before you set the values to -1, they were set to 10000000000, which is one place/zero too many when compared to their suggestion for a max value. Perhaps you overflowed a value somewhere, and that's why your recipe didn't initially work before you changed it to -1?

Mark R
  • 334
  • 2
  • 4
  • I had taken note of the '1000000000' limit and used it in my recipes, yes. To be clear, it still doesn't work *after* changing it to -1. – MikeyB Sep 26 '13 at 14:04
  • Confirmed - the number 10,000,000,000 was only used in my question - I correctly had 1,000,000,000 in the preseed file. – MikeyB Sep 26 '13 at 14:16
  • I really wish I had something further to put out there for you, but at this point I don't... it's read-only Friday though, so maybe I can get some time to copy your preseed and mess with it. I'm curious now because I don't notice anything that looks obviously wrong. – Mark R Sep 27 '13 at 14:47
  • MikeyB, is "method{ lvm }" valid? I can't find it in any of the documentation, but that's on your last entry in the recipe. I have an install running now with riad and lvm, but I had to specify this for my final lvm throwaway volume: 100 100 1000000000 ext4 \ $defaultignore{ } \ $lvmok{ } \ $lv_name{ deleteme } \ method{ keep } \ . d-i partman-basicmethods/method_only boolean false – Mark R Sep 27 '13 at 17:42
  • I really hate the lack of formatting in comments and the "help" link is less than helpful, obviously I failed to format that correctly above. The recipe part is easy enough to follow thanks to the backslashes, but then the "d-i partman-basicmethods/method_only boolean false" is set on its own line. Without it, the installer will stop to complain that your throwaway lvm volume isn't being used anywhere. – Mark R Sep 27 '13 at 17:48
  • I'm using the exact same LVM recipe minus the raid elsewhere - `method{ lvm }` is just fine. – MikeyB Sep 27 '13 at 21:17
  • Well, I don't know that this is going to help you or not, but I grabbed the 12.04.3 ISO and tried your recipe, copy-pasted into a preseed, with a VM that had two 20GB disks. It worked perfectly exactly as you have it written up there. – Mark R Sep 30 '13 at 14:06
-1

Well it semms that the first error you have is that your RAID is not configured properly as I can read : "No arrays found in config file"

I guess something's wrong in your raid configuration.

Maybe you can take example on that thread : http://ubuntuforums.org/showthread.php?t=1879350

Pierre-Alain TORET
  • 1,244
  • 7
  • 14
  • 1
    The linked example does not address an LVM configuration and the RAID configuration is not substantially different from what I have. – MikeyB Sep 26 '13 at 14:28