You are not logged in.

#1 2011-02-21 18:43:37

emphire
Member
From: Canada
Registered: 2007-03-21
Posts: 203

[SOLVED] md raid1 problems

I created some md raid1 arrays and I've been having a lot of problems with my systems since.  Pleas let me know if you have any ideas or can point me in the right direction...

The creation of the raid seemed to go fine but it won't start on boot:

$ dmesg  | grep 'md:'
md: raid1 personality registered for level 1
md: md0 stopped.
md: invalid raid superblock magic on sda
md: sda does not have a valid v0.90 superblock, not importing!
md: md_import_device returned -22
md: invalid raid superblock magic on sda
md: sda does not have a valid v0.90 superblock, not importing!
md: md_import_device returned -22
md: md1 stopped.
md: sda does not have a valid v1.2 superblock, not importing!
md: md_import_device returned -22
md: sda does not have a valid v1.2 superblock, not importing!
md: md_import_device returned -22
md: md2 stopped.
md: sda does not have a valid v1.2 superblock, not importing!
md: md_import_device returned -22
md: sda does not have a valid v1.2 superblock, not importing!
md: md_import_device returned -22
md: md2 stopped.
md: bind<sdb3>
md: bind<sda3>
md: md1 stopped.
md: bind<sdb2>
md: bind<sda2>
md: md0 stopped.
md: bind<sdb1>
md: bind<sda1>

but once the machine has booted, I am able to assemble the md arrays with no problems:

$ sudo mdadm --assemble /dev/md1 /dev/sda2 /dev/sdb2
mdadm: /dev/md1 has been started with 2 drives.

sudo mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1
mdadm: /dev/md0 has been started with 2 drives.
   
$ sudo mdadm --assemble /dev/md2 /dev/sda3 /dev/sdb3
mdadm: /dev/md2 has been started with 2 drives.

$ cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda3[0] sdb3[1]
      191636575 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
      52427704 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sda1[0] sdb1[1]
      131008 blocks [2/2] [UU]

unused devices: <none>

$ sudo mdadm --misc --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Fri Feb 18 15:35:53 2011
     Raid Level : raid1
     Array Size : 131008 (127.96 MiB 134.15 MB)
  Used Dev Size : 131008 (127.96 MiB 134.15 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Mon Feb 21 10:33:24 2011
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : 8723b36a:a5c18aba:855774c4:31e91d18 (local to host ghost)
         Events : 0.18

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

$ sudo mdadm --misc --detail /dev/md1
/dev/md1:
        Version : 1.2
  Creation Time : Fri Feb 18 15:37:58 2011
     Raid Level : raid1
     Array Size : 52427704 (50.00 GiB 53.69 GB)
  Used Dev Size : 52427704 (50.00 GiB 53.69 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Sun Feb 20 15:50:57 2011
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : ghost:1  (local to host ghost)
           UUID : a756d08f:fdeb0785:23f1d679:e67b3843
         Events : 17

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2

$ sudo mdadm --misc --detail /dev/md2
/dev/md2:
        Version : 1.2
  Creation Time : Fri Feb 18 15:38:25 2011
     Raid Level : raid1
     Array Size : 191636575 (182.76 GiB 196.24 GB)
  Used Dev Size : 191636575 (182.76 GiB 196.24 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Sun Feb 20 19:42:07 2011
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : ghost:2  (local to host ghost)
           UUID : 73a0324e:01636a0e:d00565d8:ecadbfb6
         Events : 19

    Number   Major   Minor   RaidDevice State
       0       8        3        0      active sync   /dev/sda3
       1       8       19        1      active sync   /dev/sdb3

I am getting a few strange errors during boot that I did not get before adding the md arrays.  They only quickly flash on the screen during the bootup process as the machine is loading so I can't make them out that well and they don't seem to show-up in my logs.  I'm assuming they are related:

  • An error about not being able to mount proc (although it seems to be mounted after boot).

  • A segmentation fault when mounting the filesystems.

  • /etc/mtab gets permissions of 500 so du doesn't work for non-root users.

  • du reports partitions incorrectly and shows /dev as being mounted twice.

Here is the info:

$ df
df: cannot read table of mounted file systems: Permission denied

$ sudo df
Filesystem           1K-blocks      Used Available Use% Mounted on
udev                   2027796       268   2027528   1% /dev
none                   2027796       268   2027528   1% /dev
shm                    2027796         0   2027796   0% /dev/shm

$ sudo chmod a+r /etc/mtab

$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
udev                   2027796       268   2027528   1% /dev
none                   2027796       268   2027528   1% /dev
shm                    2027796         0   2027796   0% /dev/shm

$ cat /proc/partitions
major minor  #blocks  name

   8        0  244198584 sda
   8        1     131072 sda1
   8        2   52428800 sda2
   8        3  191637671 sda3
   8       32 1953514584 sdc
   8       33 1953513472 sdc1
   8       16  244198584 sdb
   8       17     131072 sdb1
   8       18   52428800 sdb2
   8       19  191637671 sdb3
   9        0     131008 md0
   9        1   52427704 md1
   9        2  191636575 md2
   8       48 1953512448 sdd
   8       49 1953511407 sdd1

Last edited by emphire (2011-02-23 18:26:15)

Offline

#2 2011-02-22 00:23:03

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] md raid1 problems

To enable the raid in boot sequence you need to setup mdadm.conf and run mkinitcpio procedure.

Check the raid wiki data for mdadm for the exact commands.

That will auto assemble and enable your raid in boot.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2011-02-22 03:59:55

Fruity
Member
Registered: 2009-12-16
Posts: 198

Re: [SOLVED] md raid1 problems

I seem to recall that you have to specify --metadata=0.90 if you plan to put the boot partition on raid. Needs to be specified when the array is created.

Offline

#4 2011-02-22 08:34:34

emphire
Member
From: Canada
Registered: 2007-03-21
Posts: 203

Re: [SOLVED] md raid1 problems

I checked and mdadm is in my mkinitcpio.conf HOOKS.  I re-ran mkinitcpio for good measure and it now assembles my md partitions on boot and set-up a 0.9 metadata /boot parition.  I'm still getting two /dev mounts though.  Is this normal?

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc1             1.8T  964G  778G  56% /
udev                  2.0G  268K  2.0G   1% /dev
none                  2.0G  268K  2.0G   1% /dev
shm                   2.0G     0  2.0G   0% /dev/shm
/dev/md2              180G  658M  171G   1% /newarch
/dev/md0              124M   27M   91M  23% /newarch/boot
$ grep HOOKS /etc/mkinitcpio.conf
HOOKS="base udev pata scsi sata usbinput keymap mdadm filesystems"

$ sudo mkinitcpio -g /boot/kernel26.img 
:: Begin build
:: Parsing hook [base]
:: Parsing hook [udev]
:: Parsing hook [pata]
:: Parsing hook [scsi]
:: Parsing hook [sata]
:: Parsing hook [usbinput]
:: Parsing hook [keymap]
:: Parsing hook [mdadm]
Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays.
:: Parsing hook [filesystems]
:: Generating module dependencies
:: Generating image '/boot/kernel26.img'...SUCCESS

Offline

#5 2011-02-23 18:25:52

emphire
Member
From: Canada
Registered: 2007-03-21
Posts: 203

Re: [SOLVED] md raid1 problems

It seems to be working now.  I'm guessing it has something to do with this bug: https://bugs.archlinux.org/task/10061.  Thanks for your suggestions!

Offline

Board footer

Powered by FluxBB