Bug 604565 - Additional files stored in /dev/md/ directory.
Summary: Additional files stored in /dev/md/ directory.
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mdadm
Version: 6.0
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Doug Ledford
QA Contact: qe-baseos-daemons
Depends On:
TreeView+ depends on / blocked
Reported: 2010-06-16 08:50 UTC by jbielans
Modified: 2010-08-20 11:39 UTC (History)
6 users (show)

Clone Of:
Last Closed: 2010-06-16 15:16:40 UTC

Attachments (Terms of Use)

Description jbielans 2010-06-16 08:50:07 UTC
Description of problem:
Additional files:
 - *pid
 - *sock
 - *map
appears sometimes in /dev/md/ directory.
If those file are "work files" and are needed for mdadm
to operate properly, should they be stored in this directory?
Shouldn't it be any temporary folder for better clarity?
Also if those files are necessary, why those files don't 
appear always when raid is created?

How reproducible:

Steps to Reproduce:
mdadm -C /dev/md/imsm0 -amd -e imsm -n 3 /dev/sdb /dev/sdc /dev/sdd -R
mdadm -C /dev/md/r5d3n1s64-45 -amd -l5 --chunk 64 --size 23592960 -n 3 /dev/sdb /dev/sdc /dev/sdd -R -f
mdadm -f /dev/md/r5_d3_n1_s64_45 /dev/sdc
mdadm -Ss
Expected results:
Files in /dev/md/:
 - imsm
 - r5_d6_n0_s4_18572

Actual results:
Files in /dev/md/:
 - imsm
 - r5_d6_n0_s4_18572
 - md127.pid
 - md127.sock
 - md-device-map

Additional info:
- OS: RH 6.0 SNAP 3
- Platform: ICH9

Comment 2 RHEL Product and Program Management 2010-06-16 09:13:25 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 3 Krzysztof Wojcik 2010-06-16 09:49:08 UTC
It was intended to store additional files in /dev/md/

Here is the commit that allow to store *.pid and *.sock files in localization indicated by VAR_RUN environment variable.

commit 5d4d1b26d3da8b489ed7e2f5a38f7d90b7f4008f
Author: NeilBrown <neilb@suse.de>
Date:   Thu Feb 4 16:31:49 2010 +1100

    mdmon: allow pid to be stored in different directory.

    /var/run probably doesn't persist from early boot.
    So if necessary, store in in /lib/init/rw or somewhere else
    that does persist.

    Signed-off-by: NeilBrown <neilb@suse.de>

Issue reported in this BZ is not a bug.


Please close this record as NOTABUG.

Comment 4 Doug Ledford 2010-06-16 15:16:40 UTC
To answer Jarema's questions (so that they aren't asked again by someone else):

1) Should the files be stored in /dev/md?

Yes and no.  They don't belong there according to the type of file that they are.  However, these are files that are needed very early in the boot process, long before any other part of the filesystem is mounted read/write, however /dev is always mounted read/write on modern systems because it is a virtual filesystem.  Therefore it is safe to put these files here.  And because they are directly related to the operation of md devices, they somewhat sort of belong in /dev/md.

2) Why are they only sporadically created?

They aren't sporadic, there are very specific rules under which they are created.  The file md-device-map is created any time you run mdadm in incremental assembly mode.  It is used to store state information about what drives have already been found and what arrays they have been attached to.  The *.sock and *.pid files are created by mdmon and are there whenever there is an imsm array that has an attached mdmon process.

And finally, Krzysztof is right, this isn't a bug, so I'm closing this bug report out.

Comment 5 jbielans 2010-08-20 11:39:25 UTC
Not reproducible on RHEL6.0 Snapshot 10 x86_64.

Note You need to log in before you can comment on or make changes to this bug.