Bug#806900: partman-multipath: correct mpath device detection and bindings

2016-11-19 Thread Cyril Brulebois
Hi,

Hendrik Brueckner  (2015-12-16):
> It's fine to defer them to a follw-up release.  I have continued to
> work on the multipath stuff and I will provide a summary of what I
> think needs to be integrated.  Briefly, there are some additional
> changes on top of those which I'd like to discuss with you and the
> community. 

Sorry it took so long to get back to you, but it seems I'm slowly
crawling through the few thousands unread mails on debian-boot@.

It would be nice if we could tackle multipath issues at some point,
please let me know how I can help.


KiBi.


signature.asc
Description: Digital signature


Bug#806900: partman-multipath: correct mpath device detection and bindings

2015-12-16 Thread Hendrik Brueckner
Hi Cyril!

On Wed, Dec 16, 2015 at 12:06:01AM +0100, Cyril Brulebois wrote:
> Mathieu Trudel-Lapierre  (2015-12-02):
> > > Mathieu mentioned branches a while ago:
> > >   https://lists.debian.org/debian-boot/2015/05/msg00271.html
> > >
> > >
> > That's spot on, it's exactly what is needed in partman-multipath.
> 
> OK.
> 
> > Still, shouldn't we also copy over the wwids file from the installer onto
> > the target?
> 
> I'll let Hendrik follow up on that.
> 
> > hw-detect needs a similar change, which I've already done at [1], and some
> > changes for the output of multipath -l in partman-base at [2].
> > 
> > [1]
> > http://anonscm.debian.org/cgit/d-i/hw-detect.git/commit/?h=people/cyphermox/mpath-detect
> > [2]
> > http://anonscm.debian.org/cgit/d-i/partman-base.git/log/?h=people/cyphermox/multipath5
> 
> OK. Unfortunately I haven't been able to spend sufficient time on d-i
> lately so I'm afraid the 3 patchsets will have to wait until after the
> upcoming release.

It's fine to defer them to a follw-up release.  I have continued to work on
the multipath stuff and I will provide a summary of what I think needs to be
integrated.  Briefly, there are some additional changes on top of those which
I'd like to discuss with you and the community. 

Thanks a lot!

Kind regards,
  Hendrik


pgpFmTvZPuCqP.pgp
Description: PGP signature


Bug#806900: partman-multipath: correct mpath device detection and bindings

2015-12-15 Thread Cyril Brulebois
Hi,

Mathieu Trudel-Lapierre  (2015-12-02):
> > Mathieu mentioned branches a while ago:
> >   https://lists.debian.org/debian-boot/2015/05/msg00271.html
> >
> >
> That's spot on, it's exactly what is needed in partman-multipath.

OK.

> Still, shouldn't we also copy over the wwids file from the installer onto
> the target?

I'll let Hendrik follow up on that.

> hw-detect needs a similar change, which I've already done at [1], and some
> changes for the output of multipath -l in partman-base at [2].
> 
> [1]
> http://anonscm.debian.org/cgit/d-i/hw-detect.git/commit/?h=people/cyphermox/mpath-detect
> [2]
> http://anonscm.debian.org/cgit/d-i/partman-base.git/log/?h=people/cyphermox/multipath5

OK. Unfortunately I haven't been able to spend sufficient time on d-i
lately so I'm afraid the 3 patchsets will have to wait until after the
upcoming release.

Since we have a few things to wait on (glibc), I might push the needed
bits to master so that they are ready for the next time.

Mraw,
KiBi.


signature.asc
Description: Digital signature


Bug#806900: partman-multipath: correct mpath device detection and bindings

2015-12-02 Thread Hendrik Brueckner
Package: partman-multipath
Version: 4
Severity: important
Tags: d-i patch

Dear Maintainers,

the partman-multipath installer modules does not detect multipath devices
because the multipath alias names have been changed.  Also the location of
the bindings file has been changed and, therefore, correct its location in
the post-base-installer script.

Below you can find a patch that solves both problems.  Feedback is welcome.

Thanks!

Kind regards,
  Hendrik
>From d4c73caff072a79bd6e4428480fc34951ca6d84c Mon Sep 17 00:00:00 2001
From: Hendrik Brueckner 
Date: Thu, 26 Nov 2015 17:29:11 +0100
Subject: [PATCH 1/2] multipath: update check for mpath device and bindings

