[gelöst] mdadm assemble funktioniert beim booten nicht

Hast Du Probleme mit Hardware, die durch die anderen Foren nicht abgedeckt werden? Schau auch in den "Tipps und Tricks"-Bereich.
Antworten
lod
Beiträge: 37
Registriert: 12.01.2010 09:21:55

[gelöst] mdadm assemble funktioniert beim booten nicht

Beitrag von lod » 24.03.2016 10:36:35

Wie gehts, wie stehts?

Hab da ein Problem :D Hab gestern sehr viel gegooglet, aber konkret zu meinem Thema nicht ganz das richtige gefunden. Wäre extrem dankbar, wenn mir jemand helfen könnte, das ganze zu verstehen.

Problem: Beim Booten erkennt mdadm mein RAID6 nicht.

Edit: Ich kann es nicht glauben, ich hab's rausgefunden! Die Lösung war beim mdadm.config den Parameter metadata=0.90 setzten statt 0.9!!! :facepalm:

Eine Null hat's gebracht...wie ironisch :mrgreen:

Code: Alles auswählen

# 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 /dev/sdb
DEVICE /dev/hd*[0-9] /dev/sd*[0-9]

# 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 root

# definitions of existing MD arrays
ARRAY /dev/md/0 level=raid1 num-devices=2 metadata=1.2 name=SRVLO001:0 UUID=4f0259f6:e416eeb7:53d8b535:93fa0c8b
ARRAY /dev/md/1 level=raid1 num-devices=2 metadata=1.2 name=SRVLO001:1 UUID=f55974d8:03b2504a:f4d33838:f2334f6f
ARRAY /dev/md2 level=raid6 num-devices=4 metadata=0.90 UUID=a3037800:f2c6d7c0:e612f9f7:185d199e

# This configuration was auto-generated on Thu, 10 Mar 2016 20:08:58 +0100 by mkconf
Ich lasse das alte Zeugs mal noch bestehen, evtl. hilfts ja jemandem...

Alter Beitrag:
Jedoch

Code: Alles auswählen

mdadm --assemble /dev/md2 --uuid=a3037800:f2c6d7c0:e612f9f7:185d199e --verbose
klappt.

Ziel: Beim Booten wird auch das RAID6 korrekt erkannt und alles läuft super.

Komisch ist, wenn ich folgende Eingaben unmittelbar nacheinander vornehme:

Code: Alles auswählen

root@SRVLO001:/home/lod# mdadm --assemble /dev/md2 --scan --verbose
mdadm: looking for devices for /dev/md2
mdadm: no RAID superblock on /dev/sdh2
mdadm: no RAID superblock on /dev/sdh1
mdadm: no RAID superblock on /dev/sdg2
mdadm: no RAID superblock on /dev/sdg1
mdadm: no RAID superblock on /dev/sdf1
mdadm: no RAID superblock on /dev/sde1
mdadm: no RAID superblock on /dev/sdd1
mdadm: no RAID superblock on /dev/sdc1
root@SRVLO001:/home/lod# mdadm --assemble /dev/md2 --uuid=a3037800:f2c6d7c0:e612f9f7:185d199e --verbose
mdadm: looking for devices for /dev/md2
mdadm: /dev/sdh2 has wrong uuid.
mdadm: /dev/sdh1 has wrong uuid.
mdadm: /dev/sdg2 has wrong uuid.
mdadm: /dev/sdg1 has wrong uuid.
mdadm: /dev/sdf1 is identified as a member of /dev/md2, slot 3.
mdadm: /dev/sde1 is identified as a member of /dev/md2, slot 2.
mdadm: /dev/sdd1 is identified as a member of /dev/md2, slot 1.
mdadm: /dev/sdc1 is identified as a member of /dev/md2, slot 0.
mdadm: added /dev/sdd1 to /dev/md2 as 1
mdadm: added /dev/sde1 to /dev/md2 as 2
mdadm: added /dev/sdf1 to /dev/md2 as 3
mdadm: added /dev/sdc1 to /dev/md2 as 0
mdadm: /dev/md2 has been started with 4 drives.
oder

Code: Alles auswählen

mdadm --assemble /dev/md2 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 --verbose
dmesg:

Code: Alles auswählen

