summaryrefslogtreecommitdiffstats
path: root/70-anaconda.rules
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-03-11 23:18:09 -0500
committerDavid Lehman <dlehman@redhat.com>2009-03-12 10:50:57 -0500
commitd1bacca5c6922532b85c1e6f6fceae45f1453e40 (patch)
tree5d27f0391bbb75c21704543a9588c5fc1646bb56 /70-anaconda.rules
parente4cd790b81531c9814a4e15374a9f49f73f0487d (diff)
downloadanaconda-d1bacca5c6922532b85c1e6f6fceae45f1453e40.tar.gz
anaconda-d1bacca5c6922532b85c1e6f6fceae45f1453e40.tar.xz
anaconda-d1bacca5c6922532b85c1e6f6fceae45f1453e40.zip
Add udev rules for handling for mdraid arrays.
This will enable us to detect filesystems or other formatting on md arrays.
Diffstat (limited to '70-anaconda.rules')
-rw-r--r--70-anaconda.rules28
1 files changed, 26 insertions, 2 deletions
diff --git a/70-anaconda.rules b/70-anaconda.rules
index e379a22bd..363f7ae3b 100644
--- a/70-anaconda.rules
+++ b/70-anaconda.rules
@@ -1,7 +1,7 @@
ACTION!="add|change", GOTO="anaconda_end"
SUBSYSTEM!="block", GOTO="anaconda_end"
-KERNEL!="dm-*", GOTO="anaconda_raid_probe"
+KERNEL!="dm-*", GOTO="anaconda_mdraid"
IMPORT{program}="/usr/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded -j%M -m%m"
ENV{DM_NAME}!="?*", GOTO="anaconda_end"
@@ -15,8 +15,32 @@ IMPORT{program}="vol_id --export $tempnode"
OPTIONS="link_priority=-100"
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
-LABEL="anaconda_raid_probe"
+LABEL="anaconda_mdraid"
+KERNEL!="md*", GOTO="anaconda_mdraid_member"
+
+# container devices have a metadata version of e.g. 'external:ddf' and
+# never leave state 'inactive'
+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state"
+TEST!="md/array_state", GOTO="anaconda_mdraid_member"
+ATTR{md/array_state}=="|clear|inactive", GOTO="anaconda_mdraid_member"
+LABEL="md_ignore_state"
+
+IMPORT{program}="/usr/sbin/mdadm --detail --export $tempnode"
+ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
+ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
+ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
+ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace"
+ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n"
+ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n"
+ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n"
+IMPORT{program}="vol_id --export $tempnode"
+OPTIONS+="link_priority=100"
+OPTIONS+="watch"
+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
+
+LABEL="anaconda_mdraid_member"
# probe raid metadata of mdraid member devices
ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/usr/sbin/mdadm --examine --export $tempnode"