DMRAID(8)

πŸ“¦
version 1.0.0.rc16.3 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, opensuse-leap 16.0

πŸ¦‹ 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 -I is being used on the initial RAID set activation, you can use -ay later 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, -p disables the activation of partitions on them, and -Z makes dmraid tell the kernel to remove the partitions from the disks underlying the set β€” ie, if sda is part of the set, remove sda1, 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 sil would activate all discovered Silicon Image Medley RAID sets). partial names are enough bestie.
  • {-b|--block_devices} [device-path...] β€” list all or particular discovered block devices with their properties (size, serial number). add -c to display block device names only, and -cc for CSV column output of block device properties. see the description of -c below 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].
  • [-f|--format FORMAT[,FORMAT...]] β€” use metadata format handler(s) to discover RAID devices. see -l for 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 /var available.
  • {-I|--ignoremonitoring} β€” don't activate or deactivate device monitoring with -ay or -an respectively. 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. if device-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:
    1. 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
    2. 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
    3. 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
  • {-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: raid0
    • 1: raid1
    • 5: raid5
    • 01: 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)
    • K or K: on the base of 1024
    • m or M: on the base of 1024*1024
    • g or G: 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.

  1. 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.
  2. 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 -D is added to -r, the RAID metadata gets dumped into a subdirectory named dmraid.format_name (eg. format_name = isw) in files named devicename.dat. the byte offset where the metadata is located on the device is written into files named devicename.offset, and the size of the device in sectors goes into files named devicename.size.
    • if -E is 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 -E option, -D will 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.dat and devicename_formatname.offset. this is the "oops" insurance, do not skip it.
    • eg, to restore all *.dat files in the working directory to the respective devices:
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 -c to display RAID device names only and -cc for CSV column output of RAID device properties. see the description of -c above 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 hpt would display all discovered Highpoint RAID sets). enter -s twice to display RAID subsets too. add -c to display names of RAID sets only, -cc for CSV column output of RAID set properties, and -ccc for inclusion of block devices in the listing. this doesn't imply -s -s to show RAID subsets (implied for group sets, e.g. isw). add -g to include information about group RAID sets (as with Intel Software RAID) in the listing. see the description of -c above 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