LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How can I change super-minor number of a software raid array meta 1.2? (https://www.linuxquestions.org/questions/linux-server-73/how-can-i-change-super-minor-number-of-a-software-raid-array-meta-1-2-a-4175490458/)

narnie 01-07-2014 02:38 PM

How can I change super-minor number of a software raid array meta 1.2?
 
I had a double failure while I was away on the holidays of my array. As I was saving the data, I created a new array on a new drive has /dev/md1.

The original data was on an array listed created as /dev/md0, which I prefer.

How can I change my minor number of the raid back to /dev/md0? When it boots, it is recognized as /dev/md1.

I have read forums and tried various thing like updating assembling the array in this fashion to try to rewrite the superblock to no avail:

Code:

mdadm --assemble /dev/md0 --super-minor=0 --uuid=c35876ca:13e90c31:dc40c61c:eccfa279
Current array info:

Code:

dell-desktop ~ # mdadm -Es
ARRAY /dev/md/1 metadata=1.2 UUID=c35876ca:13e90c31:dc40c61c:eccfa279 name=dell-desktop:1

Code:

dell-desktop ~ # mdadm -E /dev/sdb6
/dev/sdb6:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
    Array UUID : c35876ca:13e90c31:dc40c61c:eccfa279
          Name : dell-desktop:1  (local to host dell-desktop)
  Creation Time : Mon Jan  6 19:44:05 2014
    Raid Level : raid1
  Raid Devices : 2

 Avail Dev Size : 1898729472 (905.38 GiB 972.15 GB)
    Array Size : 949364544 (905.38 GiB 972.15 GB)
  Used Dev Size : 1898729088 (905.38 GiB 972.15 GB)
    Data Offset : 262144 sectors
  Super Offset : 8 sectors
          State : clean
    Device UUID : 521142b5:2385b1b6:08f36e23:be4ae276

    Update Time : Tue Jan  7 13:57:21 2014
      Checksum : 19503e2a - correct
        Events : 575


  Device Role : Active device 1
  Array State : AA ('A' == active, '.' == missing)

Code:

dell-desktop ~ # cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sda6[0] sdb6[2]
      949364544 blocks super 1.2 [2/2] [UU]
     
unused devices: <none>

Any help is kindly appreciated

narnie 01-07-2014 06:06 PM

Don't know if this is the proper technique to do it or not, but I modified my /etc/mdadm/mdadm.conf file to look like this:

Code:

dell-desktop ~ $ cat /etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR nathan.wood805@gmail.com

# definitions of existing MD arrays

# This file was auto-generated on Mon, 18 Feb 2013 16:52:46 -0600
# by mkconf 3.2.5-3
ARRAY /dev/md/1 metadata=1.2 UUID=c35876ca:13e90c31:dc40c61c:eccfa279 name=dell-desktop:1

Changing to this:

Code:

dell-desktop ~ $ cat /etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR nathan.wood805@gmail.com

# definitions of existing MD arrays

# This file was auto-generated on Mon, 18 Feb 2013 16:52:46 -0600
# by mkconf 3.2.5-3
ARRAY /dev/md0 metadata=1.2 UUID=c35876ca:13e90c31:dc40c61c:eccfa279 name=dell-desktop:1

When I rebooted, it was automatically assembled as /dev/md0. If there is a way to modify the superblock to make the minor number 0, I would prefer that, so if anyone has that solution, please post to this thread. I put the above technique in this thread so someone can get it to work at least this way.


All times are GMT -5. The time now is 08:24 PM.