DMRAID(8)
π¦ dmraid(8) β System Manager's Manual π¦
okay bestie, buckle up π this is the manual page for dmraid, straight out of the System Manager's Manual. She's a big one, so we're doing this in parts and this is part 1. grab a snack, we're going in π
β¨ NAME β¨
dmraid β discover, configure and activate software (ATA)RAID
that's the whole vibe. discover. configure. activate. software (ATA)RAID. she does all three and she does them flawlessly π
π SYNOPSIS π
okay so there's not one way to call her, there's like a whole β¨collectionβ¨ of invocation forms and each one is its own little main character. here they all are, exactly as written, no cap:
dmraid
{-a|--activate} {y|n|yes|no}
[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]
[-f|--format FORMAT[,FORMAT...]]
[-I|--ignoremonitoring]
[{-P|--partchar} CHAR]
[-p|--no_partitions]
[-Z|--rm_partitions]
[--separator SEPARATOR]
[-t|--test]
[RAID-set...]
form one: the activate girlie. she takes y, n, yes or no (so decisive π
) and a pile of optional extras.
dmraid
{-b|--block_devices}
[-c|--display_columns][FIELD[,FIELD...]]...
[-d|--debug]... [-v|--verbose]...
[--separator SEPARATOR]
[device-path...]
form two: the block devices one β she's here to show you what's out there.
dmraid
{-h|--help}
form three: help. she's just here to help. iconic, honestly π«Ά
dmraid
{-l|--list_formats}
[-d|--debug]... [-v|--verbose]...
form four: list formats β show me the formats, bestie π
dmraid
{-n|--native_log}
[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]
[-f|--format FORMAT[,FORMAT...]]
[--separator SEPARATOR]
[device-path...]
form five: native log energy β¨
dmraid
{-R| --rebuild}
RAID-set
[device-path]
form six: rebuild. she needs a RAID-set, and she'll take an optional device-path too. (also note the lil space in -R| --rebuild β that's just how she's written, we keep it exactly π)
dmraid
{-x| --remove}
[RAID-set]
form seven: remove. RAID-set is optional here. bye bye π
dmraid
-f FORMAT-handler {-C| --create} set
--type raidlevel
[--size=setsize --strip stridesize]
--disk "device-path, device-path [, device-path ...]"
form eight: create β the full build-your-own-set moment. she wants a format handler, a set, a --type raidlevel, and a --disk list. --size and --strip are the optional glow-up πΈ
dmraid [ -f|--format FORMAT-handler] -S|--spare [RAID-set] -M|--media
"device-path"
form nine: spare + media. one-liner coded, but she's valid.
dmraid
{-r|--raid_devices}
[-c|--display_columns][FIELD[,FIELD...]]...
[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]
[-D|--dump_metadata]
[-f|--format FORMAT[,FORMAT...]]
[--separator SEPARATOR]
[device-path...]
form ten: raid devices, the version that will also happily --dump_metadata for you ποΈ
dmraid
{-r|--raid_devices}
[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]
[-E|--erase_metadata]
[-f|--format FORMAT[,FORMAT...]]
[--separator SEPARATOR]
[device-path...]
form eleven: raid devices again but this time with --erase_metadata. yes ma'am, deletion era π§Ή
dmraid
{-s|--sets}...[a|i|active|inactive]
[-c|--display_columns][FIELD[,FIELD...]]...
[-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]
[-f|--format FORMAT[,FORMAT...]]
[-g|--display_group]
[--separator SEPARATOR]
[RAID-set...]
form twelve: sets β and she takes a, i, active or inactive as her lil mood selector, plus optional --display_group π
dmraid
{-V/--version}
form thirteen: version. that's it. that's the whole form. short queen π
heads up bestie: this is part 1 of 3 β the vibe continues, don't go anywhere π
π DESCRIPTION π
okay so picture this: dmraid is out here discovering block and software RAID devices (like, say, ATARAID) by running a whole roster of different metadata format handlers, and each handler speaks its own format (think Highpoint 37x series energy π¦). She activates RAID sets that are made up of 2 or more discovered RAID devices, and she'll happily show off the properties of both devices and sets (peep the -l option for the supported metadata formats, iykyk).
Once a RAID set is activated, block device access to it happens through device-mapper nodes β literally /dev/mapper/RaidSetName. And RaidSetName starts with the format name (again, see the -l option), which means you can grab every RAID set of one specific format super easily with certain options (eg -a, right below π). iconic behaviour fr.
β¨ OPTIONS β¨
-a,--activate {y|n} [RAID set...]β activates or deactivates all or particular software RAID set(s). the whole vibe:- it also activates or deactivates device monitoring automatically, unless you hand it the
[-I|--ignoremonitoring]option at the same time β which stops any dmeventd device monitoring daemon interaction from happening at all, no cap. - if
-Iis being used on the initial RAID set activation, you can use-aylater to activate device monitoring on those already-active RAID sets, as long as the RAID format supports it. - for device monitoring management through this tool, go read
dmevent_tool(8). - if metadata format handlers are chosen with
-f, then only RAID sets with such format(s) can be activated or deactivated. super useful when devices have multiple metadata signatures all yelling at once. - when you're activating RAID sets,
-pdisables the activation of partitions on them, and-Zmakes dmraid tell the kernel to remove the partitions from the disks underlying the set β ie, ifsdais part of the set, removesda1,sda2, etc. this stops applications from directly accessing the disks and bypassing dmraid entirely. gatekeeping, but make it kernel-level π - RAID set names given on the command line don't need to be fully specified (eg,
dmraid -ay silwould activate all discovered Silicon Image Medley RAID sets). partial names are enough bestie.
- it also activates or deactivates device monitoring automatically, unless you hand it the
{-b|--block_devices} [device-path...]β list all or particular discovered block devices with their properties (size, serial number). add-cto display block device names only, and-ccfor CSV column output of block device properties. see the description of-cbelow for the FIELD identifiers.[-d|--debug]...β enable debugging output. the option can be given multiple times, each time cranking the debug output level up π₯[-c|--display_columns][FIELD[,FIELD...]]...β display properties of block devices, RAID sets and devices in column(s). the optional list specifies which FIELDs to display. here's the menu:- for
-b:d[evpath]|p[ath],sec[tors]|si[ze],ser[ialnumber]. - for
-r:de[vpath]|p[ath],f[ormat],r[aidname],t[ype],st[atus],se[ctors]|si[ze],da[taoffset]|o[ffset]. - for
-s:f[ormat],r[aidname],t[ype],sta[tus],str[ide],se[ctors]|si[ze],su[bsets],d[evices],sp[ares].
- for
[-f|--format FORMAT[,FORMAT...]]β use metadata format handler(s) to discover RAID devices. see-lfor a list of supported format handler names. this is useful for selecting particular formats in case multiple metadata signatures are found on a device. you can specify a comma separated list of format names β and it may not contain white space, so no sneaky spaces bestie.{-h|--help}β display help text. the classic π«Ά{-i|--ignorelocking}β don't take out any locks. useful in early boot, where there's no read/write access to/varavailable.{-I|--ignoremonitoring}β don't activate or deactivate device monitoring with-ayor-anrespectively. this avoids interaction with the dmeventd device monitoring daemon altogether.{-l|--list_formats}β list all available metadata format handlers with their names and descriptions. supported RAID levels are listed in parenthesis:S: Span (concatination)0: RAID0 (stripe)1: RAID1 (mirror)10: RAID10 (mirror on top of stripes)01: RAID10 (stripe on top of mirrors) Note: Intel OROM displays this as RAID10
{-n|--native_log} [device-path...]β display metadata in native, vendor-specific format. in case a metadata format handler is chosen with-f, only RAID devices with such format will be displayed in native format. ifdevice-path(s)is/are given on the command line, the native metadata output is restricted to those listed. choosey. we respect it β¨[{-P|--partchar} CHAR]β use CHAR as the separator between the device name and the partition number.{-R| --rebuild} RAID-set [device-path]β rebuild the raid array after a drive has failed and a new drive is added. for Intel chipset based systems, there are two methods in which a new drive is added to the system:- Using OROM to identify a new drive
- during system reboot, enter OROM and mark the new drive as the rebuild drive.
- after booting to the OS, use the dmraid command to rebuild.
- Example:
dmraid -R raid_set
- Using dmraid to identify a new drive
- boot to the OS and use the dmraid command with the new drive as the second parameter.
- Example:
dmraid -R raid_set /dev/sdc
- Using hot spare drive
- mark a drive as hot spare using the
"dmraid -f isw -S"command. then use the dmraid command to start the rebuild. - Example:
dmraid -R raid_set
- mark a drive as hot spare using the
- Using OROM to identify a new drive
{-x|--remove} [RAID-set]β delete one or all existing software RAID devices from the metadata. bye bye π-f FORMAT-handler {-C|--create} --type raidlevel [--size=setsize --strip stripsize] --disk device-path, device-path [,device-path]
Delete one or all existing Configure a software RAID device and store the configuration data in a group of hard drive devices consisting of this array. π (bestie the manpage really says it like that, and we are keeping it exactly as written.) this command requires the following options:
-f FORMAT-handlerβ metadata format (see"dmraid -l")--type digit[digit...]β specify the raid level of the software RAID set.0: raid01: raid15: raid501: raid01 (isw raid10)
--size: [digits[k|K|m|M|g|G][b|B]]β specify the size of the RAID set. The number is an integer followed by[kKmMgG]and/or[bB].b: byte (default)B: block (512 bytes)KorK: on the base of 1024morM: on the base of 1024*1024gorG: on the base of 1024*1024*1024- If this option is missing, it's set to the default value pre-configured by the vendor. Note that different vendors may apply different constraints on the granularity of the size or the minimal value. so like, don't assume, okay? π
--strip: [digits[k|K|m|M|g|G][b|B]]β specify the strip size of a RAID1, RAID5, and RAID10 RAID set (as above).--disk: device-path[{,| }device-path...]β specify the array of the hard drives, e.g./dev/sda.
-f FORMAT-handler -S -M device-path
-S -M device-path
This command adds hot spare support for one or more RAID sets.
- When used with a format handler, which supports hot spare sets (e.g. isw), a hot spare is marked to be used when rebuilding any RAID set of that format.
- When used when specifying a RAID set, the drive is added to that RAID set and will be used only to rebuild that set. Note: If the specified name does not match an existing RAID-set, a set with the new name will be created. surprise set, slay β¨
{-r|--raid_devices} [device-path...]β list all discovered RAID devices with format, RAID level, sectors used and data offset into the device. in case a metadata format handler is chosen with-f, only RAID devices with such format can be discovered. useful if devices have multiple metadata signatures. now the juicy part:- if
-Dis added to-r, the RAID metadata gets dumped into a subdirectory nameddmraid.format_name(eg.format_name = isw) in files nameddevicename.dat. the byte offset where the metadata is located on the device is written into files nameddevicename.offset, and the size of the device in sectors goes into files nameddevicename.size. - if
-Eis added to-r, the RAID metadata on the devices gets conditionally erased. useful for erasing old metadata after new metadata of a different type has been stored on a device, so you avoid discovering both. if you enter the-Eoption,-Dwill be enforced, so you have a fallback in case the wrong metadata got erased. - > β οΈ bestie, listen: manual copying back onto the device is needed to recover from erasing the wrong metadata, using the dumped files
devicename_formatname.datanddevicename_formatname.offset. this is the "oops" insurance, do not skip it. - eg, to restore all
*.datfiles in the working directory to the respective devices:
- if
for f in *.dat
do
dd if=$f of=/dev/${f%%.dat} \
seek=`cat ${f%%dat}offset` bs=1
done
- if
device-path(s)is/are given on the command line, the above actions are restricted to those listed. add-cto display RAID device names only and-ccfor CSV column output of RAID device properties. see the description of-cabove for the FIELD identifiers.
--separator SEPARATORβ use SEPARATOR as a delimiter for all options taking or displaying lists. pick your fighter π-s... [a|i] [RAID-set...]β display properties of RAID sets. multiple RAID set names can be given on the command line, and they don't need to be fully specified (eg,dmraid -s hptwould display all discovered Highpoint RAID sets). enter-stwice to display RAID subsets too. add-cto display names of RAID sets only,-ccfor CSV column output of RAID set properties, and-cccfor inclusion of block devices in the listing. this doesn't imply-s -sto show RAID subsets (implied for group sets, e.g. isw). add-gto include information about group RAID sets (as with Intel Software RAID) in the listing. see the description of-cabove for the FIELD identifiers. Note: Size is given in sectors (not bytes). sectors, not bytes, do not come for me π₯[-v|--verbose]...β enable verbose runtime information output. the option can be given multiple times, each time increasing the verbosity level. yap mode: unlocked π£οΈ
πΈ EXAMPLES πΈ
okay bestie this is the part where it all clicks, fr fr. let's go π
dmraid -l lists all the supported metadata formats, with their names and a lil descriptive note next to each one, like this:
hpt37x : (+) Highpoint HPT37X
hpt45x : (+) Highpoint HPT45X
isw : (+) Intel Software RAID
lsi : (0) LSI Logic MegaRAID
nvidia : (+) NVidia RAID
pdc : (+) Promise FastTrack
sil : (+) Silicon Image(tm) Medley(tm)
via : (+) VIA Software RAID
dos : (+) DOS partitions on SW RAIDs
(0): Discover, (+): Discover+Activate
bestie look at the legend at the bottom, it's giving cryptic but it's actually so simple:(0)means Discover only, and(+)means Discover+Activate. that's the whole vibe check right there π₯
dmraid -ay activates all the software RAID sets it discovered. go off king π
dmraid -an deactivates all the active software RAID sets that are not open β like, if there's a mounted filesystem sitting on them, hands off, we're not touching that π
dmraid -ay -f pdc (and yes, pdc is looked up straight from that dmraid -l list we just did) activates all the software RAID sets with the Promise format that it discovered, and it ignores every other supported format. very "only my faves" of it β¨
dmraid -r discovers all the software RAID devices supported on your system, eg:
/dev/dm-46: hpt45x, "hpt45x_chidjhaiaa-0", striped, ok, 320172928 sectors, data@ 0
/dev/dm-50: hpt45x, "hpt45x_chidjhaiaa-0", striped, ok, 320172928 sectors, data@ 0
/dev/dm-54: hpt45x, "hpt45x_chidjhaiaa-1", striped, ok, 320172928 sectors, data@ 0
/dev/dm-58: hpt45x, "hpt45x_chidjhaiaa-1", striped, ok, 320172928 sectors, data@ 0
dmraid -s -s hpt45x_chidjhaiaa displays the properties of the set hpt45x_chidjhaiaa, eg:
*** Superset
name : hpt45x_chidjhaiaa
size : 640345856
stride : 128
type : raid10
status : ok
subsets: 2
dev : 4
spare : 0
---> Subset
name : hpt45x_chidjhaiaa-0
size : 640345856
stride : 128
type : stripe
status : ok
subsets: 0
dev : 2
spare : 0
---> Subset
name : hpt45x_chidjhaiaa-1
size : 640345856
stride : 128
type : stripe
status : ok
subsets: 0
dev : 2
spare : 0
not the superset and the subsets, this set has main character energy and its little subset besties too ππ
dmraid -s -ccs hpt45 displays properties in column format of all the sets and subsets matching the hpt45* format, eg:
hpt45x_chidjhaiaa,640345856,128,raid10,ok,4,0
hpt45x_chidjhaiaa-a,640345856,128,stripe,ok,2,0
hpt45x_chidjhaiaa-b,640345856,128,stripe,ok,2,0
dmraid -r --sep : -cpath:size displays paths and sizes in sectors for the RAID devices, in column format, using : as the delimiter, eg:
/dev/dm-8:320173055
/dev/dm-12:320173055
/dev/dm-22:320173055
/dev/dm-26:320173055
/dev/dm-30:586114703
/dev/dm-34:586114703
/dev/dm-38:586114703
/dev/dm-42:586114703
/dev/dm-46:156301487
/dev/dm-50:156301487
/dev/dm-54:390624896
/dev/dm-58:390624896
/dev/dm-62:390624896
/dev/dm-66:390624896
dmraid -f isw -C Raid0 --type 0 --strip 8k --size 20g --disk "/dev/sdb /dev/sdc" creates an ISW volume with the name Raid0, 20Gig bytes total, and an 8kilo bytes strip size, on two disks. iconic build π«Ά
dmraid -f isw -C Test0 --type 0 --disk "/dev/sdd /dev/sde" creates an ISW volume with the default size and the default strip size. lazy girl summer edition (affectionate) π
dmraid -f isw -C Test10 --type 01 --strip 128B --disk "/dev/sda /dev/sdb /dev/sdc /dev/sdd" creates a stacked RAID device, RAID10 (isw format), with a name of Test10, 128 blocks (512bytes) strip size, and the default volume size, on 4 disks.
dmraid -f isw -S -M /dev/sde marks the device /dev/sde as a hot spare for rebuild π
dmraid -R isw_djaggchdde_RAID1 /dev/sde starts the rebuild of the RAID volume on the device /dev/sde. glow up in progress β¨
π DIAGNOSTICS π
okay so the tea on exit codes: dmraid returns an exit code of 0 for success or 1 for error. that's it. no in-between, no drama, no cap. π
π AUTHOR π
Heinz Mauelshagen <Mauelshagen@RedHat.com>
and that's the whole page bestie!! π you just read the DMRAID TOOL manual page, the one and only DMRAID(8) π
tysm for staying till the end, you're literally so iconic for that, mwah π«Άπβ¨
π¦ where this page comes from
- alpine 3.22: dmraid-doc 1.0.0_rc16-r6 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.23: dmraid-doc 1.0.0_rc16-r7 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.24: dmraid-doc 1.0.0_rc16-r7 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: dmraid 1.0.0.rc16.3-15 Β· GPL-2.0-only
- opensuse-leap 16.0: dmraid 1.0.0.rc16.3-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: dmraid 1.0.0.rc16.3-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: dmraid 1.0.0.rc16.3-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: dmraid 1.0.0.rc16.3-160000.2.2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms