1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git synced 2026-12-03 00:44:24 +00:00
No description
  • C 87.6%
  • Roff 9%
  • Shell 2.8%
  • Makefile 0.6%
Find a file
Pawel Piatkowski 2a52d0baa8 lib: add a shared timestamp formatting helper
Centralize ctime_r() conversion and failure handling in format_timestamp().
Return text without a trailing newline and let callers terminate output
lines explicitly.

Define CTIME_BUF_SIZE in mdadm.h and use it for all timestamp buffers.
Preserve caller-specific handling of zero timestamps.

Signed-off-by: Pawel Piatkowski <pawel.piatkowski@graidtech.com>
2026-11-27 15:38:26 +01:00
.github GitHub workflows: enable CodeQL security and quality queries 2026-11-12 10:57:43 +01:00
clustermd_tests clustermd_tests: control speed limits on both nodes 2026-07-14 10:49:19 +02:00
documentation Fix 'meaing' typo in mdadm.conf-example 2025-10-02 09:25:06 +02:00
misc Makefile: add install-testsuite target 2026-11-18 09:45:42 +01:00
systemd Makefile: install mdcheck and make its path configurable 2025-11-19 16:05:20 +08:00
tests tests/01r5integ, tests/01raid6integ: fix state check 2026-11-27 15:36:09 +01:00
udev Simplify udev rules generating 2026-11-27 15:36:34 +01:00
.gitignore Updated .gitignore 2026-11-18 09:59:43 +01:00
Assemble.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
bitmap.c mdadm: handle short reads in llbitmap_count_states() 2026-11-12 10:42:07 +01:00
bitmap.h mdadm: add support for new lockless bitmap 2026-01-27 09:36:30 +01:00
Build.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
CHANGELOG.md Release mdadm-4.6 2026-03-16 22:57:09 +08:00
config.c mdadm: fix build with Clang 23 2026-10-28 11:41:30 +01:00
COPYING Update COPYING file. 2011-08-18 12:55:24 +10:00
coverity-gcc-hack.h gcc-8 coverity hack 2018-06-04 14:49:59 -04:00
crc32.c mdadm: fix build with Clang 23 2026-10-28 11:41:30 +01:00
crc32.h Add crc32 files. 2008-05-15 16:48:10 +10:00
crc32c.c add crc32c and use it for r5l checksum 2015-10-30 17:38:28 +11:00
Create.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
Detail.c lib: add a shared timestamp formatting helper 2026-11-27 15:38:26 +01:00
dlink.c mdadm: fix build with Clang 23 2026-10-28 11:41:30 +01:00
dlink.h dlink.h: Fix checkpatch warnings for function args 2024-09-10 12:18:32 +02:00
drive_encryption.c imsm: fix incorrect SATA TCG error msg 2026-03-13 09:53:41 +01:00
drive_encryption.h imsm: print disk encryption information 2024-04-02 08:29:15 +02:00
Dump.c add checking of return status on fstat calls 2024-05-21 09:11:31 +02:00
Examine.c Examine: Fix double free of the caller's supertype in ExamineBadblocks 2026-11-02 17:34:49 +01:00
Grow.c Grow: return on sysfs initialization failure in Grow_addbitmap() 2026-11-09 07:52:33 +01:00
Incremental.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
Kill.c mdadm.h: Add mdstat.h 2026-07-22 07:52:55 +02:00
lib.c lib: add a shared timestamp formatting helper 2026-11-27 15:38:26 +01:00
MAINTAINERS.md Update MAINTAINERS.md 2026-01-21 07:24:59 +01:00
Makefile Simplify udev rules generating 2026-11-27 15:36:34 +01:00
Manage.c Manage: fix device ID check in is_remove_safe() 2026-11-04 09:37:20 +01:00
managemon.c mdadm.h: Add mdstat.h 2026-07-22 07:52:55 +02:00
mapfile.c mapfile: fix relative devname resolution in resolve_md_path 2026-11-18 10:00:28 +01:00
mapfile.h mapfile: add mapfile.h 2026-08-11 08:33:37 +02:00
maps.c Allow RAID0 to be created with v0.90 metadata #161 2025-04-10 11:35:36 +02:00
md.4 md.man: Remove refferences to not supported kernel 2024-11-05 13:36:43 +01:00
md5.h mdadm fix compilation for uClibc 2009-02-02 09:53:51 +11:00
md_common.h mdadm: Add define for magic +9 in version string 2026-07-22 07:52:55 +02:00
md_p.h imsm: PPL support 2017-03-29 11:32:49 -04:00
md_u.h Remove last traces of HOT_ADD_DISK 2019-11-27 10:19:54 -05:00
mdadm.8.in imsm: support --data-offset for the first volume 2026-11-20 12:11:12 +01:00
mdadm.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
mdadm.conf.5.in IMSM, config: configurable OROM scanning 2026-07-14 10:50:42 +02:00
mdadm.h lib: add a shared timestamp formatting helper 2026-11-27 15:38:26 +01:00
mdadm_status.h mdadm: Do not start reshape before switchroot 2025-01-13 10:24:49 +01:00
mddev.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
mddev.h mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
mdmon.8 Release mdadm-4.6 2026-03-16 22:57:09 +08:00
mdmon.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
mdmon.h mdadm.h: Add mdstat.h 2026-07-22 07:52:55 +02:00
mdmonitor.c mdadm: Renamed mdopen to mddev 2026-11-18 09:42:40 +01:00
mdstat.c mdadm: Add define for magic +9 in version string 2026-07-22 07:52:55 +02:00
mdstat.h mdadm: Add define for magic +9 in version string 2026-07-22 07:52:55 +02:00
monitor.c sysfs: functions for writing md/<memb>/state 2024-12-16 10:11:31 +01:00
msg.c mdadm: Add define for magic +9 in version string 2026-07-22 07:52:55 +02:00
msg.h Remove lots of unnecessary white space. 2013-06-19 12:31:45 +10:00
part.h Fix bus error when accessing MBR partition records 2016-10-19 12:38:02 -04:00
platform-intel.c platform-intel: Add new sata guid 2026-11-02 08:49:54 +01:00
platform-intel.h mdadm: add attribute nonstring for signature 2025-05-08 23:30:38 +08:00
policy.c policy: Add --udev flag for incremental 2026-09-09 14:26:48 +02:00
probe_roms.c Replace error prone signal() with sigaction() 2022-04-04 11:13:02 -04:00
probe_roms.h probe_roms: allow to probe expansion ROMs using vendor and device id. 2011-03-10 11:41:46 +11:00
Query.c Query: handle unknown level of a member device 2026-11-23 16:38:26 +01:00
raid6check.8 Update raid6check man page 2025-10-07 07:27:47 +02:00
raid6check.c raid6check is still mostly I/O bound. It reads blocks of stripes one 2026-11-16 12:56:29 +01:00
ReadMe.c mdadm: Set appropriate bitmap state during grow 2026-09-15 15:16:55 +02:00
README.md mdadm: Remove static target 2026-11-18 09:59:43 +01:00
restripe.c restripe: remove test_stripe 2026-11-12 09:23:50 +01:00
sha1.c Define alignof using _Alignof when using C11 or newer 2023-03-19 12:15:52 -04:00
sha1.h Remove lots of unnecessary white space. 2013-06-19 12:31:45 +10:00
super-ddf.c super-ddf: fix mppe OOB read in examine_vd 2026-08-24 12:09:17 +08:00
super-gpt.c mdadm: add xmalloc.h 2024-09-27 11:16:22 +02:00
super-intel.c lib: add a shared timestamp formatting helper 2026-11-27 15:38:26 +01:00
super-mbr.c mdadm: add xmalloc.h 2024-09-27 11:16:22 +02:00
super0.c lib: add a shared timestamp formatting helper 2026-11-27 15:38:26 +01:00
super1.c lib: add a shared timestamp formatting helper 2026-11-27 15:38:26 +01:00
swap_super.c mdadm: use lseek consistently 2025-07-09 11:40:08 -04:00
sysfs.c mdadm: report missing kernel support for lockless bitmap 2026-11-12 10:42:07 +01:00
test test: add execution lock 2026-11-16 12:53:42 +01:00
udev.c udev: send the readiness uevent only if udev was blocked 2026-11-03 15:26:01 +01:00
udev.h udev: send the readiness uevent only if udev was blocked 2026-11-03 15:26:01 +01:00
util.c lib: add a shared timestamp formatting helper 2026-11-27 15:38:26 +01:00
uuid.c uuid.c: split uuid stuffs from util.c 2020-05-18 20:10:39 -04:00
xmalloc.c super-ddf: optimize DDF header search for widely used RAID controllers 2025-02-03 11:19:00 +01:00
xmalloc.h super-ddf: optimize DDF header search for widely used RAID controllers 2025-02-03 11:19:00 +01:00

mdadm is a utility used to create and manage software RAID devices implemented through Multiple devices driver (MD) in kernel. It supports following RAID metadata formats:

  • Linux native RAID:

    Known as native or native RAID. First and default metadata format. Metadata management is implemented in MD driver.

  • Matrix Storage Manager Support (no reference, metadata format documentation is proprietary).

    Known as IMSM. Metadata format developed byIntel®. Currently, maintained by Graid Technology Inc. as a part of VROC solution. There are some functional differences between native and imsm. The most important difference is that the metadata is managed from userspace.

    CAUTION: imsm is compatible with Intel RST, however it is not officially supported. You are using it on your own risk.

  • Common RAID DDF Specification Revision

    IMPORTANT: DDF is in maintenance only mode. There is no active development around it. Please do not use it in new solutions.

Questions and Support

This Github site is not right place to ask if your are looking for:

  • support from Linux Raid Community;
  • support with kernel issues;

This is the place where development of mdadm application is done. Please, do not use for looking for support. You should always ask on Mailing List.

Please use issues if you have confirmation that issue you are experiencing is related to mdadm components:

  • mdadm;
  • mdmon;
  • raid6check;
  • swap_super;
  • systemd services ( see systemd/);
  • udev rules;
  • manual pages (including md.man)

For example:

  • mdadm issues (e.g segfaults, memory leaks, crashes, bad communication with MD driver);
  • feature requests for mdadm;
  • suggestions or minor fixes requested (e.g. better error messages);

