Bug#849806: mdadm: Administrator should be warned about the dangers of HOMEHOST <system>

Matthew Gabeler-Lee cheetah at fastcat.org
Sat Dec 31 09:48:42 UTC 2016


Package: mdadm
Version: 3.4-4
Severity: normal

I've found, the hard way, that having "HOMEHOST <system>" in mdadm.conf is
... not really safe, unless you list ALL arrays in mdadm.conf.  That of
course means that the arrays are all always present.

In my case, I have arrays that are present in external (read:
semi-removable) storage, so listing them explicitly in mdadm.conf would
cause frequent spurious boot failures -- these arrays are in no way needed
to boot the system.  I rely on udev incremental assembly to bring up these
arrays when they come online, and this works fine for me.

In this scenario, though, HOMEHOST <system> is a bad setting, because if
these arrays ARE present at boot, then they are assembled as foreign arrays
... beacuse the system hostname isn't set yet!  Which means they have the
"wrong" name in /dev/md/ and things go badly.

It seems to me that the administrator should be warned about this in some
way.  Fancy would be to warn if this config setting is in use and there are
arrays present which are not defined in mdadm.conf (NB: the existing logic
for detecting this is ... weak, it is trivially confused by comments for
example).  Less fancy but still useful would be to document this limitation
in mdadm.conf(5).

Snazzy would be to bake the system hostname into the initramfs (Ubuntu seems
to do this as part of the baseline initramfs-tools, but Debian not so much)
so that this problem largely went away.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mdadm depends on:
ii  debconf [debconf-2.0]  1.5.59
ii  libc6                  2.24-8
ii  lsb-base               9.20161125
ii  udev                   232-7

Versions of packages mdadm recommends:
ii  exim4-daemon-light [mail-transport-agent]  4.88~RC6-1
ii  kmod                                       23-1

mdadm suggests no packages.

-- debconf information excluded



More information about the pkg-mdadm-devel mailing list