Re: Howto use or readings for mdctl.conf

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

 



On Friday March 1, mooasun@yahoo.com wrote:
> 
> Hello!
>  
> Where could I get some information on "mdctl.conf"?
> How to create and manage this file?
> Is it used by mdctl?
> Could it be a replacement for raidtab?
>  
> Thanks,
>  

Here is a copy of the man page for mdctl which has been updated a bit,
and contains some information on how mdctl.conf is used.

I hope to release mdctl-0.6 sometime next week which will include this
man page and an improved mdctl.

Hopefully this will answer your questions.

NeilBrown

.\" -*- nroff -*-
.TH mdctl 8
.SH NAME
mdctl \- a single program that can be used to control Linux md devices
.SH SYNOPSIS

.BI mdctl " [mode] <raiddevice> [options]"

.SH DESCRIPTION 
RAID devices are virtual devices created from two or more
real block devices. This allows multiple disks to be combined into a single
filesystem, possibly with integrated redundancy to survive drive
failure.
Linux RAID devices are implemented through the md device driver.

If you're using the 
.B /proc 
filesystem,
.B /proc/mdstat
gives you informations about md devices status.

Currently, Linux supports
.B LINEAR
md devices,
.B RAID0
(striping),
.B RAID1
(mirrroring),
.B RAID4
and
.B RAID5.
For information on the various levels of
RAID, check out:

  http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/

for new releases of the RAID driver check out:

  ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
.br
or
.br
  http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/

Recent kernels (2002) also support a mode known as
.BR MULTIPATH .
.B mdctl
does not support MULTIPATH as yet.

.B mdctl 
is a single program that can be used to control Linux md devices. It
is intended to provide all the functionality (and more) of the mdtools
and raidtools but with a very different interface.

mdctl can perform all functions without a configuration file. There is the
option of using a configuration file, but not in the same way that raidtools
uses one. raidtools uses a configuration file to describe how to create a
RAID array, and also uses this file partially to start a previously created
RAID array. Further, raidtools requires the configuration file for such
things as stopping a raid array which needs to know nothing about the array.

The configuration file that can be used by mdctl lists two different things:

