From 765be2a20f2f7f76a519539e7508eebaced30c06 Mon Sep 17 00:00:00 2001 Message-Id: <765be2a20f2f7f76a519539e7508eebaced30c06.1436447235.git.hahn@univention.de> From: Philipp Hahn Date: Thu, 9 Jul 2015 15:06:22 +0200 Subject: [PATCH] Support additional arguments to mdadm Organization: Univention GmbH, Bremen, Germany Needed for "--layout o2". Spaces must be substituted by '#'. --- auto-raidcfg | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/auto-raidcfg b/auto-raidcfg index 01722c1..f0d4643 100755 --- a/auto-raidcfg +++ b/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 \ From: Philipp Hahn Date: Thu, 9 Jul 2015 15:12:13 +0200 Subject: [PATCH] Support additional arguments to mdadm Organization: Univention GmbH, Bremen, Germany Needed for "--layout o2". Spaces must be substituted by '#'. --- doc/devel/partman-auto-raid-recipe.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/devel/partman-auto-raid-recipe.txt b/doc/devel/partman-auto-raid-recipe.txt index daa7727..87d0fd1 100644 --- a/doc/devel/partman-auto-raid-recipe.txt +++ b/doc/devel/partman-auto-raid-recipe.txt @@ -5,12 +5,15 @@ it how to construct the RAID array(s). The preseedable parameter partman-auto-raid/recipe should consist of recipes separated by periods ("."). The recipes are of the form: - + 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 . \ -- 1.9.1