forked from md-raid-utilities/mdadm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
udev rules: introduce rules for cluster-md to confirm device
For cluster scenario, add device is different with native raid. When a node issues adds a device, then the node will broadcast a message with UUID to other nodes in the cluster. If receiving node can find the device with the specific UUID, it must confirm the device, otherwise reports it is missing. Signed-off-by: Guoqing Jiang <[email protected]> Signed-off-by: Jes Sorensen <[email protected]>
- Loading branch information
1 parent
3373d49
commit 0e23c59
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# do not edit this file, it will be overwritten on update | ||
|
||
SUBSYSTEM!="block", GOTO="clustermd_end" | ||
|
||
# handle md arrays | ||
KERNEL!="md*", GOTO="clustermd_end" | ||
ENV{DEVTYPE}!="disk", GOTO="clustermd_end" | ||
ACTION!="change", GOTO="clustermd_end" | ||
ENV{EVENT}!="ADD_DEVICE", GOTO="clustermd_end" | ||
ENV{DEVICE_UUID}!="?*", GOTO="clustermd_end" | ||
ENV{RAID_DISK}!="?*", GOTO="clustermd_end" | ||
|
||
# Based on the received UUID, node confirms the device if | ||
# it is found by blkid, otherwise the node reports it is | ||
# missing. | ||
PROGRAM="BINDIR/blkid -o device -t UUID_SUB=$env{DEVICE_UUID}", ENV{.md.newdevice} = "$result" | ||
|
||
ENV{.md.newdevice}!="", RUN+="BINDIR/mdadm --manage $env{DEVNAME} --cluster-confirm $env{RAID_DISK}:$env{.md.newdevice}" | ||
ENV{.md.newdevice}=="", RUN+="BINDIR/mdadm --manage $env{DEVNAME} --cluster-confirm $env{RAID_DISK}:missing" | ||
|
||
LABEL="clustermd_end" |