.IP \(bu
a list of devices that should be scanned for md sub-devices.

.IP \(bu
a list of md devices and information about how to identify each.  The
identity can consist of a UUID, and minor-number as recorded on the
superblock, or a list of devices.

.SH MODES
mdctl has 7 major modes of operation:
.TP
.B Assemble
This mode is used to assemble the parts of a previously created
array into an active array. Components can be explicitly given
or can be searched for. 
.B mdctl
(optionally) checks that the components
do form a bonafide array, and can, on request, fiddle superblock
information so as to assemble a faulty array.

.TP
.B Build
This is for building legacy arrays without superblocks.

.TP
.B Create
This mode is used to create a new array with a superblock. It can progress
in several step create-add-add-run or it can all happen with one command.

.TP
.B Detail
Display the details of a given md device.  Details include the RAID
level, the number of devices, which ones are faulty (if any), and the
array UUID.

.TP
.B Examine
Examine a device to see if it is part of an md array, and print out
the details of that array.

.TP
.B "Follow or Monitor"
Monitor one or more md devices and act on any state changes.

.TP
.B Manage
This is for odd bits an pieces like hotadd, hotremove, setfaulty, stop,
readonly, readwrite.
If an array is only partially setup by the
Create or Assemble commands, subsequent Manage commands can finish the
job.

.SH OPTIONS

Available options are:

.TP
.BR -A ", " --assemble
Assemble an existing array

.TP
.BR -B ", " --build
Build a legacy array without superblock

.TP
.BR -C ", " --create
Create a new array

.TP
.BR -D ", " --detail
Print detail of a given md array

.TP
.BR -E ", " --examine
Print content of md superblock on device

.TP
.BR -F ", " --follow ", " --monitor
Select
.B Monitor
mode.

.TP
.BR -h ", " --help
This help message or, after above option, mode specific help message

.TP
.BR -V ", " --version
Print version information for mdctl

.TP
.BR -v ", " --verbose
Be more verbose about what is happening

.SH For create or build:

.TP
.BR -c ", " --chunk=
Specify chunk size of kibibytes.  The default is 64.

.TP
.BR --rounding=
rounding factor for linear array (==chunk size)

.TP
.BR -l ", " --level=
Set raid level.  Options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid5, 4,
raid5, 5.  Obviously some of these are synonymous.
Only the first 4 are valid when Building.

.TP
.BR -p ", " --parity=
Set raid5 parity algorithm. Options are:
{left,right}-{,a}symmetric, la, ra, ls, rs.  The default is left_symmetric.

.TP
.BR --layout=
same as --parity

.TP
.BR -n ", " --raid-disks=
number of active devices in array.

.TP
.BR -x ", " --spare-disks=
number of spares (eXtras) to allow space for.

.TP
.BR -z ", " --size=
Size (in K) of each drive in RAID1/4/5.  If this is not specified
(as it normally is not) the smallest drive (or partition) sets the
size, though if there is a variance greater than 1%, a warning is
issued.

.SH For assemble:

.TP
.BR -u ", " --uuid=
uuid of array to assemble. Devices which don't have this uuid are
excluded

.TP
.BR -m ", " --super-minor=
Minor number of device that array was created for.  Devices which
don't have this minor nmber are excluded.  If you create an array as
/dev/md1, then all superblock will contain the minor number 1, even if
the array is late assembled as /dev/md2.

.TP
.BR -c ", " --config=
config file.  Default is
.BR /etc/mdctl.conf .

.TP
.BR -s ", " --scan
scan config file for missing information

.TP
.BR -f ", " --force
Assemble the array even if some superblocks appear out-of-date

.SH General management

.TP
.BR -a ", " --add
add, or hotadd subsequent devices

.TP
.BR -r ", " --remove
remove subsequent devices

.TP
.BR -f ", " --fail
mark subsequent devices as faulty

.TP
.BR --set-faulty
same as --fail

.TP
.BR -R ", " --run
start a partially built array

.TP
.BR -S ", " --stop
deactivate array, releasing all resources

.TP
.BR -o ", " --readonly
mark array as readonly

.TP
.BR -w ", " --readwrite
mark array as readwrite

.SH CREATE MODE

.HP 12
Usage:
.B mdctl --create
.I device
.BI --chunk= X
.BI --level= Y
.br
.BI --raid-disks= Z
.I  devices

This usage will initialise a new md array and possibly associate some
devices with it. If enough devices are given to complete the array, the
array will be activated. Otherwise it will be left inactive to be completed
and activated by subsequent management commands.

As devices are added, they are checked to see if they contain raid
superblocks or filesystems. They are also check to see if the variance in
device size exceeds 1%.

If any discrepancy is found, the array will not automatically be run, though
the presence of a 
.B --run
can override this caution.

If the 
.B --size
option is given, it is not necessary to list any subdevices in this command.
They can be added later, before a
.B --run. 
If no 
.B --size
is given, the apparent size of the smallest drive given is used.

The General Management options that are valid with --create are:
.TP
.B --run
insist of running the array even if not all devices are present or some look
odd.

.TP
.B --readonly
start the array readonly - not supported yet.

.SH ASSEMBLY MODE

.HP 12
Usage:
.B mdctl --assemble
.I device options...
.HP 12
Usage:
.B mdctl --assemble --scan
.I  options...

This usage assembles one or more raid arrays from pre-existing components.
For each array, mdctl needs to know the md device, the identity of the
array, and a number of sub devices. These can be found in a number of ways.

The md device is either given before 
.B --scan
or is found from the config file. In the latter case, multiple md devices
can be started with a single mdctl command.

The identity can be given with the 
.B --uuid
option, with the
.B --super-minor
option, can be found in in the config file, or will be taken from the
super block on the first subdevice listed on the command line or in a
subsequent
.B --add
command.

Devices can be given on the 
.B --assemble
command line, on subsequent
.B 'mdctl --add'
command lines, or from the config file. Only devices which have an md
superblock which contains the right identity will be considered for any device.

The config file is only used if explicitly named with 
.B --config
or requested with 
.B --scan. 
In the later case,
.B /etc/mdctl.conf
is used.

If 
.B --scan
is not given, then the config file will only be used to find the
identity of md arrays.

Normally the array will be started after it is assembled.  However is
.B --scan
is not given and insufficent drives were lists to start a complete
(non-degraded) array, then the array is not started (to guard against
usage errors).  To insist that the array be started in this case (as
may work for RAID1 or RAID5), give the
.B --run
flag.

The config file is line oriented with, as usual, blank lines and lines
beginning with a hash (or pound sign or sharp or number sign,
whichever you like to call it) ignored.
Lines that start with a blank are treated as continuations of the
previous line.

Each line contains a sequence of space-separated words, the first of
which identified the type of line. Keywords are case-insensitive, and
the first work on a line can be abbreviated to 3 letters.

There are two types of lines. ARRAY and DEVICE.

The DEVICE lines usually come first. All remaining words on the line
are treated as names of devices, possibly containing wild cards (see
glob(7)).  These lists all the devices that mdctl is allowed to scan
when looking for devices with RAID superblocks.
Each line can contain multiple device names, and there can be multiple
DEVICE lines.

The ARRAY lines identiy actual array.  The second word on the line
should be the name of the device where the array is normally
assembled, such as /dev/md1.
Subsequent words identify the array. If multiple identities are given,
then the array much match ALL identities to be considered a match.
Each identity word has a tag, and equals sign, and some value.
The options are:

.TP
.B uuid=
The value should be a 128 bit uuid in hexadecimal, with punctuation
interspersed if desired.  This must match the uuid stored in the
superblock.
.TP
.B super-minor=
The value is an integer which indicates the minor number that was
stored in the superblock when the array was created. When an array is
created as /dev/mdX, then the minor number X is stored.
.TP
.B devices=
The value is a comma separated list of device names. Precisely these
devices will be used to assemble the array.  Note that the devices
listed there must also be listed on a DEVICE line.

.SH BUILD MDOE

.HP 12
Usage:
.B mdctl --build
.I device
.BI --chunk= X
.BI --level= Y
.BI --raid-disks= Z
.I devices

This usage is similar to 
.B --create. 
The difference is that it creates a legacy array without a superblock. With
these arrays there is no difference between initially creating the array and
subsequently assembling the array, except that hopefully there is useful
data there in the second case.

The level may only be 0 or linear. All devices must be listed and the array
will be started once complete.

'''.SH BUGS
'''no known bugs.

.SH TODO

Finish and document Follow mode.

.SH SEE ALSO
.IR raidtab (5),
.IR raid0run (8),
.IR raidstop (8),
.IR mkraid (8)
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
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