int hw_setup_raid(struct hw_destination* dest) {
char* cmd = NULL;
+ int r;
assert(dest->is_raid);
- asprintf(&cmd, "echo \"y\" | /sbin/mdadm --create --verbose --metadata=1.2 %s", dest->path);
+ asprintf(&cmd, "echo \"y\" | /sbin/mdadm --create --verbose --metadata=%s --auto=mdp %s",
+ RAID_METADATA, dest->path);
switch (dest->raid_level) {
case 1:
return r;
}
- int r = mysystem(cmd);
+ r = mysystem(cmd);
free(cmd);
// Wait a moment until the device has been properly brought up
#define HW_FS_DEFAULT HW_FS_EXT4
+#define RAID_METADATA "1.0"
+
#define BYTES2MB(x) ((x) / 1024 / 1024)
#define MB2BYTES(x) ((unsigned long long)(x) * 1024 * 1024)