The mulitpath-tools use different alias names and store their
bindings in in the /etc/multipath/ directory.  This commit
changes detection of mpath devices and mulitpath configuration
accordingly.

The alias names for user friendly names have been changed from
mpath[0-9] to mpath[a-z] since 2008.  So update all mpath checkings
to use new alias naming scheme.

See also
https://anonscm.debian.org/cgit/pkg-lvm/multipath-tools.git/commit/?id=81716d6fe5ccf220e320e168391817810645c3b4

The location of the bindings file which maps the alias names to
particular wwn's also changed.  The bindings file moved from
the /var/lib/multipath/ directory to the /etc/multipath/ directory.

The bindings file is required to successfully map an multipath alias
always to the same SCSI disk.  Without these bindings, for example,
the device with the root file system might appear as a different mpathX
device after an reboot.

See also
https://anonscm.debian.org/cgit/pkg-lvm/multipath-tools.git/commit/?id=8ee04831d2535a5afcf5dd40a27e2645ec0b7ffa

Signed-off-by: Hendrik Brueckner 
---
 init.d/multipath_flag | 2 +-
 post-base-installer.d/60multipath | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/init.d/multipath_flag b/init.d/multipath_flag
index 862765f..fdd32aa 100755
--- a/init.d/multipath_flag
+++ b/init.d/multipath_flag
@@ -7,7 +7,7 @@ for dev in /var/lib/partman/devices/*; do
cd $dev
 
[ -f device ] || continue
-   for frdisk in $(multipath -l | grep '^mpath[0-9]\+ ' | sed 
's/\(mpath[0-9]\+\) .*/\1/'); do
+   for frdisk in $(multipath -l | grep '^mpath[a-z]\+ ' | sed 
's/\(mpath[a-z]\+\) .*/\1/'); do
case $(cat device) in
/dev/mapper/$frdisk)
>multipath
diff --git a/post-base-installer.d/60multipath 
b/post-base-installer.d/60multipath
index cb21b60..35169fe 100755
--- a/post-base-installer.d/60multipath
+++ b/post-base-installer.d/60multipath
@@ -2,7 +2,7 @@
 
 set -e
 
-if [ $(multipath -l | grep '^mpath[0-9]\+' | wc -l) -eq 0 ]; then
+if [ $(multipath -l | grep '^mpath[a-z]\+' | wc -l) -eq 0 ]; then
exit 0
 fi
 
@@ -13,9 +13,9 @@ if [ -r /etc/multipath.conf ]; then
 fi
 
 # copy over the persistent binding
-if [ -r /var/lib/multipath/bindings ]; then
-   mkdir -p /target/var/lib/multipath
-   cp /var/lib/multipath/bindings /target/var/lib/multipath/
+if [ -r /etc/multipath/bindings ]; then
+   mkdir -p /target/etc/multipath
+   cp /etc/multipath/bindings /target/etc/multipath
 fi
 
 # the initramfs will be updated by the kernel installation
-- 
2.6.2



Bug#806900: partman-multipath: correct mpath device detection and bindings

2015-12-02 Thread Mathieu Trudel-Lapierre
On Wed, Dec 2, 2015 at 6:51 PM, Cyril Brulebois  wrote:

> Hi,
>

[...]


> > Below you can find a patch that solves both problems.  Feedback is
> welcome.
>
> Mathieu mentioned branches a while ago:
>   https://lists.debian.org/debian-boot/2015/05/msg00271.html
>
>
That's spot on, it's exactly what is needed in partman-multipath.

Still, shouldn't we also copy over the wwids file from the installer onto
the target?

hw-detect needs a similar change, which I've already done at [1], and some
changes for the output of multipath -l in partman-base at [2].

[1]
http://anonscm.debian.org/cgit/d-i/hw-detect.git/commit/?h=people/cyphermox/mpath-detect
[2]
http://anonscm.debian.org/cgit/d-i/partman-base.git/log/?h=people/cyphermox/multipath5

Mathieu Trudel-Lapierre 
Freenode: cyphermox, Jabber: mathieu...@gmail.com
4096R/DC95CA5A 36E2 CF22 B077 FEFE 725C  80D3 C7DA A946 DC95 CA5A


Bug#806900: partman-multipath: correct mpath device detection and bindings

2015-12-02 Thread Cyril Brulebois
Hi,

