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

Bug#754298: partman-auto-raid cannot handle more than 10 md devices



Package: partman-auto-raid
Version: 26
Severity: normal
Tags: d-i patch

If you try to run partman-auto-raid to set up an md device on a system that
has more than 10 md devices, it fails to assemble one of the devices with an
error that md10 already exists.

This has already been reported in the Ubuntu bugtracker, but seems not to have
been pushed upstream:

https://bugs.launchpad.net/ubuntu/+source/partman-auto-raid/+bug/1096220

It occurs because the md numbers are sorted lexicographically rather than
numerically when allocating the next number.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.14-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/auto-raidcfg b/auto-raidcfg
index 24c24c1..01722c1 100755
--- a/auto-raidcfg
+++ b/auto-raidcfg
@@ -51,7 +51,7 @@ create_raid() {
 
 	# Find the next available md-number
 	MD_NUM=$(grep ^md /proc/mdstat | sed -e 's/^md\(.*\) : active .*/\1/' | \
-		sort | tail -n 1)
+		sort -n | tail -n 1)
 	if [ -z "$MD_NUM" ]; then
 		MD_NUM=0
 	else

Reply to: