Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Rebuilding a kernel on a hardened gentoo
Date: Fri, 14 Sep 2018 08:15:20
Message-Id: 47EF807A-BBF4-4DC0-BF60-8D429E82C2FE@antarean.org
In Reply to: Re: [gentoo-user] Rebuilding a kernel on a hardened gentoo by "Stefan G. Weichinger"
1 On September 14, 2018 6:34:20 AM UTC, "Stefan G. Weichinger" <lists@×××××.at> wrote:
2 >Am 12.09.18 um 15:07 schrieb J. Roeleveld:
3 >
4 >> Bit sooner:
5 >>
6 >https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/
7 >> dm_multipath/mpio_overview
8 >>
9 >>
10 >https://www.thegeekdiary.com/beginners-guide-to-device-mapper-dm-multipathing/
11 >>
12 >>
13 >> I use multipath from a SAS-controller to a dual-backplane and
14 >SAS-disks.
15 >> From the controller, I have 2 paths to each disk, which means I have
16 >twice the
17 >> amount of "sd?" entries.
18 >>
19 >> ==
20 >> # multipath -l
21 >> 35000cca25d8ec910 dm-4 HGST,HUS726040ALS210
22 >> size=3.6T features='1 retain_attached_hw_handler' hwhandler='0' wp=rw
23 >> |-+- policy='service-time 0' prio=0 status=active
24 >> | `- 0:0:7:0 sdh 8:112 active undef running
25 >> `-+- policy='service-time 0' prio=0 status=enabled
26 >> `- 0:0:20:0 sdt 65:48 active undef running
27 >> ==
28 >> (This is only the first device)
29 >>
30 >> It shows that device "35000cca25d8ec910" is mapped to "sdh" and
31 >"sdt".
32 >> To use the disk correctly, I need to access
33 >"/dev/mapper/35000cca25d8ec910",
34 >> which is:
35 >> # ls -lsa /dev/mapper/35000cca25d8ec910
36 >> 0 lrwxrwxrwx 1 root root 7 Sep 4 11:43 /dev/mapper/35000cca25d8ec910
37 >-> ../
38 >> dm-4
39 >>
40 >> I have "multipathd" in the "boot" runlevel.
41 >>
42 >> Version info:
43 >> # eix -I multipath
44 >> [I] sys-fs/multipath-tools
45 >> Available versions: 0.5.0-r1 0.6.4-r1{tbz2} ~0.7.6^t ~0.7.7^t
46 >{rbd
47 >> systemd KERNEL="linux"}
48 >> Installed versions: 0.6.4-r1{tbz2}(10:51:01 AM
49 >01/23/2018)(-rbd -
50 >> systemd)
51 >> Homepage: http://christophe.varoqui.free.fr/
52 >> Description: Device mapper target autoconfig
53 >>
54 >> # uname -a
55 >> Linux san1 4.9.76-gentoo-r1-generic #1 SMP Tue Jan 23 12:05:11 CET
56 >2018 x86_64
57 >> Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz GenuineIntel GNU/Linux
58 >>
59 >> As for the terms, a LUN is a Logical disk provided by a SAN to a
60 >different
61 >> system. I have multipath inside my SAN and have a single path to
62 >iSCSI
63 >> clients. (Single switch with bonded NICs)
64 >
65 >thanks for the links etc
66 >
67 >To me it seems that the former administrator somehow tried to set that
68 >up but failed.
69 >
70 >This corresponds to something he wrote when leaving the company.
71 >
72 >There is no multipathd-daemon enabled or running.
73 >
74 ># multipath
75 >Sep 14 08:31:10 | MSA2040_SAMBA_storage: ignoring map
76 >Sep 14 08:31:10 | MSA2040_SAMBA_storage: ignoring map
77 >
78 ># multipath -l
79 >#
80 >
81 ># ls /dev/mapper/
82 >control
83 >
84 >
85 >so nothing gets mapped here ;-)
86 >
87 >-
88 >
89 ># /etc/multipath.conf
90 >
91 >defaults {
92 ># udev_dir /dev
93 > polling_interval 15
94 ># selector "round-robin 0"
95 > path_grouping_policy group_by_prio
96 > failback 5
97 > path_checker tur
98 ># prio_callout "/sbin/mpath_prio_tpc /dev/%n"
99 > rr_min_io 100
100 > rr_weight uniform
101 > no_path_retry queue
102 > user_friendly_names yes
103 >}
104 >blacklist {
105 > devnode cciss
106 > devnode fd
107 > devnode hd
108 > devnode md
109 > devnode sr
110 > devnode scd
111 > devnode st
112 > devnode ram
113 > devnode raw
114 > devnode loop
115 > devnode sda
116 > devnode sdb
117 >}
118 >
119 >multipaths {
120 > multipath {
121 > wwid 3600c0ff0001e91b2c1bae25601000000
122 >## To find your wwid, please use /usr/bin/sg_vpd --page=di /dev/DEVICE.
123 > ## The address will be a 0x6. Remove the 0x and replace it with 3.
124 > alias MSA2040_SAMBA_storage
125 > }
126 >}
127 >
128 >
129 >--- I will check docs etc asap
130 >That is a productive server a few 100 kms away from me, so I have to be
131 >
132 >careful.
133 >
134 >Users can work, so no hurry here, just interest.
135
136 You really want to be at the server or at least have some kind of access to the keyboard and screen to coordinate booting to a different environment before enabling multipath.
137
138 You need to change all the devices from whatever they are now to the multipath versions, which is best done when booted into a live-environment instead of the actual production one.
139
140 The idea is:
141 Disk(/dev/sd?) - (multipathd) - virtual (/dev/mapper/???) - (filesystem)
142
143 If the current system is pointing at /dev/sd?, you are bypassing multipathing.
144
145 Also, important and should be obvious, the kernel must have multipath support enabled in de device-mapper section.
146
147 I was able to get it all working before doing the rest of the system.
148 On my system, I didn't have to change the default configuration of multipath as it autodetects which sd?'s are pointing to the same disc due to serial numbers and ZFS is happy to sit on top of that.
149
150 --
151 Joost
152 --
153 Sent from my Android device with K-9 Mail. Please excuse my brevity.