[ 6169.989538] md: bind<sdd1>
[ 6169.989764] md: bind<sde1>
[ 6169.996183] md: bind<sdf1>
[ 6169.996428] md: bind<sdc1>
[ 6169.997963] md/raid:md2: device sdc1 operational as raid disk 0
[ 6169.997966] md/raid:md2: device sdf1 operational as raid disk 3
[ 6169.997968] md/raid:md2: device sde1 operational as raid disk 2
[ 6169.997970] md/raid:md2: device sdd1 operational as raid disk 1
[ 6169.998500] md/raid:md2: allocated 0kB
[ 6169.998592] md/raid:md2: raid level 6 active with 4 out of 4 devices, algorithm 2
[ 6169.998594] RAID conf printout:
[ 6169.998596]  --- level:6 rd:4 wd:4
[ 6169.998598]  disk 0, o:1, dev:sdc1
[ 6169.998600]  disk 1, o:1, dev:sdd1
[ 6169.998601]  disk 2, o:1, dev:sde1
[ 6169.998603]  disk 3, o:1, dev:sdf1
[ 6169.998615] md2: Warning: Device sdf1 is misaligned
[ 6169.998658] md2: detected capacity change from 0 to 2000404086784
[ 6170.016074]  md2: unknown partition table


Wobei /dev/sdg* und /dev/sdh* zur Systempartition gehören und somit logisch, die falsche UID haben:

Code: Alles auswählen

root@SRVLO001:/home/lod# lsblk
NAME                                MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                   8:0    0 931.5G  0 disk  
sdb                                   8:16   0 931.5G  0 disk  
sdc                                   8:32   0 931.5G  0 disk  
└─sdc1                                8:33   0 931.5G  0 part  
  └─md2                               9:2    0   1.8T  0 raid6 
    └─vg--raid_dev02-raid_data      253:3    0   1.8T  0 lvm   /mnt/raid_data
sdd                                   8:48   0 931.5G  0 disk  
└─sdd1                                8:49   0 931.5G  0 part  
  └─md2                               9:2    0   1.8T  0 raid6 
    └─vg--raid_dev02-raid_data      253:3    0   1.8T  0 lvm   /mnt/raid_data
sde                                   8:64   0 931.5G  0 disk  
└─sde1                                8:65   0 931.5G  0 part  
  └─md2                               9:2    0   1.8T  0 raid6 
    └─vg--raid_dev02-raid_data      253:3    0   1.8T  0 lvm   /mnt/raid_data
sdf                                   8:80   0 931.5G  0 disk  
└─sdf1                                8:81   0 931.5G  0 part  
  └─md2                               9:2    0   1.8T  0 raid6 
    └─vg--raid_dev02-raid_data      253:3    0   1.8T  0 lvm   /mnt/raid_data
sdg                                   8:96   0  93.2G  0 disk  
├─sdg1                                8:97   0   476M  0 part  
│ └─md0                               9:0    0 475.7M  0 raid1 /boot
└─sdg2                                8:98   0  90.3G  0 part  
  └─md1                               9:1    0  90.3G  0 raid1 
    ├─vg--system-lv----system--root 253:0    0  23.3G  0 lvm   /
    ├─vg--system-lv----system--swap 253:1    0  59.6G  0 lvm   [SWAP]
    └─vg--system-lv----system--home 253:2    0   4.7G  0 lvm   /home
sdh                                   8:112  0  93.2G  0 disk  
├─sdh1                                8:113  0   476M  0 part  
│ └─md0                               9:0    0 475.7M  0 raid1 /boot
└─sdh2                                8:114  0  90.3G  0 part  
  └─md1                               9:1    0  90.3G  0 raid1 
    ├─vg--system-lv----system--root 253:0    0  23.3G  0 lvm   /
    ├─vg--system-lv----system--swap 253:1    0  59.6G  0 lvm   [SWAP]
    └─vg--system-lv----system--home 253:2    0   4.7G  0 lvm   /home

Code: Alles auswählen

root@SRVLO001:/home/lod# mdadm --detail --scan --verbose
ARRAY /dev/md/0 level=raid1 num-devices=2 metadata=1.2 name=SRVLO001:0 UUID=4f0259f6:e416eeb7:53d8b535:93fa0c8b
   devices=/dev/sdg1,/dev/sdh1
ARRAY /dev/md/1 level=raid1 num-devices=2 metadata=1.2 name=SRVLO001:1 UUID=f55974d8:03b2504a:f4d33838:f2334f6f
   devices=/dev/sdg2,/dev/sdh2
ARRAY /dev/md2 level=raid6 num-devices=4 metadata=0.90 UUID=a3037800:f2c6d7c0:e612f9f7:185d199e
   devices=/dev/sdc1,/dev/sdd1,/dev/sde1,/dev/sdf1
Hier noch die dazugehörige mdadm.conf:

Code: Alles auswählen

root@SRVLO001:/home/lod# 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 /dev/sdb
DEVICE /dev/hd*[0-9] /dev/sd*[0-9]

# 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 root

# definitions of existing MD arrays
#ARRAY /dev/md/0  metadata=1.2 UUID=4f0259f6:e416eeb7:53d8b535:93fa0c8b name=SRVLO001:0
#ARRAY /dev/md/1  metadata=1.2 UUID=f55974d8:03b2504a:f4d33838:f2334f6f name=SRVLO001:1
#ARRAY /dev/md2	 metadata=0.9 UUID=a3037800:f2c6d7c0:e612f9f7:185d199e


ARRAY /dev/md/0 level=raid1 num-devices=2 metadata=1.2 name=SRVLO001:0 UUID=4f0259f6:e416eeb7:53d8b535:93fa0c8b
ARRAY /dev/md/1 level=raid1 num-devices=2 metadata=1.2 name=SRVLO001:1 UUID=f55974d8:03b2504a:f4d33838:f2334f6f
ARRAY /dev/md2 level=raid6 num-devices=4 metadata=0.9 UUID=a3037800:f2c6d7c0:e612f9f7:185d199e

# This configuration was auto-generated on Thu, 10 Mar 2016 20:08:58 +0100 by mkconf
-> Es gehen beide Varianten icht.

/dev/sda und /dev/sdb sind noch nicht im Gebrauch. Die eine sollte dann mal das RAID6 erweitern und die andere beim RAID6 als Spare dienen. Im Moment möchte ich aber das aktuelle Problem lösen.

mdstat meldet dann:

Code: Alles auswählen

root@SRVLO001:/home/lod# cat /proc/mdstat 
Personalities : [raid1] [raid6] [raid5] [raid4] 
md2 : active (auto-read-only) raid6 sdc1[0] sdf1[3] sde1[2] sdd1[1]
      1953519616 blocks level 6, 1024k chunk, algorithm 2 [4/4] [UUUU]
      
md1 : active raid1 sdg2[0] sdh2[1]
      94660608 blocks super 1.2 [2/2] [UU]
      
md0 : active raid1 sdg1[0] sdh1[1]
      487104 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>
Wie übrigens diese wild durcheinandergewürfelten /dev/sdx Bezeichnungen zustande kamen, keine Ahnung. Ist mit aber auch nicht so wichtig.

Geschichte:
  • Ich hab mir vor kurzem einen neuen PC zugelegt.
  • Mein alter PC hatte ein RAID1 (zwei Platten) für das System und ein RAID5 mit 3 Platten und einer Spare.
  • Mein neues System hat wiederum ein RAID1 (zwei neue Platten) für das System.
  • Dann hab ich im alten System die 3 RAID5 Platten inkl. Spare ausgebaut und im neuen eingebaut und die UUID aus dem alten mdadm.config für das RAID5 kopiert.
  • Anfänglich erkannte das System beim Booten das RAID5 ebenfalls nicht. Nach dem Eintragen der Device-Zeile

    Code: Alles auswählen

    DEVICE /dev/hd*[0-9] /dev/sd*[0-9]
    
    in der mdadm.config, gings dann aber
  • Dann hab ich über Webmin ein Reshaping auf RAID6 gemacht und die Sparedisk aus dem alten PC als 4. Platten anfügen lassen
Ich hab zwar ein Backup und als letzte Option sehe ich das komplett neu erstellen des RAIDs. Jedoch gurkt es mich an, die ganzen Daten wieder zurückzukopieren, da das RAID ja eigentlich läuft, nur beim Booten irgendwie nicht. Nach dem erfolgreichen assemble kann ich dann auch das LVM aktivieren und das ganze mounten, ohne Probleme.

Irgendwo hab ich gelesen, dass man mit einem

Code: Alles auswählen

mdadm --create...
ein bestehendes RAID ebenfalls wieder erstellen kann. Dann soll auch der Superblock wieder geschrieben werden. Da ich jedoch schon so viel nachgelesen hab, bin ich mir nicht mehr sicher, was ich genau eingeben muss. Zudem kann ich mir nicht vorstellen, dass es daran liegt, da ich bei folgender Ausgabe nichts ungewöhnliches erkennen kann:

Code: Alles auswählen

root@SRVLO001:/home/lod# mdadm --examine /dev/sd[cdef]1 | grep Magic
          Magic : a92b4efc
          Magic : a92b4efc
          Magic : a92b4efc
          Magic : a92b4efc

root@SRVLO001:/home/lod# mdadm --examine /dev/sd[cdef]1 | grep UUID
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
oder im Detail:

Code: Alles auswählen

root@SRVLO001:/home/lod# mdadm --examine /dev/sd[cdef]1
/dev/sdc1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
  Creation Time : Wed Mar 11 11:38:47 2009
     Raid Level : raid6
  Used Dev Size : 976759808 (931.51 GiB 1000.20 GB)
     Array Size : 1953519616 (1863.02 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2

    Update Time : Thu Mar 24 09:59:04 2016
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 1867b784 - correct
         Events : 477994

         Layout : left-symmetric
     Chunk Size : 1024K

      Number   Major   Minor   RaidDevice State
this     0       8       33        0      active sync   /dev/sdc1

   0     0       8       33        0      active sync   /dev/sdc1
   1     1       8       49        1      active sync   /dev/sdd1
   2     2       8       65        2      active sync   /dev/sde1
   3     3       8       81        3      active sync   /dev/sdf1
/dev/sdd1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
  Creation Time : Wed Mar 11 11:38:47 2009
     Raid Level : raid6
  Used Dev Size : 976759808 (931.51 GiB 1000.20 GB)
     Array Size : 1953519616 (1863.02 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2

    Update Time : Thu Mar 24 09:59:04 2016
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 1867b796 - correct
         Events : 477994

         Layout : left-symmetric
     Chunk Size : 1024K

      Number   Major   Minor   RaidDevice State
this     1       8       49        1      active sync   /dev/sdd1

   0     0       8       33        0      active sync   /dev/sdc1
   1     1       8       49        1      active sync   /dev/sdd1
   2     2       8       65        2      active sync   /dev/sde1
   3     3       8       81        3      active sync   /dev/sdf1
/dev/sde1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
  Creation Time : Wed Mar 11 11:38:47 2009
     Raid Level : raid6
  Used Dev Size : 976759808 (931.51 GiB 1000.20 GB)
     Array Size : 1953519616 (1863.02 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2

    Update Time : Thu Mar 24 09:59:04 2016
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 1867b7a8 - correct
         Events : 477994

         Layout : left-symmetric
     Chunk Size : 1024K

      Number   Major   Minor   RaidDevice State
this     2       8       65        2      active sync   /dev/sde1

   0     0       8       33        0      active sync   /dev/sdc1
   1     1       8       49        1      active sync   /dev/sdd1
   2     2       8       65        2      active sync   /dev/sde1
   3     3       8       81        3      active sync   /dev/sdf1
/dev/sdf1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
  Creation Time : Wed Mar 11 11:38:47 2009
     Raid Level : raid6
  Used Dev Size : 976759808 (931.51 GiB 1000.20 GB)
     Array Size : 1953519616 (1863.02 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2

    Update Time : Thu Mar 24 09:59:04 2016
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 1867b7ba - correct
         Events : 477994

         Layout : left-symmetric
     Chunk Size : 1024K

      Number   Major   Minor   RaidDevice State
this     3       8       81        3      active sync   /dev/sdf1

   0     0       8       33        0      active sync   /dev/sdc1
   1     1       8       49        1      active sync   /dev/sdd1
   2     2       8       65        2      active sync   /dev/sde1
   3     3       8       81        3      active sync   /dev/sdf1
Die ID's sind meiner Meinung nach auch korrekt:

Code: Alles auswählen

root@SRVLO001:/home/lod# blkid
/dev/sdc1: UUID="a3037800-f2c6-d7c0-e612-f9f7185d199e" TYPE="linux_raid_member" PARTUUID="515d7f00-01"
/dev/sdd1: UUID="a3037800-f2c6-d7c0-e612-f9f7185d199e" TYPE="linux_raid_member" PARTUUID="e2913e65-01"
/dev/sdf1: UUID="a3037800-f2c6-d7c0-e612-f9f7185d199e" TYPE="linux_raid_member"
/dev/sde1: UUID="a3037800-f2c6-d7c0-e612-f9f7185d199e" TYPE="linux_raid_member" PARTUUID="37e3e137-01"
/dev/sdh1: UUID="4f0259f6-e416-eeb7-53d8-b53593fa0c8b" UUID_SUB="c7a9946a-bf03-db4b-2d62-64bb3945c92c" LABEL="SRVLO001:0" TYPE="linux_raid_member" PARTUUID="6954256b-01"
/dev/sdh2: UUID="f55974d8-03b2-504a-f4d3-3838f2334f6f" UUID_SUB="defd9a5e-1c8a-f14a-77e0-2146ef42e0bf" LABEL="SRVLO001:1" TYPE="linux_raid_member" PARTUUID="6954256b-02"
/dev/sdg1: UUID="4f0259f6-e416-eeb7-53d8-b53593fa0c8b" UUID_SUB="75d4a3c0-0b59-a504-2021-14fdbf84239b" LABEL="SRVLO001:0" TYPE="linux_raid_member" PARTUUID="047a7db9-01"
/dev/sdg2: UUID="f55974d8-03b2-504a-f4d3-3838f2334f6f" UUID_SUB="adce7691-2751-eeb6-c1cd-2b168bdf2092" LABEL="SRVLO001:1" TYPE="linux_raid_member" PARTUUID="047a7db9-02"
/dev/md0: LABEL="boot" UUID="4ce4559e-0a74-4748-8faa-e184da04347d" TYPE="ext4"
/dev/md1: UUID="nQ96o7-A3R6-4HHV-a18n-7RqQ-k2e0-Rp90uf" TYPE="LVM2_member"
/dev/mapper/vg--system-lv----system--root: LABEL="root" UUID="04c5f907-4c87-44e1-8857-809b94ee0bb0" TYPE="ext4"
/dev/mapper/vg--system-lv----system--swap: UUID="a6efba32-b68b-439b-bb8a-2ff5b5235011" TYPE="swap"
/dev/mapper/vg--system-lv----system--home: LABEL="home" UUID="6c944a43-348f-4b55-b5df-3c94bef323fe" TYPE="ext4"
/dev/md2: UUID="k5oNSJ-UHh8-lPjO-0Qzo-NdNh-p1dM-uKkYIZ" TYPE="LVM2_member"
und der Superblock ist ebenfalls OK(?), wobei --examine und --details unterschiedliche Werte liefert:

Code: Alles auswählen

root@SRVLO001:/home/lod# mdadm --detail /dev/md2
/dev/md2:
        Version : 0.90
  Creation Time : Wed Mar 11 11:38:47 2009
     Raid Level : raid6
     Array Size : 1953519616 (1863.02 GiB 2000.40 GB)
  Used Dev Size : 976759808 (931.51 GiB 1000.20 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Thu Mar 24 09:59:04 2016
          State : clean 
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 1024K

           UUID : a3037800:f2c6d7c0:e612f9f7:185d199e
         Events : 0.477994

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       49        1      active sync   /dev/sdd1
       2       8       65        2      active sync   /dev/sde1
       3       8       81        3      active sync   /dev/sdf1

Code: Alles auswählen

root@SRVLO001:/home/lod# mdadm --examine /dev/md2
mdadm: No md superblock detected on /dev/md2.
Was noch zu erwähnen ist, ich hatte die /dev/sdf zuvor mit einer falschen Partition eingebunden. Die hab ich korrigiert, indem ich folgendes machte:

Code: Alles auswählen

mdadm --manage /dev/md2 --fail /dev/sdf1
mdadm --manage /dev/md2 --remove /dev/sdf1
dd if=/dev/zero of=/dev/sdf
sfdisk -d /dev/sdc | sfdisk /dev/sdf
mdadm --manage /dev/md2 --add /dev/sdf1
Einen

Code: Alles auswählen

--zero-superblock
hab ich zwar vergessen, sollte aber durch den dd sowieso gelöscht worden sein, oder?

Aber selbst danach, ist auf dem /dev/sdf angeblich kein Superblock vorhanden.

Kann mir nun jemand sagen, wieso dieses RAID beim Start nicht gestartet wird?

Ich wäre überglücklich, wenn das Ding endlich zum laufen gebracht werden kann. Ich bezweifle irgendwie, dass dies auch selbst nach einem erneuten erstellen des RAID-Verbundes alles klappen sollte.

Was ich mir eventuell noch vorstellen könnte, wäre es möchlich, dass man nicht unterschiedliche Metadata-Versionen mischen kann in der mdadm.conf?

Vielen Dank jetzt scho für einen Hinweis, wo ich weitersuchen soll.

Gruss

Antworten