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