Hendrik Brueckner  (2015-12-02):
> Package: partman-multipath
> Version: 4
> Severity: important
> Tags: d-i patch
> 
> Dear Maintainers,
> 
> the partman-multipath installer modules does not detect multipath devices
> because the multipath alias names have been changed.  Also the location of
> the bindings file has been changed and, therefore, correct its location in
> the post-base-installer script.
> 
> Below you can find a patch that solves both problems.  Feedback is welcome.

Mathieu mentioned branches a while ago:
  https://lists.debian.org/debian-boot/2015/05/msg00271.html

He also told me some more changes were needed when we met in Heidelberg
IIRC but I'm not certain, so I'm adding him to the loop so that he can
comment on your proposed changes.

Mraw,
KiBi.

> Thanks!
> 
> Kind regards,
>   Hendrik

> >From d4c73caff072a79bd6e4428480fc34951ca6d84c Mon Sep 17 00:00:00 2001
> From: Hendrik Brueckner 
> Date: Thu, 26 Nov 2015 17:29:11 +0100
> Subject: [PATCH 1/2] multipath: update check for mpath device and bindings
> 
> The mulitpath-tools use different alias names and store their
> bindings in in the /etc/multipath/ directory.  This commit
> changes detection of mpath devices and mulitpath configuration
> accordingly.
> 
> The alias names for user friendly names have been changed from
> mpath[0-9] to mpath[a-z] since 2008.  So update all mpath checkings
> to use new alias naming scheme.
> 
> See also
> https://anonscm.debian.org/cgit/pkg-lvm/multipath-tools.git/commit/?id=81716d6fe5ccf220e320e168391817810645c3b4
> 
> The location of the bindings file which maps the alias names to
> particular wwn's also changed.  The bindings file moved from
> the /var/lib/multipath/ directory to the /etc/multipath/ directory.
> 
> The bindings file is required to successfully map an multipath alias
> always to the same SCSI disk.  Without these bindings, for example,
> the device with the root file system might appear as a different mpathX
> device after an reboot.
> 
> See also
> https://anonscm.debian.org/cgit/pkg-lvm/multipath-tools.git/commit/?id=8ee04831d2535a5afcf5dd40a27e2645ec0b7ffa
> 
> Signed-off-by: Hendrik Brueckner 
> ---
>  init.d/multipath_flag | 2 +-
>  post-base-installer.d/60multipath | 8 
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/init.d/multipath_flag b/init.d/multipath_flag
> index 862765f..fdd32aa 100755
> --- a/init.d/multipath_flag
> +++ b/init.d/multipath_flag
> @@ -7,7 +7,7 @@ for dev in /var/lib/partman/devices/*; do
>   cd $dev
>  
>   [ -f device ] || continue
> - for frdisk in $(multipath -l | grep '^mpath[0-9]\+ ' | sed 
> 's/\(mpath[0-9]\+\) .*/\1/'); do
> + for frdisk in $(multipath -l | grep '^mpath[a-z]\+ ' | sed 
> 's/\(mpath[a-z]\+\) .*/\1/'); do
>   case $(cat device) in
>   /dev/mapper/$frdisk)
>   >multipath
> diff --git a/post-base-installer.d/60multipath 
> b/post-base-installer.d/60multipath
> index cb21b60..35169fe 100755
> --- a/post-base-installer.d/60multipath
> +++ b/post-base-installer.d/60multipath
> @@ -2,7 +2,7 @@
>  
>  set -e
>  
> -if [ $(multipath -l | grep '^mpath[0-9]\+' | wc -l) -eq 0 ]; then
> +if [ $(multipath -l | grep '^mpath[a-z]\+' | wc -l) -eq 0 ]; then
>   exit 0
>  fi
>  
> @@ -13,9 +13,9 @@ if [ -r /etc/multipath.conf ]; then
>  fi
>  
>  # copy over the persistent binding
> -if [ -r /var/lib/multipath/bindings ]; then
> - mkdir -p /target/var/lib/multipath
> - cp /var/lib/multipath/bindings /target/var/lib/multipath/
> +if [ -r /etc/multipath/bindings ]; then
> + mkdir -p /target/etc/multipath
> + cp /etc/multipath/bindings /target/etc/multipath
>  fi
>  
>  # the initramfs will be updated by the kernel installation
> -- 
> 2.6.2


signature.asc
Description: Digital signature