md_create
Description:
public bool md_create (string name, string[] devices, MDCreate? optargs) throws Error
create a Linux md (RAID) device
Create a Linux md (RAID) device named name
on the devices in the list devices
.
The optional parameters are:
missingbitmap
A bitmap of missing devices. If a bit is set it means that a missing device is added to the array. The least
significant bit corresponds to the first device in the array.
As examples:
If "devices = ["/dev/sda"]" and "missingbitmap = 0x1" then the resulting array would be "[<missing>, "/dev/sda"]".
If "devices = ["/dev/sda"]" and "missingbitmap = 0x2" then the resulting array would be "["/dev/sda", <missing>]".
This defaults to @0 (no missing devices).
The length of devices
+ the number of bits set in missingbitmap
must equal nrdevices
+ spare
.
nrdevices
The number of active RAID devices.
If not set, this defaults to the length of devices
plus the number of bits set in missingbitmap
.
spare
The number of spare devices.
If not set, this defaults to @0.
chunk
The chunk size in bytes.
level
The RAID level, which can be one of: *linear*, *raid0*, *0*, *stripe*, *raid1*, *1*, *mirror*, *raid4*, *4*, *raid5*, *5*,
*raid6*, *6*, *raid10*, *10*. Some of these are synonymous, and more levels may be added in future.
If not set, this defaults to raid1
.
This function depends on the feature "mdadm". See also feature_available.
Parameters:
this |
A GuestfsSession object |
devices |
an array of strings |
optargs |
a GuestfsMDCreate containing optional arguments |
Returns:
true on success, false on error |