linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* invalid (zero) superblock magic upon creation of a new RAID-1 array
@ 2006-11-05  8:57 Thomas Andrews
  2006-11-05 22:17 ` Neil Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Andrews @ 2006-11-05  8:57 UTC (permalink / raw)
  To: linux-raid

Hi

Why would the superblock magic be zero on a newly created RAID-1 set?

I get this error when the kernel (2.6.17.7) boots:

    md: Autodetecting RAID arrays.
    md: invalid raid superblock magic on sda1, found 0x0 not 0xa92b4efc
    md: sda1 has invalid sb, not importing!
    md: invalid raid superblock magic on sda2, found 0x0 not 0xa92b4efc
    md: sda2 has invalid sb, not importing!
    md: invalid raid superblock magic on sdb1, found 0x0 not 0xa92b4efc
    md: sdb1 has invalid sb, not importing!
    md: invalid raid superblock magic on sdb2, found 0x0 not 0xa92b4efc
    md: sdb2 has invalid sb, not importing!
    md: autorun ...
    md: ... autorun DONE.

(I modified md.c so that it prints out "found xxxx not 0xa92b4efc")

I have a monolithic kernel, compiled for RAID-1.

Once the system is up and running, mdadm brings up the RAID arrays fine:

    # cat /proc/mdstat
    Personalities : [raid1] 
    md1 : active raid1 sda2[0] sdb2[1]
          506036 blocks super 1.0 [2/2] [UU]
          
    md0 : active raid1 sda1[0]
          312062456 blocks super 1.0 [2/1] [U_]
          
    unused devices: <none>

It is deliberately degraded, so that I can boot until I fix this problem.

    # dpkg -l mdadm | grep mdadm
    ii  mdadm  2.5.3.git200608202239-7 tool to administer Linux MD arrays (software RAID)

I've re-created the RAID set a couple of times just to make sure that I
did it correctly. Here's how:

    mdadm -C /dev/md0 --level=raid1 --raid-devices=2  /dev/sda1 missing

As I understand it, this can't be an issue with my config files, because
the error occurs *before* the filesystem is mounted.

    # fdisk -l /dev/sd[a-z]

    Disk /dev/sda: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       38850   312062593+  fd  Linux raid autodetect
    /dev/sda2           38851       38913      506047+  fd  Linux raid autodetect

    Disk /dev/sdb: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1       38850   312062593+  fd  Linux raid autodetect
    /dev/sdb2           38851       38913      506047+  fd  Linux raid autodetect

Some info about the (brand new) disks:

    # hdparm -I /dev/sda

    ATA device, with non-removable media
            Model Number:       WDC WD3200YS-01PGB0                     
            Serial Number:      WD-WCAPD2664999
            Firmware Revision:  21.00M21
    Standards:
            Supported: 7 6 5 4 
            Likely used: 7
    Configuration:
            Logical         max     current
            cylinders       16383   16383
            heads           16      16
            sectors/track   63      63
            --
            CHS current addressable sectors:   16514064
            LBA    user addressable sectors:  268435455
            LBA48  user addressable sectors:  625142448
            device size with M = 1024*1024:      305245 MBytes
            device size with M = 1000*1000:      320072 MBytes (320 GB)


Many thanks,
Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: invalid (zero) superblock magic upon creation of a new RAID-1 array
  2006-11-05  8:57 invalid (zero) superblock magic upon creation of a new RAID-1 array Thomas Andrews
@ 2006-11-05 22:17 ` Neil Brown
  2006-11-06  6:42   ` Thomas Andrews
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2006-11-05 22:17 UTC (permalink / raw)
  To: Thomas Andrews; +Cc: linux-raid

On Sunday November 5, tandrews@grok.co.za wrote:
> Hi
> 
> Why would the superblock magic be zero on a newly created RAID-1 set?
> 
> I get this error when the kernel (2.6.17.7) boots:
> 
>     md: Autodetecting RAID arrays.
>     md: invalid raid superblock magic on sda1, found 0x0 not 0xa92b4efc
>     md: sda1 has invalid sb, not importing!
>     md: invalid raid superblock magic on sda2, found 0x0 not 0xa92b4efc
>     md: sda2 has invalid sb, not importing!
>     md: invalid raid superblock magic on sdb1, found 0x0 not 0xa92b4efc
>     md: sdb1 has invalid sb, not importing!
>     md: invalid raid superblock magic on sdb2, found 0x0 not 0xa92b4efc
>     md: sdb2 has invalid sb, not importing!
>     md: autorun ...
>     md: ... autorun DONE.
> 
> (I modified md.c so that it prints out "found xxxx not 0xa92b4efc")
> 
> I have a monolithic kernel, compiled for RAID-1.
> 
> Once the system is up and running, mdadm brings up the RAID arrays fine:
> 
>     # cat /proc/mdstat
>     Personalities : [raid1] 
>     md1 : active raid1 sda2[0] sdb2[1]
>           506036 blocks super 1.0 [2/2] [UU]
                          ^^^^^^^^^

in-kernel autodetect (based on partition types FD) only works for
version 0.90 superblocks.

You mdadm to assemble the array, it is more flexible than auto-detect.

NeilBrown

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: invalid (zero) superblock magic upon creation of a new RAID-1 array
  2006-11-05 22:17 ` Neil Brown
@ 2006-11-06  6:42   ` Thomas Andrews
  2006-11-06 20:20     ` Nix
  2006-11-07  4:57     ` Neil Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Andrews @ 2006-11-06  6:42 UTC (permalink / raw)
  To: linux-raid; +Cc: Neil Brown

On Mon, Nov 06, 2006 at 09:17:26AM +1100, Neil Brown wrote:

> On Sunday November 5, tandrews@grok.co.za wrote:

> > Why would the superblock magic be zero on a newly created RAID-1 set?
> > 
> > I get this error when the kernel (2.6.17.7) boots:
> > 
> >     md: Autodetecting RAID arrays.
> >     md: invalid raid superblock magic on sda1, found 0x0 not 0xa92b4efc
> >     md: sda1 has invalid sb, not importing!
> >     md: invalid raid superblock magic on sda2, found 0x0 not 0xa92b4efc
> >     md: sda2 has invalid sb, not importing!
> >     md: invalid raid superblock magic on sdb1, found 0x0 not 0xa92b4efc
> >     md: sdb1 has invalid sb, not importing!
> >     md: invalid raid superblock magic on sdb2, found 0x0 not 0xa92b4efc
> >     md: sdb2 has invalid sb, not importing!
> >     md: autorun ...
> >     md: ... autorun DONE.
> > 
> > (I modified md.c so that it prints out "found xxxx not 0xa92b4efc")
> > 
> > I have a monolithic kernel, compiled for RAID-1.
> > 
> > Once the system is up and running, mdadm brings up the RAID arrays fine:
> > 
> >     # cat /proc/mdstat
> >     Personalities : [raid1] 
> >     md1 : active raid1 sda2[0] sdb2[1]
> >           506036 blocks super 1.0 [2/2] [UU]
>                           ^^^^^^^^^
> 
> in-kernel autodetect (based on partition types FD) only works for
> version 0.90 superblocks.
> 
> You mdadm to assemble the array, it is more flexible than auto-detect.

Thanks Neil, I fixed my problem by creating the raid set using the "-e"
option:

    mdadm -C /dev/md0 -e 0.90 --level=raid1 --raid-devices=2  /dev/sda1 /dev/sdb1

You're suggestion to use mdadm to assemble the array is not an option
for me because it is the root partition that is raided, but thanks for
putting me in the right direction.

Regards,
Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: invalid (zero) superblock magic upon creation of a new RAID-1 array
  2006-11-06  6:42   ` Thomas Andrews
@ 2006-11-06 20:20     ` Nix
  2006-11-07  4:57     ` Neil Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Nix @ 2006-11-06 20:20 UTC (permalink / raw)
  To: Thomas Andrews; +Cc: linux-raid, Neil Brown

On 6 Nov 2006, Thomas Andrews uttered the following:
> Thanks Neil, I fixed my problem by creating the raid set using the "-e"
> option:
>
>     mdadm -C /dev/md0 -e 0.90 --level=raid1 --raid-devices=2  /dev/sda1 /dev/sdb1
>
> You're suggestion to use mdadm to assemble the array is not an option
> for me because it is the root partition that is raided, but thanks for
> putting me in the right direction.

You can still use mdadm to assemble root filesystems: you just need
an initramfs or initrd to do the work before / is mounted. (As a
bonus you can fsck it before it's mounted, as well.)

Most distros have tools that can do this for you, or you can do it by
hand (see e.g. <http://linux-raid.osdl.org/index.php/RAID_Boot>).

-- 
`When we are born we have plenty of Hydrogen but as we age our
 Hydrogen pool becomes depleted.'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: invalid (zero) superblock magic upon creation of a new RAID-1 array
  2006-11-06  6:42   ` Thomas Andrews
  2006-11-06 20:20     ` Nix
@ 2006-11-07  4:57     ` Neil Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Neil Brown @ 2006-11-07  4:57 UTC (permalink / raw)
  To: Thomas Andrews; +Cc: linux-raid

On Monday November 6, tandrews@grok.co.za wrote:
> On Mon, Nov 06, 2006 at 09:17:26AM +1100, Neil Brown wrote:
> > You mdadm to assemble the array, it is more flexible than auto-detect.
> 
> Thanks Neil, I fixed my problem by creating the raid set using the "-e"
> option:
> 
>     mdadm -C /dev/md0 -e 0.90 --level=raid1 --raid-devices=2  /dev/sda1 /dev/sdb1
> 
> You're suggestion to use mdadm to assemble the array is not an option
> for me because it is the root partition that is raided, but thanks for
> putting me in the right direction.

You can use mdadm to assemble the root partition with suitable
initramfs magic, and I gather most distributions use initramfs (or
initrd) by default now.  But getting the magic to work isn't always as
straight forward as you would like.

You solution is should work fine so stick with it.

NeilBrown

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-07  4:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-05  8:57 invalid (zero) superblock magic upon creation of a new RAID-1 array Thomas Andrews
2006-11-05 22:17 ` Neil Brown
2006-11-06  6:42   ` Thomas Andrews
2006-11-06 20:20     ` Nix
2006-11-07  4:57     ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).