LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   [PATCH] initrd.img : probe md devices with dynamic minor number. (http://www.linuxquestions.org/questions/slackware-14/%5Bpatch%5D-initrd-img-probe-md-devices-with-dynamic-minor-number-4175432261/)

polch 10-15-2012 03:52 AM

[PATCH] initrd.img : probe md devices with dynamic minor number.
 
Hi.

The raid arrays with dynamic minor number will be hardly identified for installation. For instance if we create the raid array with
Code:

mdadm --create /dev/md/home --level 1 --raid-devices 2 /dev/sda2 /dev/sdb2
the devices won't be visible in the installer.

I don't know if i'm on the right track, but here is a suggestion for the probe script of the initrd.img.

Code:

--- sbin/probe.bak      2012-10-15 10:24:50.058021543 +0200
+++ sbin/probe  2012-10-15 10:15:26.972019923 +0200
@@ -142,7 +142,13 @@
 
 list_md() {
  if ( is_swap "/dev/$2" ); then TYPE="Linux swap"; else TYPE="Linux"; fi
-  echo "/dev/$2  1 2 $1 kk $TYPE" >> $TMP/SeTfdisk
+  ARRAY_NAME=`mdadm --detail /dev/$2 | grep "Name : " | sed -e "s/ *Name : //"`
+  if [ "$ARRAY_NAME" = "" ]; then
+    ARRAY_NAME="$2"
+  else
+    ARRAY_NAME="md/$ARRAY_NAME"
+  fi
+  echo "/dev/$ARRAY_NAME  1 2 $1 kk $TYPE" >> $TMP/SeTfdisk
 }
 
 list_lvm() {

P.S. : The purpose of these messages is not so much to solve a personal problem, but try to find an official way of doing an "out of the box working" raid installation. The history of messages for this problem :
Install on raid setup and /dev/md127
http://www.linuxquestions.org/questi...ab-4175431267/
RAID howto discussion on the slackdocs ml

mRgOBLIN 10-18-2012 02:46 PM

Thanks polch.

Noted and added to my Todo list.

polch 10-19-2012 01:25 AM

I thank you for dealing with this problem.

However, I'm not sure about my solution.


All times are GMT -5. The time now is 11:05 AM.