@@ -, +, @@ --- auto-raidcfg | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) --- a/auto-raidcfg +++ a/auto-raidcfg @@ -21,12 +21,9 @@ create_raid() { FS_TYPE="$4" MOUNTPOINT="$5" - DEVICES="$6" - SPARE_DEVICES="$7" - - RAID_DEVICES=$(echo $DEVICES | sed -e "s/#/ /g") - - SPARE_DEVICES=$(echo $SPARE_DEVICES | sed -e "s/#/ /g") + RAID_DEVICES=$(echo $6 | sed -e "s/#/ /g") + SPARE_DEVICES=$(echo $7 | sed -e "s/#/ /g") + EXTRA_ARGS=$(echo $8 | sed -e "s/#/ /g") NAMED_SPARES=$(echo $SPARE_DEVICES | wc -w) @@ -76,7 +73,7 @@ create_raid() { if ! log-output -t partman-auto-raid \ mdadm --create /dev/md$MD_NUM --auto=yes --force -R -l raid$RAID_TYPE \ - -n $DEV_COUNT $MDADM_PARAMS + -n $DEV_COUNT $MDADM_PARAMS $EXTRA_ARGS then logger -t partman-auto-raid "Error creating array /dev/md$MD_NUM" exit 1 @@ -119,10 +116,10 @@ while [ -n "$recipes" ]; do # Do the recipe! echo $recipe >/tmp/partman-auto-raid-recipe - read raidtype devcount sparecount fstype mountpoint devs sparedevs \ + read raidtype devcount sparecount fstype mountpoint devs sparedevs args \ + where is a list of the devices to make up the RAID and is a list of the spare devices in the array; devices are separated by hashes ("#"). + can be used to pass extra arguments to "mdadm --create", like "--layout o2". +Blanks must be substituted by hashes ("#"), e.g. you have to specify "--layout#o2". + For example: d-i partman-auto-raid recipe string \ 1 2 0 ext3 / /dev/sda1#/dev/sdb1 . \ --