Preseeding Ubuntu 8.04.2 LTS With Software Raid

Since I’ve spent the better part of the weekend trying to get this work, I thought that I should share. Later I will post a more thorough description for preparing fully automated Ubuntu installations using preseeding, but for now, here’s the hard part.

If you’ve found this blog posting via google, then you’ve probably read all of the unhelpful forum posts, IRC chat transcripts (some of which I’m involved in), and mailing list posts about this. Yes, the documentation says that it is possible to setup Software Raid via preseeding, and even gives you some working preseed stanzas to do it. What the Documentation fails to admit,is that the package required to achieve this feat, partman-auto-raid, is not actually included with the Ubuntu netboot installer.

Never worry, for whenever you expect an elegant bit of pre-planned infrastructure to solve a problem, you end up with a dirty hack. This is no exception.

What you need to do is download partman-auto-raid_7_all.udeb from the Ubuntu Universe pool, and install it. The trick is to install it before the installer looks at your recipes. This is achieved with the partman/early_command hack:

d-i partman/early_command string 
/usr/bin/wget -O /tmp/raid.udeb 
  && udpkg -i /tmp/raid.udeb

With Great Thanks to Brent Chapman from Netomata , the complete and working preseed example including the ugly hacks required to partition software raid volumes are posted below. Note, there’s still one bug I haven’t ironed out yet which adds an annoying manual step. After the installer finishes partitioning, it will falsely complain about not being able to reread the partition table, with this error:

“The kernel was unable to re-read the partition table on /dev/md0 (Invalid argument).
 This means Linux won’t know anything about the modifications you made until you reboot.
 You should reboot your computer before doing anything with /dev/md0.”

If anybody knows how to suppress this error,  please let me know.  Below is the complete preseed file.

d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/choose_interface select auto
d-i netcfg/dhcp_timeout string 90
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/wireless_wep string
d-i mirror/protocol string http
d-i mirror/country string manual
d-i mirror/http/hostname string
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string http://proxy:3142
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server
d-i preseed/early_command string /usr/bin/wget -O && udpkg -i /tmp/raid.udeb
d-i partman-auto/disk string /dev/sda /dev/sdb
d-i partman-auto/method string raid
d-i partman-auto/expert_recipe string 
      multiraid ::                                         
              1000 5000 4000 raid                          
                      $primary{ } method{ raid }           
              64 512 3000% raid                             
                      method{ raid }                       
              500 10000 1000000000 raid                    
                      method{ raid }                       
d-i partman-auto-raid/recipe string 
    1 2 0 ext3 /                                           
    1 2 0 swap -                                           
    1 2 0 ext3 /home                                       
d-i partman-md/confirm boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/root-login boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password fakepass
d-i passwd/root-password-again password fakepass
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i apt-setup/multiverse boolean true
tasksel tasksel/first multiselect standard
d-i pkgsel/include string openssh-server build-essential puppet bridge-utils snmpd
d-i pkgsel/update-policy select none
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev  string (hd0,0) (hd1,0)
d-i finish-install/keep-consoles boolean true
d-i finish-install/reboot_in_progress note

5 thoughts on “Preseeding Ubuntu 8.04.2 LTS With Software Raid

  1. Hey, you have a syntax error I believe where you set the ntp server, afaik you need to declare it as a string before Beyond that, my config for raid is similar to yours, and gets the same parse error from debconf-set-selections -c . Are you positive this is your exact preseed? I first tried this months and months ago to no avail, and it’s really starting to kill me not having an automated provisioning setup.

  2. I came across this post I made months ago but figured I should say how I fixed it. One of the lines in the file contained only spaces. Which makes the debian-installer crap itself. So make sure you accidentally don’t have a line with only spaces in your preseed.

  3. Have you figured out how to suppress the extraneous partition warning yet? If so please do let me know I’m dying for this info.

  4. Hi! Joe. I find your post very useful for my work project. But now I have the same problem that you about the false warning message. Now in Ubuntu 8.04.4, did you found any way to preseed this complain?

    Thanks for your post and apologize my poor english!

  5. Hi again!
    Finally i have found a line that suppress that annoying message during installation. Tested in Ubuntu 8.04.4.

    partman-base partman/exception_handler_note note


Leave a Reply

Your email address will not be published. Required fields are marked *