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