5

I created a preseed script with help from this blog and I altered it to create some logical volumes on it too.

The result of the script is this:

d-i     debian-installer/locale string en_US.UTF-8
d-i     debian-installer/splash boolean false
d-i     debian-installer/language string en
d-i     debain-installer/country string 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/choose_interface select eth0
d-i     netcfg/get_nameservers  string 
d-i     netcfg/get_ipaddress    string 
d-i     netcfg/get_netmask      string 255.255.255.0
d-i     netcfg/get_gateway      string 
d-i     netcfg/confirm_static   boolean true
d-i     netcfg/get_hostname string myhost
d-i     mirror/country string manual
d-i     mirror/http/hostname string http.nl.debian.org
d-i     mirror/http/directory string /debian
d-i     mirror/http/proxy string
d-i     partman-auto/disk string /dev/sda /dev/sdb
d-i     partman-auto/method string raid
d-i     partman-lvm/device_remove_lvm boolean true
d-i     partman-md/device_remove_md boolean true
d-i     partman-lvm/confirm boolean true
d-i     partman-auto/choose_recipe select recipe_sps
d-i     partman-auto-lvm/new_vg_name string vg_sps
#d-i     partman-auto-lvm/guided_size string 30GB
d-i     partman-auto/expert_recipe string        \
           recipe_sps ::                         \
             512 30 512 raid                     \
                $lvmignore{ }                    \
                $primary{ } method{ raid }       \
             .                                   \
             1000 35 250000000 raid              \
                $lvmignore{ }                    \
                $primary{ } method{ raid }       \
             .                                   \
             5500 50 6000 ext4                   \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ root }                  \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ / }                  \
             .                                   \
             4000 50 4100 ext4                   \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ home }                  \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ /home }              \
             .                                   \
             4000 50 4100 ext4                   \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ varlog }                \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ /var/log }           \
             .                                   \
             60000000 50 250000000 ext4          \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ varvirtualbox }         \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ /var/virtualbox }    \
             .                                   

# 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 ext2 /boot                \
          /dev/sda1#/dev/sdb1       \
    .                               \
    1 2 0 lvm -                     \
          /dev/sda2#/dev/sdb2       \
.                               
d-i     mdadm/boot_degraded boolean false
d-i     partman-md/confirm boolean true
d-i     partman-partitioning/confirm_write_new_label boolean true
d-i     partman/choose_partition select Finish partitioning and write changes to disk
d-i     partman/confirm boolean true
d-i     partman-md/confirm_nooverwrite  boolean true
d-i     partman/confirm_nooverwrite boolean true
d-i     clock-setup/utc boolean true
d-i     clock-setup/ntp boolean true
d-i     time/zone string Europe/Amsterdam
d-i     base-installer/kernel/image     string linux-server
d-i     passwd/root-login       boolean true
d-i     passwd/root-password password r00tme
d-i     passwd/root-password-again password r00tme
d-i     passwd/make-user boolean false
d-i     user-setup/allow-password-weak  boolean false
d-i     user-setup/encrypt-home boolean false
d-i     passwd/user-default-groups      string adm cdrom dialout lpadmin plugdev sambashare
d-i     apt-setup/services-select       multiselect security, updates
d-i     apt-setup/security_host string security.debian.org
d-i     apt-setup/non-free boolean true
d-i     apt-setup/contrib boolean true
d-i     debian-installer/allow_unauthenticated  string false
d-i     pkgsel/upgrade  select safe-upgrade
d-i     pkgsel/language-packs   multiselect 
d-i     pkgsel/update-policy    select none
d-i     pkgsel/updatedb boolean true
tasksel tasksel/first multiselect standard, openssh-server


d-i grub-installer/grub2_instead_of_grub_legacy boolean true 
d-i grub-installer/only_debian boolean false 
d-i grub-installer/bootdev string /dev/sda /dev/sdb

d-i     finish-install/keep-consoles    boolean false
d-i     finish-install/reboot_in_progress       note 
d-i     cdrom-detect/eject      boolean true
d-i     debian-installer/exit/halt      boolean false
d-i     debian-installer/exit/poweroff  boolean false
d-i     pkgsel/include string vim openssh-server openvpn
popularity-contest popularity-contest/participate boolean false

Now I used the script, but when it's finished (without errors) there is only the boot, root and swap partitions:

root@debian:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-0       112G  854M  106G   1% /
udev             10M     0   10M   0% /dev
tmpfs           3.2G  8.6M  3.2G   1% /run
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/md0        472M   34M  414M   8% /boot

root@debian:~# lvs
  LV     VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   vg_sps -wi-ao---- 113.85g                                                    
  swap_1 vg_sps -wi-ao----   4.85g  

But in my expert-recipe I meant to create a /home /var/log and /var/virtualbox volume too.

  • Sorry, but this can't be migrated to Ask Ubuntu, it is not on topic there. Whoever suggested migration was wrong. I suggest you show us the script you used though since we can't point out mistakes in scripts we can't see. Please edit your question and include the script. – terdon Jan 26 '17 at 14:21
0

The first thing that I would change is the number of spaces between "string" and "recipe_sps".

According to this at 12.3.2.2: "the fourth and last field contains the value for the answer. Note that it must be separated from the third field with a single space; if there are more than one, the following space characters are considered part of the value."

If you luckily end up with a bootable system at this stage (thus with the failing recipe), check if /var/log/installer/cdebconf/questions.dat contains your recipe and whether it was chosen (probably not).

Added: Check your /var/log/installer/syslog for partman messages, mine was pretty clear: "partman-auto: Available disk space (8589) too small for expert recipe (67595); skipping"

|improve this answer|||||
  • Maybe a little late response, but the problem was at the same location you had. We tried to create a way to big partition on a not so big disk – Marco Sysadmin Jul 24 '17 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.