From: Neil Brown <neilb@suse.de>
To: bardov@gmail.com
Cc: linux-raid@vger.kernel.org
Subject: Re: programmatic API?
Date: Thu, 25 Feb 2010 21:46:12 +1100 [thread overview]
Message-ID: <20100225214612.1e5f8de5@notabene.brown> (raw)
In-Reply-To: <27127259.41267088084737.JavaMail.root@wombat>
On Thu, 25 Feb 2010 03:54:44 -0500
bardov@gmail.com 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
prev parent reply other threads:[~2010-02-25 10:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 8:54 programmatic API? bardov
2010-02-25 10:46 ` Neil Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100225214612.1e5f8de5@notabene.brown \
--to=neilb@suse.de \
--cc=bardov@gmail.com \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).