LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Software raid not working (https://www.linuxquestions.org/questions/linux-software-2/software-raid-not-working-718426/)

nex9 04-11-2009 09:52 AM

Software raid not working
 
I'm trying to get a software raid 10 set up in ubuntu 8.10 and having some issues. This is for a non-boot/system set of drives.

I was able to create the raid with:
mdadm -v --create /dev/md0 --level=raid10 --raid-devices=4 /dev/sda1 /dev/sdc1 /dev/sdd1 /dev/sde1

Then mkfs.ext3 and mount it. The array fully sync'ed according to /proc/mdstat.

The problem is that it is not working after I reboot the box. After reboot, /proc/mdstat shows:
Personalities : [raid10]
unused devices: <none>
mdadm --detail /dev/md0

and
mdadm --detail /dev/md0
mdadm: md device /dev/md0 does not appear to be active.

At this point, I have to do a

mdadm --assemble --verbose --run /dev/md0

which seems to fix things. Any idea why this is happening?

I already have this in mdadm.conf:

ARRAY /dev/md0 level=raid10 num-devices=4 UUID=877d4490:3d657917:134a5b84:9888814b

I also have this in /etc/modules:

fuse
lp
rtc
md
raid10

Thanks!

inside-man 04-11-2009 02:26 PM

Hello, have you checked the partition type? It has to be 'fd' , that is the mark where the kernel tries to detect existing raid arrays and startup the md...
Good Luck Randolf Balasus

chrism01 04-11-2009 08:12 PM

Use fdisk to check the partition type as mentioned.
However, that being said, in your OP you don't mention adding it to /etc/fstab. If its not there the system can't magically guess where you wanted it or if you wanted it mounted.
Remember /dev/md0 is just another 'disk' to the OS; still needs to be explicitly mounted on a dir somewhere.

nex9 04-12-2009 03:08 PM

Thanks all. I changed my partition table to use the FD type (hadn't done that before - current sfdisk -l for one of the drives is below. All 4 drives are identically partitioned), and recreated by array. Still no luck.

I haven't put this in /etc/fstab yet - I've just been mounting it manually, when /dev/md0 is actually working (which at this point requires a manual mdadm --assemble --scan). Any other ideas? Do I need to initrd even though this isn't a bootable partition?


sfdisk -l /dev/sdb

Disk /dev/sdb: 60801 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sdb1 1 999 999 8024467+ fd Linux raid autodetect
/dev/sdb2 0 - 0 0 0 Empty
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty

nex9 04-18-2009 08:54 AM

Unfortunately this is still not working.

I get this during a reboot if I have that line in /etc/fstab:

fsck 1.40.8 (13-Mar-200
fsck.ext3: Invalid argument while trying to open /dev/md0^M
/dev/md0:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

fsck died with exit status 8

Also:

mdadm -D /dev/md0
mdadm: md device /dev/md0 does not appear to be active.

mdadm --assemble --scan
mdadm: /dev/md0 has been started with 4 drives.
root@linux-quad:/var/log/fsck# mdadm -D /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Sun Apr 12 16:24:14 2009
Raid Level : raid10
Array Size : 16048768 (15.31 GiB 16.43 GB)
Used Dev Size : 8024384 (7.65 GiB 8.22 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Mon Apr 13 07:23:28 2009
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : near=2, far=1
Chunk Size : 64K

UUID : 465177d9:168e40e8:134a5b84:9888814b (local to host linux-quad)
Events : 0.6

Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 33 1 active sync /dev/sdc1
2 8 49 2 active sync /dev/sdd1
3 8 65 3 active sync /dev/sde1


All times are GMT -5. The time now is 11:22 AM.