All of lore.kernel.org
 help / color / mirror / Atom feed
* Swap on /dev/md1 always lost after reboot
@ 2010-03-29  2:21 Joachim Otahal
  2010-03-29  2:32 ` Joachim Otahal
  0 siblings, 1 reply; 6+ messages in thread
From: Joachim Otahal @ 2010-03-29  2:21 UTC (permalink / raw)
  To: Linux-RAID

Machine is:
Debian Lenny, Linux version 2.6.26-2-686 (Debian 2.6.26-21lenny4)
mdadm - v2.6.7.2 - 14th November 2008
2 HD's
/dev/md1 = /, /dev/sda1 /dev/sdb1
/dev/md0 = /home/data, /dev/sda3 /dev/sdb3

They are numbered that way for "historical" reasons, I created /dev/md0 
as data partition first and converted root/boot to RAID1 later.

The problem is:
/dev/md2 = swap, /dev/sda2, /dev/sdb2

I set up md2 (/dev/md2 is already in fstab as swap, the partition type 
is fd on both drives):
mdadm --zero-superblock /dev/sda2
mdadm --zero-superblock /dev/sdb2
mdadm -C /dev/md2 -l 1 -n 2 /dev/sdb2 /dev/sda2
mkswap /dev/md2
swapon -a
free says: swap active, mdstat says:
md2 : active (auto-read-only) raid1 sda2[1] sdb2[0]
       979840 blocks [2/2] [UU]
(no resync=PENDING or other funny stuff)
mdadm --examine --scan shows the md2, /etc/mdadm/mdadm.conf gets updated 
by me.
reboot, and the free says: no swap.

cat /proc/mdstat says: no md2 !
mdadm --examine --scan shows md2, exactely as written in 
/etc/mdadm/mdadm.conf

the longer output:
mdadm --examine /dev/sda2
/dev/sda2:
           Magic : a92b4efc
         Version : 00.90.00
            UUID : d97bc68d:a6bd724d:b66f1fce:677f10ed (local to host 
nearyou)
   Creation Time : Mon Mar 29 03:43:06 2010
      Raid Level : raid1
   Used Dev Size : 979840 (957.04 MiB 1003.36 MB)
      Array Size : 979840 (957.04 MiB 1003.36 MB)
    Raid Devices : 2
   Total Devices : 2
Preferred Minor : 2
     Update Time : Mon Mar 29 03:45:06 2010
           State : clean
  Active Devices : 2
Working Devices : 2
  Failed Devices : 0
   Spare Devices : 0
        Checksum : dec1b89a - correct
          Events : 8
       Number   Major   Minor   RaidDevice State
this     1       8        2        1      active sync   /dev/sda2
    0     0       8       18        0      active sync   /dev/sdb2
    1     1       8        2        1      active sync   /dev/sda2

mdadm --examine /dev/sda2
/dev/sda2:
           Magic : a92b4efc
         Version : 00.90.00
            UUID : d97bc68d:a6bd724d:b66f1fce:677f10ed (local to host 
nearyou)
   Creation Time : Mon Mar 29 03:43:06 2010
      Raid Level : raid1
   Used Dev Size : 979840 (957.04 MiB 1003.36 MB)
      Array Size : 979840 (957.04 MiB 1003.36 MB)
    Raid Devices : 2
   Total Devices : 2
Preferred Minor : 2
     Update Time : Mon Mar 29 03:45:06 2010
           State : clean
  Active Devices : 2
Working Devices : 2
  Failed Devices : 0
   Spare Devices : 0
        Checksum : dec1b89a - correct
          Events : 8
       Number   Major   Minor   RaidDevice State
this     1       8        2        1      active sync   /dev/sda2
    0     0       8       18        0      active sync   /dev/sdb2
    1     1       8        2        1      active sync   /dev/sda2

So the raid is there, it is on the HD, it is consistent and clean, it 
says it's preferred minor is 2 = md2.
It is simply not autodetected at boot time, or not activated, I tried 
that quite a few times now. I can recreate the raid with -C -f and issue 
a --rebuild, swapon -a, everything fine. The other RAID1's on the drives 
work as expected.

What is the trap I am running in here? I have other machines with 
/dev/md1 as swap without such problems. It there some kind of kernel 
option how high autodetect should count in md "Preferred Minor" devices?

kind regards,

Joachim Otahal


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

* Re: Swap on /dev/md1 always lost after reboot
  2010-03-29  2:21 Swap on /dev/md1 always lost after reboot Joachim Otahal
@ 2010-03-29  2:32 ` Joachim Otahal
  2010-03-29  6:33   ` Michael Evans
  0 siblings, 1 reply; 6+ messages in thread
From: Joachim Otahal @ 2010-03-29  2:32 UTC (permalink / raw)
  To: Linux-RAID

Joachim Otahal schrieb:
> free says: swap active, mdstat says:
> md2 : active (auto-read-only) raid1 sda2[1] sdb2[0]
>       979840 blocks [2/2] [UU]
minor correction: the output right after creating the raid + issuing a 
mkswap is
md2 : active raid1 sda2[1] sdb2[0]
       979840 blocks [2/2] [UU]
       [=======>.............]  resync = 37.9% (372480/979840) 
finish=0.1min speed=93120K/sec

and a few second later:
md2 : active raid1 sda2[1] sdb2[0]
       979840 blocks [2/2] [UU]

mdadm.conf updated, but md2 still not there after reboot.

Joachim


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

* Re: Swap on /dev/md1 always lost after reboot
  2010-03-29  2:32 ` Joachim Otahal
@ 2010-03-29  6:33   ` Michael Evans
  2010-03-29 17:32     ` Joachim Otahal
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Evans @ 2010-03-29  6:33 UTC (permalink / raw)
  To: Joachim Otahal; +Cc: Linux-RAID

On Sun, Mar 28, 2010 at 7:32 PM, Joachim Otahal <Jou@gmx.net> wrote:
> Joachim Otahal schrieb:
>>
>> free says: swap active, mdstat says:
>> md2 : active (auto-read-only) raid1 sda2[1] sdb2[0]
>>      979840 blocks [2/2] [UU]
>
> minor correction: the output right after creating the raid + issuing a
> mkswap is
> md2 : active raid1 sda2[1] sdb2[0]
>      979840 blocks [2/2] [UU]
>      [=======>.............]  resync = 37.9% (372480/979840) finish=0.1min
> speed=93120K/sec
>
> and a few second later:
> md2 : active raid1 sda2[1] sdb2[0]
>      979840 blocks [2/2] [UU]
>
> mdadm.conf updated, but md2 still not there after reboot.
>
> Joachim
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Trigger the regeneration of your initrd/initramfs image.  It's
probably got an mdadm.conf that lacks your second device.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Swap on /dev/md1 always lost after reboot
  2010-03-29  6:33   ` Michael Evans
@ 2010-03-29 17:32     ` Joachim Otahal
  2010-04-14 20:13       ` Bill Davidsen
  0 siblings, 1 reply; 6+ messages in thread
From: Joachim Otahal @ 2010-03-29 17:32 UTC (permalink / raw)
  To: Michael Evans; +Cc: Linux-RAID

Michael Evans schrieb:
> On Sun, Mar 28, 2010 at 7:32 PM, Joachim Otahal<Jou@gmx.net>  wrote:
>    
>> Joachim Otahal schrieb:
>>      
>>> free says: swap active, mdstat says:
>>> md2 : active (auto-read-only) raid1 sda2[1] sdb2[0]
>>>       979840 blocks [2/2] [UU]
>>>        
>> minor correction: the output right after creating the raid + issuing a
>> mkswap is
>> md2 : active raid1 sda2[1] sdb2[0]
>>       979840 blocks [2/2] [UU]
>>       [=======>.............]  resync = 37.9% (372480/979840) finish=0.1min
>> speed=93120K/sec
>>
>> and a few second later:
>> md2 : active raid1 sda2[1] sdb2[0]
>>       979840 blocks [2/2] [UU]
>>
>> mdadm.conf updated, but md2 still not there after reboot.
>>
>> Joachim
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>      
> Trigger the regeneration of your initrd/initramfs image.  It's
> probably got an mdadm.conf that lacks your second device.
>
>    
Strike, thank you.

Joachim Otahal

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

* Re: Swap on /dev/md1 always lost after reboot
  2010-03-29 17:32     ` Joachim Otahal
@ 2010-04-14 20:13       ` Bill Davidsen
  0 siblings, 0 replies; 6+ messages in thread
From: Bill Davidsen @ 2010-04-14 20:13 UTC (permalink / raw)
  To: Joachim Otahal; +Cc: Michael Evans, Linux-RAID

Joachim Otahal wrote:
> Michael Evans schrieb:
>> On Sun, Mar 28, 2010 at 7:32 PM, Joachim Otahal<Jou@gmx.net>  wrote:
>>   
>>> Joachim Otahal schrieb:
>>>     
>>>> free says: swap active, mdstat says:
>>>> md2 : active (auto-read-only) raid1 sda2[1] sdb2[0]
>>>>       979840 blocks [2/2] [UU]
>>>>        
>>> minor correction: the output right after creating the raid + issuing a
>>> mkswap is
>>> md2 : active raid1 sda2[1] sdb2[0]
>>>       979840 blocks [2/2] [UU]
>>>       [=======>.............]  resync = 37.9% (372480/979840) 
>>> finish=0.1min
>>> speed=93120K/sec
>>>
>>> and a few second later:
>>> md2 : active raid1 sda2[1] sdb2[0]
>>>       979840 blocks [2/2] [UU]
>>>
>>> mdadm.conf updated, but md2 still not there after reboot.
>>>
>>> Joachim
>>>
>>> -- 
>>> To unsubscribe from this list: send the line "unsubscribe 
>>> linux-raid" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>>      
>> Trigger the regeneration of your initrd/initramfs image.  It's
>> probably got an mdadm.conf that lacks your second device.
>>
>>    
> Strike, thank you.
>
> Joachim Otahal

My thought was that you didn't change the partition type to 
"raid-autostart" so the array got started by the kernel (0.90 meta 
needed). I suspect that would have fixed it as well.

-- 
Bill Davidsen <davidsen@tmr.com>
  "We can't solve today's problems by using the same thinking we
   used in creating them." - Einstein


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

* Swap on /dev/md1 always lost after reboot
@ 2010-03-29  2:21 Joachim Otahal
  0 siblings, 0 replies; 6+ messages in thread
From: Joachim Otahal @ 2010-03-29  2:21 UTC (permalink / raw)
  To: Linux-RAID

Machine is:
Debian Lenny, Linux version 2.6.26-2-686 (Debian 2.6.26-21lenny4)
mdadm - v2.6.7.2 - 14th November 2008
2 HD's
/dev/md1 = /, /dev/sda1 /dev/sdb1
/dev/md0 = /home/data, /dev/sda3 /dev/sdb3

They are numbered that way for "historical" reasons, I created /dev/md0 
as data partition first and converted root/boot to RAID1 later.

The problem is:
/dev/md2 = swap, /dev/sda2, /dev/sdb2

I set up md2 (/dev/md2 is already in fstab as swap, the partition type 
is fd on both drives):
mdadm --zero-superblock /dev/sda2
mdadm --zero-superblock /dev/sdb2
mdadm -C /dev/md2 -l 1 -n 2 /dev/sdb2 /dev/sda2
mkswap /dev/md2
swapon -a
free says: swap active, mdstat says:
md2 : active (auto-read-only) raid1 sda2[1] sdb2[0]
       979840 blocks [2/2] [UU]
(no resync=PENDING or other funny stuff)
mdadm --examine --scan shows the md2, /etc/mdadm/mdadm.conf gets updated 
by me.
reboot, and the free says: no swap.

cat /proc/mdstat says: no md2 !
mdadm --examine --scan shows md2, exactely as written in 
/etc/mdadm/mdadm.conf

the longer output:
mdadm --examine /dev/sda2
/dev/sda2:
           Magic : a92b4efc
         Version : 00.90.00
            UUID : d97bc68d:a6bd724d:b66f1fce:677f10ed (local to host 
nearyou)
   Creation Time : Mon Mar 29 03:43:06 2010
      Raid Level : raid1
   Used Dev Size : 979840 (957.04 MiB 1003.36 MB)
      Array Size : 979840 (957.04 MiB 1003.36 MB)
    Raid Devices : 2
   Total Devices : 2
Preferred Minor : 2
     Update Time : Mon Mar 29 03:45:06 2010
           State : clean
  Active Devices : 2
Working Devices : 2
  Failed Devices : 0
   Spare Devices : 0
        Checksum : dec1b89a - correct
          Events : 8
       Number   Major   Minor   RaidDevice State
this     1       8        2        1      active sync   /dev/sda2
    0     0       8       18        0      active sync   /dev/sdb2
    1     1       8        2        1      active sync   /dev/sda2

mdadm --examine /dev/sda2
/dev/sda2:
           Magic : a92b4efc
         Version : 00.90.00
            UUID : d97bc68d:a6bd724d:b66f1fce:677f10ed (local to host 
nearyou)
   Creation Time : Mon Mar 29 03:43:06 2010
      Raid Level : raid1
   Used Dev Size : 979840 (957.04 MiB 1003.36 MB)
      Array Size : 979840 (957.04 MiB 1003.36 MB)
    Raid Devices : 2
   Total Devices : 2
Preferred Minor : 2
     Update Time : Mon Mar 29 03:45:06 2010
           State : clean
  Active Devices : 2
Working Devices : 2
  Failed Devices : 0
   Spare Devices : 0
        Checksum : dec1b89a - correct
          Events : 8
       Number   Major   Minor   RaidDevice State
this     1       8        2        1      active sync   /dev/sda2
    0     0       8       18        0      active sync   /dev/sdb2
    1     1       8        2        1      active sync   /dev/sda2

So the raid is there, it is on the HD, it is consistent and clean, it 
says it's preferred minor is 2 = md2.
It is simply not autodetected at boot time, or not activated, I tried 
that quite a few times now. I can recreate the raid with -C -f and issue 
a --rebuild, swapon -a, everything fine. The other RAID1's on the drives 
work as expected.

What is the trap I am running in here? I have other machines with 
/dev/md1 as swap without such problems. It there some kind of kernel 
option how high autodetect should count in md "Preferred Minor" devices?

kind regards,

Joachim Otahal


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

end of thread, other threads:[~2010-04-14 20:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29  2:21 Swap on /dev/md1 always lost after reboot Joachim Otahal
2010-03-29  2:32 ` Joachim Otahal
2010-03-29  6:33   ` Michael Evans
2010-03-29 17:32     ` Joachim Otahal
2010-04-14 20:13       ` Bill Davidsen
  -- strict thread matches above, loose matches on Subject: below --
2010-03-29  2:21 Joachim Otahal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.