linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* announce: tiny raidtools-alike for use e.g. in initrd
@ 2003-10-30  7:25 Michael Tokarev
  2003-10-31  8:43 ` Luca Berra
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2003-10-30  7:25 UTC (permalink / raw)
  To: linux-raid

http://www.corpit.ru/mjt/mdctl.c - a very small utility similar
to raidtools suite.  I wrote this program to use it inside an
initrd to bring raid arrays up at boot time - where the size of
executable and simplicity is at premium.  Differences between this
implementation and raidtools are:

  - size.  When compiled with dietlibc, executable is about
    7kb on i386.

  - it does not have mkraid utility and other fun stuff.
    Supported are
    - raidstart
    - raidstop
    - raidhot{add,remove,generateerror)
    - raidsetfaulty
   i.e., only "simple" commands - just ioctls in fact.

  - it uses NO config file like all the raidtools suite.
    I.e., it is more like mdadm in this respect.  All
    parameters are accepted in the command line.  This
    makes the utility handy inside read-only boot-time
    environment (you may e.g. parse md=... kernel
    parameter and convert it into mdctl commandline)

  - `mdctl start' tries to bring an array using ALL components
    of the array given in the command line, until successeful
    (raidstart tries only first component, and if that is missing
    but other component(s) are available, operation will fail).

Usage:

  mdctl start /dev/mdN /dev/hda1 /dev/hdb1 /dev/hdc1
    equivalent to md=N,/dev/hda1,/dev/hdb1,/dev/hdc1 boot
    parameter, but you can't specify raid level (it will
    be read from the superblock), and kernel may choose to
    bring up another mdN (as indicated by super-minor)

  mdctl {stop,readonly,ro,readwrite,rw} /dev/mdN

  mdctl {add,remove,setfaulty,generaterror} /dev/mdN /dev/hda1

This tiny code released under GPL licence... in a hope it will
be useful to someone else too, not only to me ;)

Enjoy.

/mjt


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-31  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-30  7:25 announce: tiny raidtools-alike for use e.g. in initrd Michael Tokarev
2003-10-31  8:43 ` Luca Berra
2003-10-31  9:16   ` Luca Berra

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).