Generally, if you are not sure it is better to ask on Mailing List first.

How to Contribute

Effective immediately Github is the primary location for mdadm. Please use pull requests to contribute.

It was originally hosted on kernel.org. You can access the old repository here.

While this is the preferred contribution method, mailing list submissions are still welcome and will be handled as has always been the case for mdadm. Please add "mdadm:" to the subject to allow automation to create Github Pull Request and run checks.

NOTE: Maintainers may ask you to send RFC to mailing list if the proposed code requires consultation with kernel developers.

Kernel coding style is used. Please familiarize with general kernel submitting patches documentation. Formatting, tags and commit message guidelines applies to mdadm.

Checkpatch script is run on every patch in pull request so be sure that your commits are not generating issues. There are some excludes, so the best is to follow github checkpatch action result.

Pull Request are closed by Rebase and Merge option, so it requires to keep every commit meaningful. Kernel style requires that. The review changes must be pushed with push --force to the chosen branch, then Pull Request will be automatically updated.

Maintainers of mdadm repository on kernel.org

See Maintainers File.

Minimal supported kernel version

We do not support kernel versions below v3.10. Please be aware that maintainers may remove workarounds and fixes for legacy issues.

Dependencies

The following packages are required for compilation:

RHEL SLES Debian/Ubuntu
pkgconf pkg-config pkg-config
gcc gcc gcc
make make make
libudev-devel libudev-devel libudev-dev

Compiling mdadm

Run make command to compile mdadm.

Specifying more jobs e.g. make -j4 can decrease compilation time significantly.

Various values can be specified for the CXFLAGS variable to customize the build process:

  • Run make CXFLAGS=-ggdb to include gdb debugging information.
  • Run make CXFLAGS=-DDEBUG to enable additional debug information through dprintf statements and call traces.
  • Run make CXFLAGS=-DNO_LIBUDEV to compile without libudev.

To build with more than one option specified in CXFLAGS, separate each option with a space, e.g. make CXFLAGS="-ggdb -DDEBUG".

Additionally, the EXTRAVERSION variable can be set to build with user-friendly version label, useful when customizing mdadm builds or labeling some instance in between major releases, e.g. make EXTRAVERSION="custom-label".

Installing mdadm

Before installing mdadm, it is advised to uninstall vendor-provided packages (mdadm.deb, mdadm.rpm etc.) in order to avoid configuration issues.

Run make install command to install mdadm. This command invokes the following targets:

  • install-bin
  • install-man
  • install-udev

After installing mdadm, consider rebuilding initramfs to ensure the changes take effect.

List of installation targets:

  • Run make install-bin to install the mdadm and mdmon binary files.
  • Run make install-systemd to install the systemd services.
  • Run make install-udev to install the udev rules.
  • Run make install-man to install the manual pages (mdadm.8, md.4, mdadm.conf.5, mdmon.8).

License

It is released under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.