Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Untitled
Wednesday, March 19th, 2008 at 5:42:54pm UTC 

  1. #
  2. # persistent links for device-mapper devices
  3. # only hardware-backed device-mapper devices (ie multipath, dmraid,
  4. # and kpartx) have meaningful persistent device names
  5. #
  6.  
  7. # Always attempt to load dm-multipath. This way we can get rid of the
  8. # init script.
  9. ACTION=="add|change", SUBSYSTEM=="block", \
  10.          RUN+="/sbin/modprobe -Qba dm-multipath"
  11.  
  12. KERNEL!="dm-*", GOTO="kpartx_end"
  13. ACTION=="remove", GOTO="kpartx_end"
  14.  
  15. ENV{DM_TABLE_STATE}!="LIVE", GOTO="kpartx_end"
  16.  
  17. ENV{DM_UUID}=="?*", IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}"
  18.  
  19. OPTIONS="link_priority=50"
  20.  
  21. # Create persistent links for multipath tables
  22. ENV{DM_UUID}=="mpath-*", \
  23.         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
  24.  
  25. # Create persistent links for dmraid tables
  26. ENV{DM_UUID}=="dmraid-*", \
  27.         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
  28.  
  29. # Create persistent links for partitions
  30. ENV{DM_PART}=="?*", \
  31.         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}"
  32.  
  33. # Create dm tables for partitions
  34. ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="mpath-*", \
  35.         RUN+="echo %N > /tmp/yay"
  36. ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="mpath-*", \
  37.         RUN+="touch /tmp/hoh"
  38. ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="mpath-*", \
  39.         RUN+="/sbin/kpartx -a -p -part /dev/%N"
  40. ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="dmraid-*", \
  41.         RUN+="/sbin/kpartx -a -p -part /dev/%N"
  42.  
  43. LABEL="kpartx_end"

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right