]> git.ipfire.org Git - thirdparty/systemd.git/blame - extras/multipath/README
[PATCH] more udev-016/extras/multipath
[thirdparty/systemd.git] / extras / multipath / README
CommitLineData
04a091d4
GKH
1Dependancies :
2==============
3
4o libdevmapper : comes with device-mapper-XXXX.tar.gz
5 See www.sistina.com
9107fb88 6 This lib has been dropped in the multipath tree
069bd530 7o libsysfs : comes with sysutils or udev
04a091d4 8 See ftp.kernel.org/pub/linux/utils/kernel/hotplug/
069bd530
CV
9o Linux kernel 2.6.0 with udm5 patchset
10 http://people.sistina.com/~thornber/dm/
cbb576b9
CV
11o udev
12 See ftp.kernel.org/pub/linux/utils/kernel/hotplug/
04a091d4
GKH
13
14How it works :
15==============
16
17Fill the all_paths array. Each path store this info :
18
19struct path {
20 char dev[FILE_NAME_SIZE];
21 char sg_dev[FILE_NAME_SIZE];
22 struct scsi_idlun scsi_id;
23 struct sg_id sg_id;
24 int state;
25 char wwid[WWID_SIZE];
26};
27
28scsi_id, sg_dev and sg_id are only really useful for 2.4
29kernels, for which SG cmnds must go through sg devs.
30In 2.5+ we have the nice opportunity to send SG cmnds
31through SCSI bdevs.
32
33For 2.4 compat, we pivot on idlun tupple to map sg devs
34to SCSI bdevs.
35
362.4 does not do device enumeration, so we must scan a
37defined number of sg devs and scsi bdevs. Good enough.
38In 2.5+, we rely on libsysfs (sysutils) to access to
39sysfs device enums.
40
41the wwid is retrieved by a switch fonction. Only White
9107fb88
CV
42Listed HW can filled this field. For now every FC array
43HW listed in kernel's devinfo.c is White Listed, assuming
44the WWID is stored is the SCSI-3 standard 0x83 EVPD page.
04a091d4
GKH
45
46When all_paths is filled, we coalesce the paths and store
47the result in mp array. Each mp is a struct like this :
48
49struct multipath {
50 char wwid[WWID_SIZE];
51 int npaths;
52 int pindex[MAX_MP_PATHS];
53};
54
55When mp is filled, the device maps are fed to the kernel
9107fb88 56through libdevmapper.
04a091d4 57
cbb576b9
CV
58The naming of the corresponding block device is handeld
59by udev with the help of the devmap_name proggy. It is
60called by the following rule in /etc/udev/udev.rules :
61KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", \
62NAME="%k", SYMLINK="%c"
63
04a091d4
GKH
64Notes :
65=======
66
9107fb88
CV
67o On 2.4, make sure you have enough /dev/sg* nodes
68 (/dev/MAKEDEV if necesary). Same goes for /dev/sd*
04a091d4
GKH
69
70o path coalescing relies on a path unique id being found.
71 This unique id, lacking a standard method, is vendor
72 specific. A switch function (get_unique_id) is present
73 and an example function is provided for storageworks
9107fb88 74 arrays (get_evpd_wwid). Feel free to enrich
04a091d4
GKH
75 with hardware you have at hand :)
76
04a091d4
GKH
77o The kernel does NOT manage properly ghosts paths
78 with StorageWorks HW. Seems nobody cares after a load
79 of posts to linux-scsi.
80
81o 2.4.21 version of DM does not like even segment size.
82 if you enconter pbs with this, upgrade DM.
83
84Credits :
85=========
86
87o Heavy cut'n paste from sg_utils. Thanks goes to D.
88 Gilbert.
89o Light cut'n paste from dmsetup. Thanks Joe Thornber.
90o Greg KH for the nice sysfs API.