[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#537928: marked as done ($NAMED_SPARES is miscounted (breaks auto-raid when using more than 1 spare))



Your message dated Wed, 26 Aug 2009 12:17:06 +0000
with message-id <E1MgHR4-0004Fo-PJ@ries.debian.org>
and subject line Bug#537928: fixed in partman-auto-raid 15
has caused the Debian Bug report #537928,
regarding $NAMED_SPARES is miscounted (breaks auto-raid when using more than 1 spare)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
537928: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537928
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: partman-auto-raid
Version: 14

I'm preseed installing using two spares. The auto-raidcfg script is
not properly counting spares resulting in mdadm error (fatal).

tty0: (in red)

  An unexpected error occurred while setting up a preseeded RAID
  configuration.

  Check /var/log/syslog or see virtual console 4 for the details.

syslog:

  partman-auto-raid: Selected spare count: 1
  partman-auto-raid: Spare devices count: 2
  partman-auto-raid: mdadm: You have listed more devices (5) than are in
    the array(4)!
  partman-auto-raid: Error creating array /dev/md0


my preseed.cfg partman-auto-raid rule looks as follows:
d-i partman-auto-raid/recipe string \
    1 2 2 ext3 /                    \
          /dev/sda1#/dev/sdb1       \
          /dev/sdc1#/dev/sdd1       \
    .

Basically spares are counted (with wc) before they are split on '#'.

Below is a patch (tested) to fix this behavior:

--- auto-raidcfg        2008-08-09 14:26:07.000000000 -0500
+++ auto-raidcfg.FIXED  2009-07-20 15:08:29.474764832 -0500
@@ -24,12 +24,14 @@
        DEVICES="$6"
        SPARE_DEVICES="$7"
 
-       NAMED_SPARES=$(echo $SPARE_DEVICES | wc -w)
-
        RAID_DEVICES=$(echo $DEVICES | sed -e "s/#/ /g")
 
        SPARE_DEVICES=$(echo $SPARE_DEVICES | sed -e "s/#/ /g")
 
+       # fixed - needs to run after splitting SPARE_DEVICES
+       NAMED_SPARES=$(echo $SPARE_DEVICES | wc -w)
+
+
        if [ "$RAID_TYPE" != "0" ]; then
                # Count them
                SELECTED=$(echo $RAID_DEVICES | wc -w)


To work around this problem without rebuilding installer packages,
I'm running following script from inittab to replace auto-raidcfg
(I placed it into initrd along with preseed.cfg and /bin/auto-raidcfg.fixed):

/bin/fix-auto-raidcfg:

  #!/bin/sh

  /bin/echo -n "waiting for /bin/auto-raidcfg to appear: ";
  while [ ! -e /bin/auto-raidcfg ]; do
    /bin/sleep 1;
    /bin/echo -n ".";
  done;

  /bin/echo "";

  /bin/mv /bin/auto-raidcfg.fixed /bin/auto-raidcfg
  /bin/echo "*** replaced /bin/auto-raidcfg with a fixed version"

  /bin/echo -n "sleeping: "
  while true; do
    /bin/echo -n '.';
    sleep 1;
  done;


my initrd's /etc/inittab looks as follows:

  # /etc/inittab
  # busybox init configuration for debian-installer

  # main rc script
  ::sysinit:/sbin/reopen-console /sbin/debian-installer-startup

  # main setup program
  ::respawn:/sbin/reopen-console /sbin/debian-installer

  # convenience shells
  tty2::askfirst:-/bin/sh
  tty3::askfirst:-/bin/sh

  # logging
  tty4::respawn:/usr/bin/tail -f /var/log/syslog

  # fix auto-raidcfg script
  tty5::respawn:/bin/fix-auto-raidcfg

  # Stuff to do before rebooting
  ::ctrlaltdel:/sbin/shutdown > /dev/null 2>&1

  # re-exec init on receipt of SIGHUP/SIGUSR1
  ::restart:/sbin/init


Please let me know if you accept my patch.

Thanks, Michal


ps. Since I'm already modifying auto-raidcfg, I'm using a non-default
    chunk size (not shown in above code). Ability to specify chunk
    size in partman-auto-raid/recipe would be nice... optimal chunk size
    increased sequential IO on my systems by 30%.

-- 
Michal Sabala                               | "There are 10 types of
Research Programmer / System Administrator  | people in the world. Those
LAC/NCDM: University of Illinois at Chicago | who understand binary and
tel. (312)-996-9546                         | those who don't."



--- End Message ---
--- Begin Message ---
Source: partman-auto-raid
Source-Version: 15

We believe that the bug you reported is fixed in the latest version of
partman-auto-raid, which is due to be installed in the Debian FTP archive:

partman-auto-raid_15.dsc
  to pool/main/p/partman-auto-raid/partman-auto-raid_15.dsc
partman-auto-raid_15.tar.gz
  to pool/main/p/partman-auto-raid/partman-auto-raid_15.tar.gz
partman-auto-raid_15_all.udeb
  to pool/main/p/partman-auto-raid/partman-auto-raid_15_all.udeb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 537928@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <cjwatson@debian.org> (supplier of updated partman-auto-raid package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 26 Aug 2009 12:10:53 +0100
Source: partman-auto-raid
Binary: partman-auto-raid
Architecture: source all
Version: 15
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
Description: 
 partman-auto-raid - Allow preseeded RAID installs (udeb)
Closes: 484421 537928
Changes: 
 partman-auto-raid (15) unstable; urgency=low
 .
   [ Max Vozeler ]
   * Count NAMED_SPARES after splitting on #, fixes use of
     more than one spare. Patch by Michal Sabala. (closes: #537928)
 .
   [ Frans Pop ]
   * Remove myself as uploader.
 .
   [ Colin Watson ]
   * Add the ability to preseed LVM over RAID. Based almost entirely on work
     done by Jérémy Bobbio, with corrections by Philippe Le Brouster and
     myself (closes: #484421).
 .
   [ Updated translations ]
   * Asturian (ast.po) by Marcos Antonio Alvarez Costales
   * Bengali (bn.po) by Md. Rezwan Shahid
   * Czech (cs.po) by Miroslav Kure
   * Esperanto (eo.po) by Felipe Castro
   * Estonian (et.po) by Mattias Põldaru
   * Basque (eu.po) by Piarres Beobide
   * Galician (gl.po) by marce villarino
   * Hindi (hi.po)
   * Italian (it.po) by Milo Casagrande
   * Kazakh (kk.po) by Dauren Sarsenov
   * Malayalam (ml.po) by Praveen Arimbrathodiyil
   * Marathi (mr.po) by Sampada
   * Tagalog (tl.po) by Eric Pareja
Checksums-Sha1: 
 97f6b60fe420b1085f759f5df70dada3d2a17634 930 partman-auto-raid_15.dsc
 24f88847edaca24c241e709eb3a6789734c03c0e 36262 partman-auto-raid_15.tar.gz
 93b4460ef2c793754008b53d66527ff7bffe872a 17438 partman-auto-raid_15_all.udeb
Checksums-Sha256: 
 c2b8eae2231c3f25fc322f96a3e6fd7988662e7533c8cd5c7bb9a51c293a2a6d 930 partman-auto-raid_15.dsc
 389055d1885ef6e427f3f692e3f467040405525f9fb60109936a4623bb467875 36262 partman-auto-raid_15.tar.gz
 3ab7b8e93552ad800ed18ba2d9b82993ae3cd3de106cbed9b90529f2186b4238 17438 partman-auto-raid_15_all.udeb
Files: 
 a820c4b5e8f5c95e272e8186dafe02e3 930 debian-installer standard partman-auto-raid_15.dsc
 e390025126c1e6e08f167ef811a5f901 36262 debian-installer standard partman-auto-raid_15.tar.gz
 6d363ead6c09bbb248f6aa1d2c1c0ccd 17438 debian-installer standard partman-auto-raid_15_all.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Colin Watson <cjwatson@debian.org> -- Debian developer

iD8DBQFKlSSu9t0zAhD6TNERAsPcAJ9ziYy/pRYrH/uITUSGUDAghugaewCfa/SX
h3p2bVdi/b4fO0oJdZ2gGKw=
=Im8E
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: