N
N
nonname2013-03-20 14:50:31
System administration
nonname, 2013-03-20 14:50:31

Soft RAID1 loses superblock after reboot

The problem looks something like this:
There is a server with a raid controller (perc H700m) on Ubuntu 12.04, I'm trying to create a software raid 1 on two 3TB disks, separating 2 300GB partitions via gdisk and one 500GB partition on each of the disks, trying to assemble the arrays accordingly.
The first thing that seemed strange, perhaps, is that the controller, in order to connect a single disk, sort of puts it in raid0.

mdadm --create --verbose /dev/md0 --level=1  --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: /dev/sda1 appears to be part of a raid array: level=raid0 devices=0 ctime=Thu Jan  1 03:00:00 1970
mdadm: partition table exists on /dev/sda1 but will be lost or meaningless after creating array
mdadm: Note: this array has metadata at the start and may not be suitable as a boot device.  If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90
mdadm: /dev/sdb1 appears to be part of a raid array: level=raid0 devices=0 ctime=Thu Jan  1 03:00:00 1970
mdadm: partition table exists on /dev/sdb1 but will be lost or meaningless after creating array
mdadm: size set to 314441536K

The same goes for the rest.
The array is created, then I give it through tgt by iscisi.
I add my arrays to /etc/mdadm/mdadm.conf.
ARRAY /dev/md0 UUID=fd798c1c:baf4f1a9:682aab93:740a5f7b
ARRAY /dev/md1 UUID=3a45134d:334b408a:64bcef42:3c7faf9e
ARRAY /dev/md2 UUID=a9e82c0e:384fb9b8:6eed8296:8c7eaab6

Everything works before reboot, after reboot one md2 array starts and starts synchronizing it.
If you do after reboot mdadm -A --verbose /dev/md0 something like:
mdadm: no RAID superblock on /dev/sda1
mdadm: Cannot assemble mbr metadata on /dev/sda1
mdadm: no RAID superblock on /dev/sdb1
mdadm: Cannot assemble mbr metadata on /dev/sdb1

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
snp, 2013-03-20
@nonname

> I add my arrays to /etc/mdadm/mdadm.conf.
It's not obligatory.
1) try

mdadm --zero-superblock /dev/sda1; mdadm --zero-superblock /dev/sdb1

2) create with option
--metadata=1.2

J
jcmvbkbc, 2013-03-20
@jcmvbkbc

The first thing that seemed strange, perhaps, is that the controller, in order to connect a single disk, sort of puts it in raid0.

These partitions were apparently already part of raid0. Make it dd if=/dev/zero of=/dev/sda1 bs=512 count=1 and re-add it to your raid1.

N
nonname, 2013-03-21
@nonname

I figured it out with your help, it was really in the superblock.
mdadm --zero-superblock /dev/sda1 was not done after reboot, but after dd if=/dev/zero of=/dev/sda1 bs=512 count=1 and collecting back a new array with the --metadata=1.2 option, the array was created without messages as before, after reboot though he connected them in the wrong order, he solved it by manually adding correctly assembled arrays to the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question