summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-10-04 08:34:21 +0200
committerNeilBrown <neilb@suse.de>2012-10-04 08:34:21 +0200
commit72ca9bcff34d705fde5670a76cee7b85c0033c94 (patch)
treec28be0cf6410e2908e247f9b5b597cc04ac6e09d /mdadm.c
parentGrow/raid10: support reducing the devices in a RAID10. (diff)
downloadmdadm-72ca9bcff34d705fde5670a76cee7b85c0033c94.tar.xz
mdadm-72ca9bcff34d705fde5670a76cee7b85c0033c94.zip
Allow data-offset to be specified per-device for create
mdadm --create /dev/md0 .... /dev/sda1:1024 /dev/sdb1:2048 ... The size is in K unless a suffix: K M G is given. The suffix 's' means sectors. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index 5f395714..42544f1a 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -465,7 +465,11 @@ int main(int argc, char *argv[])
"Second value is %s.\n", optarg);
exit(2);
}
- data_offset = parse_size(optarg);
+ if (mode == CREATE &&
+ strcmp(optarg, "variable") == 0)
+ data_offset = VARIABLE_OFFSET;
+ else
+ data_offset = parse_size(optarg);
if (data_offset == INVALID_SECTORS) {
fprintf(stderr, Name ": invalid data-offset: %s\n",
optarg);