Bug#344617: userspace incorrectly detects RAID (d-i)

Elliott Mitchell ehem at m5p.com
Sat Dec 24 03:44:57 UTC 2005


Package: mdadm
Version: 1.9.0-4
Severity: important

This was with the 20050322 Binary-1 minimal install CD, so the version
might now be right. This might also be considered a Debian-Installer
problem, or the RAID udeb...

When using alternative partitioning schemes (Sun disklabel here), the
userspace RAID partition detection incorrectly identifies existing
partitions. Specifically, the userspace detection can misdetect the
existance of a RAID setup on the whole-disk slices if the last partition
on disk has RAID labels.

output of fdisk -l:
Disk /dev/sd (Sun disk label): 64 heads, 32 sectors, 2060 cylinders
Units = cylinders of 2048 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/sd1              0       183    187392   fd  Linux raid autodetect
/dev/sd2           1159      1403    249856   fd  Linux raid autodetect
/dev/sd3              0      2060   2109440    5  Whole disk
/dev/sd4            183       915    749568   fd  Linux raid autodetect
/dev/sd5           1403      1525    124928   fd  Linux raid autodetect
/dev/sd6            915      1159    249856   fd  Linux raid autodetect
/dev/sd7           1525      2060    547840   fd  Linux raid autodetect

Would result in detection of md0 on sd?1, md1 on sd?2, md3 on sd?4,
md4 on sd?5, and md5 on sd?6.

md2 also gets detected on sd?3, while it fails to detect the set on sd?7.
If the RAID levels for md0 and md6 disagree, this can result in massive
data loss on one or both filesystems. Specifically running e2fsck on md0
prior to telling the kernel md2 (RAID-5) is incorrect will destroy md0
(RAID-1).

BSD disklabels and SGI disklabels can almost certainly result in similar
problems. The correct thing would be to check the partition type, but
looking for overlapping partitions would also work.

I do not feel I can justify a higher severity due to the relative rarity
of the partition type, but this is a data destruction bug (backups save
the day).


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         EHeM at gremlin.m5p.com PGP 8881EF59         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
    \___\_|_/82 04 A1 3C C7 B1 37 2A*E3 6E 84 DA 97 4C 40 E6\_|_/___/






More information about the pkg-mdadm-devel mailing list