View | Details | Raw Unified | Return to bug 38830 | Differences between
and this patch

Collapse All | Expand All

(-)a/auto-raidcfg (-11 / +6 lines)
 Lines 21-32   create_raid() { Link Here 
21
21
22
	FS_TYPE="$4"
22
	FS_TYPE="$4"
23
	MOUNTPOINT="$5"
23
	MOUNTPOINT="$5"
24
	DEVICES="$6"
24
	RAID_DEVICES=$(echo $6 | sed -e "s/#/ /g")
25
	SPARE_DEVICES="$7"
25
	SPARE_DEVICES=$(echo $7 | sed -e "s/#/ /g")
26
26
	EXTRA_ARGS=$(echo $8 | sed -e "s/#/ /g")
27
	RAID_DEVICES=$(echo $DEVICES | sed -e "s/#/ /g")
28
29
	SPARE_DEVICES=$(echo $SPARE_DEVICES | sed -e "s/#/ /g")
30
27
31
	NAMED_SPARES=$(echo $SPARE_DEVICES | wc -w)
28
	NAMED_SPARES=$(echo $SPARE_DEVICES | wc -w)
32
29
 Lines 76-82   create_raid() { Link Here 
76
73
77
	if ! log-output -t partman-auto-raid \
74
	if ! log-output -t partman-auto-raid \
78
		mdadm --create /dev/md$MD_NUM --auto=yes --force -R -l raid$RAID_TYPE \
75
		mdadm --create /dev/md$MD_NUM --auto=yes --force -R -l raid$RAID_TYPE \
79
		      -n $DEV_COUNT $MDADM_PARAMS
76
		      -n $DEV_COUNT $MDADM_PARAMS $EXTRA_ARGS
80
	then
77
	then
81
		logger -t partman-auto-raid "Error creating array /dev/md$MD_NUM"
78
		logger -t partman-auto-raid "Error creating array /dev/md$MD_NUM"
82
		exit 1
79
		exit 1
 Lines 119-128   while [ -n "$recipes" ]; do Link Here 
119
116
120
	# Do the recipe!
117
	# Do the recipe!
121
	echo $recipe >/tmp/partman-auto-raid-recipe
118
	echo $recipe >/tmp/partman-auto-raid-recipe
122
	read raidtype devcount sparecount fstype mountpoint devs sparedevs \
119
	read raidtype devcount sparecount fstype mountpoint devs sparedevs args \
123
		</tmp/partman-auto-raid-recipe
120
		</tmp/partman-auto-raid-recipe
124
	create_raid $raidtype $devcount $sparecount $fstype $mountpoint \
121
	create_raid $raidtype $devcount $sparecount $fstype $mountpoint \
125
		$devs $sparedevs
122
		$devs $sparedevs $args
126
done
123
done
127
124
128
exit 0
125
exit 0
129
- 
130
--
131
doc/devel/partman-auto-raid-recipe.txt | 5 ++++-
126
doc/devel/partman-auto-raid-recipe.txt | 5 ++++-
132
1 file changed, 4 insertions(+), 1 deletion(-)
127
1 file changed, 4 insertions(+), 1 deletion(-)
(-)a/doc/devel/partman-auto-raid-recipe.txt (-2 / +4 lines)
 Lines 5-16   it how to construct the RAID array(s). Link Here 
5
The preseedable parameter partman-auto-raid/recipe should consist of
5
The preseedable parameter partman-auto-raid/recipe should consist of
6
recipes separated by periods ("."). The recipes are of the form:
6
recipes separated by periods ("."). The recipes are of the form:
7
7
8
<raidtype> <devcount> <sparecount> <fstype> <mountpoint> <devices> <sparedevices>
8
<raidtype> <devcount> <sparecount> <fstype> <mountpoint> <devices> <sparedevices> <extra-args>
9
9
10
where <devices> is a list of the devices to make up the RAID and
10
where <devices> is a list of the devices to make up the RAID and
11
<sparedevices> is a list of the spare devices in the array; devices are
11
<sparedevices> is a list of the spare devices in the array; devices are
12
separated by hashes ("#").
12
separated by hashes ("#").
13
13
14
<extra-args> can be used to pass extra arguments to "mdadm --create", like "--layout o2".
15
Blanks must be substituted by hashes ("#"), e.g. you have to specify "--layout#o2".
16
14
For example:
17
For example:
15
d-i partman-auto-raid recipe string  \
18
d-i partman-auto-raid recipe string  \
16
  1 2 0 ext3 / /dev/sda1#/dev/sdb1 . \
19
  1 2 0 ext3 / /dev/sda1#/dev/sdb1 . \
17
- 

Return to bug 38830