Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created January 7, 2020 03:36
Show Gist options
  • Save noslin005/ac7ec983a46d7fea25bc6b59cefc7981 to your computer and use it in GitHub Desktop.
Save noslin005/ac7ec983a46d7fea25bc6b59cefc7981 to your computer and use it in GitHub Desktop.
Debian RAID 1 Legacy Boot
# The method should be set to "raid".
d-i partman-auto/method string raid
# Specify the disks to be partitioned. They will all get the same layout,
# so this will only work if the disks are the same size.
d-i partman-auto/disk string /dev/sda /dev/sdb
# Next you need to specify the physical partitions that will be used.
d-i partman-auto/expert_recipe string \
scc-raid :: \
512 512 512 raid \
$primary{ } \
method{ raid } \
. \
51200 51200 51200 raid \
method{ raid } \
. \
8192 8192 8192 raid \
method{ raid } \
. \
51200 1000000000 -1 raid \
method{ raid } \
. \
# 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.
# Parameters are:
# <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \
# <devices> <sparedevices>
# RAID levels 0, 1, 5, 6 and 10 are supported; devices are separated using "#"
d-i partman-auto-raid/recipe string \
1 2 0 ext2 /boot \
/dev/sda1#/dev/sdb1 \
. \
1 2 0 ext4 / \
/dev/sda2#/dev/sdb2 \
. \
1 2 0 swap - \
/dev/sda3#/dev/sdb3 \
. \
1 2 0 ext4 /home \
/dev/sda4#/dev/sdb4 \
.
# This makes partman automatically partition without confirmation.
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment