Re: programmatic API?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 25 Feb 2010 03:54:44 -0500
bardov@xxxxxxxxx wrote:

> I'd like to create/manage raid arrays from a program.
> Is there an API, or a library I can link with? 
> Or is my only option using system("mdadm ..."); ?
> 
>

You can do almost anything by reading/writing files
in /sys/class/block/mdX/md/
Some details are in Documentation/md.txt
For the few things that you cannot do through sysfs, you would use an IOCTL.

But I suspect that fork/exec("/sbin/mdadm" ....)
would be your best bet, though it depends on exactly what you want to do.

There is no library, but there a plenty if bits of code in the mdadm source
that you might want to borrow if your program will be GPL.

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux