Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
raid not assembled after reboot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Kwark
Tux's lil' helper
Tux's lil' helper


Joined: 21 May 2007
Posts: 121

PostPosted: Tue Feb 12, 2008 4:11 pm    Post subject: raid not assembled after reboot Reply with quote

My software raid1 is not assembled after reboots. It has worked for about 2 years, but since last 2 reboots (HD failure before that, swapped one harddisk) the new harddisk is not integrated into the raid anymore.
The harddisk is fine, no read errors or anything. When I "raidhotadd /dev/md1 /dev/sda5" the disk is hotadded and works very well until the next reboot.

Code:

md1 : active raid1 sda5[2] sdb5[0]
      14659200 blocks [2/1] [U_]

md2 : active raid1 sda6[2] sdb6[0]
      9775424 blocks [2/1] [U_]

md3 : active raid1 sda7[2] sdb7[0]
      4891648 blocks [2/1] [U_]

md4 : active raid1 sda9[2] sdb9[0]
      214740736 blocks [2/1] [U_]

md0 : active raid1 sda1[2] sdb1[0]
      56128 blocks [2/2] [U_]


mdadm --detail /dev/md3 (not yet hotadded)
Code:

/dev/md3:
        Version : 00.90.03
  Creation Time : Sun Jul  3 15:26:16 2005
     Raid Level : raid1
     Array Size : 4891648 (4.67 GiB 5.01 GB)
  Used Dev Size : 4891648 (4.67 GiB 5.01 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 3
    Persistence : Superblock is persistent

    Update Time : Tue Feb 12 17:06:01 2008
          State : clean, degraded
 Active Devices : 1
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 1

           UUID : 0c177f2b:7f3385b0:4232ca5f:525b25ec
         Events : 0.4870976

    Number   Major   Minor   RaidDevice State
       0       8       23        0      active sync   /dev/sdb7
       2       8        7        1      spare rebuilding   /dev/sda7


mdadm --detail /dev/md0 (already hotadded)
Code:

/dev/md0:
        Version : 00.90.03
  Creation Time : Sun Jul  3 15:26:11 2005
     Raid Level : raid1
     Array Size : 56128 (54.82 MiB 57.48 MB)
  Used Dev Size : 56128 (54.82 MiB 57.48 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Tue Feb 12 17:09:23 2008
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : 09f10ae1:e65d0390:e8038eda:e52bcec0
         Events : 0.456

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


persistent-superblock is enabled in /etc/raidtab

What may be the cause is that raidtools became obsolete a while ago, but since the raid was working fine with hotswapping when necessary, I never bothered to 'upgrade' to mdadm. Especially since both packages are userland tools and should do basically the same for my purposes.

Any ideas what goes wrong and how to fix it?
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 515
Location: San Diego, California USA

PostPosted: Tue Feb 12, 2008 10:08 pm    Post subject: Reply with quote

What do you have the partition type set to on your RAID partitions? They should be set to type 'fd'. If you do that, the kernel should automatically rebuild them when you reboot. Also, if your root partition is on a RAID, make sure RAID support is compiled into the kernel, not as a module.

Here's an example on my system:
Code:

root@gw ~ # fdisk -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          10       80293+  fd  Linux raid autodetect
/dev/sda2              11         315     2449912+  82  Linux swap / Solaris
/dev/sda3             316       12474    97667167+  fd  Linux raid autodetect
/dev/sda4           12475       60801   388186627+   5  Extended
/dev/sda5           12475       48762   291483328+  fd  Linux raid autodetect
/dev/sda6           48763       60801    96703236   83  Linux

root@gw ~ # fdisk -l /dev/sdb

Disk /dev/sdb: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          11       88326   fd  Linux raid autodetect
/dev/sdb2              12         194     1469947+  82  Linux swap / Solaris
/dev/sdb3             195       12353    97667167+  fd  Linux raid autodetect
/dev/sdb4           12354       48641   291483360    5  Extended
/dev/sdb5           12354       48641   291483328+  fd  Linux raid autodetect

At kernel boot:

md: Autodetecting RAID arrays.
md: Scanned 6 and added 6 devices.
md: autorun ...
md: considering sdb5 ...
md:  adding sdb5 ...
md: sdb3 has different UUID to sdb5
md: sdb1 has different UUID to sdb5
md:  adding sda5 ...
md: sda3 has different UUID to sdb5
md: sda1 has different UUID to sdb5
md: created md5
md: bind<sda5>
md: bind<sdb5>
md: running: <sdb5><sda5>
raid1: raid set md5 active with 2 out of 2 mirrors
md: considering sdb3 ...
md:  adding sdb3 ...
md: sdb1 has different UUID to sdb3
md:  adding sda3 ...
md: sda1 has different UUID to sdb3
md: created md3
md: bind<sda3>
md: bind<sdb3>
md: running: <sdb3><sda3>
raid1: raid set md3 active with 2 out of 2 mirrors
md: considering sdb1 ...
md:  adding sdb1 ...
md:  adding sda1 ...
md: created md1
md: bind<sda1>
md: bind<sdb1>
md: running: <sdb1><sda1>
raid1: raid set md1 active with 2 out of 2 mirrors
md: ... autorun DONE.
Back to top
View user's profile Send private message
Kwark
Tux's lil' helper
Tux's lil' helper


Joined: 21 May 2007
Posts: 121

PostPosted: Wed Feb 13, 2008 7:01 am    Post subject: Reply with quote

Aha, the partition types for the /dev/sda (the missing ones in the raid) are indeed set to Linux (83) instead of Linux raid autodetect (fd).
Code:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           7       56196   83  Linux
/dev/sda2               8       60801   488327805    5  Extended
/dev/sda5               8        1832    14659281   83  Linux
/dev/sda6            1833        3049     9775521   83  Linux
/dev/sda7            3050        3658     4891761   83  Linux
/dev/sda8            3659        3781      987966   82  Linux swap / Solaris
/dev/sda9            3782       30515   214740823+  83  Linux
/dev/sda10          30516       60801   243272263+  83  Linux

Is there a way to change this partition type on the running array/disk? Or must I remove sda from the raids, edit the partition types and reassemble the raid again?
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 515
Location: San Diego, California USA

PostPosted: Wed Feb 13, 2008 9:27 am    Post subject: Reply with quote

Just run fdisk and tweak them The change might not take effect until you reboot, but that should be okay. If you just change the type, it shouldn't mess with your data.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum