LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   RAID through mdadm (https://www.linuxquestions.org/questions/linux-server-73/raid-through-mdadm-475372/)

rosey 08-19-2006 10:18 AM

RAID through mdadm
 
I have setup two drives in an array using mdadm but everytime i restart the machine the array dissapears and I have to "assemble" the array again. After I reassamble everything that was in the array before the reboot is still there but I need to know how to make it stick.

I made the array with:
#mdadm --create /dev/md0 --level 1 --raid-devices=2 /dev/sda1 /dev/sdb2

Or if mdadm is not the ideal way to do this I'm up for trying something else.

Thanks for your help in advance,
Cody

david_ross 08-20-2006 04:21 AM

If you configure the arrays in /etc/mdadm.conf and then make sure that mdadm is starting on boot then it should start the array devices automatically.

rosey 08-20-2006 03:08 PM

You were right about it being a startup issue.

I thought debian would do that for me but when I checked out my rc2.d directory I did not find the link to /etc/init.d/mdadm-raid. Once I made that link it was able to do a 'mount -a' and it mounts without me having to assemble every time I reboot.

I do have one other question though. When I boot up /dev/md0 doesn't get mounted. I know its setup correctly in fstab because when I do a 'mount -a' everything mounts fine.

I'm not sure if i have to make the sym link to /etc/init.d/mdadm-raid to a priority or what. For the time being I just made a shell file to do a 'mount -a' right at the end of the boot (I know its dirty). This isn't seriously important to me but I would like to know why its not mounting on its own.

Thanks,
COdy

david_ross 08-21-2006 12:54 PM

Can you post a copy of /etc/fastab and /etc/mdadm.conf

rosey 09-07-2006 05:44 PM

DEVICE partitions
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=647c4943:e5dd243d:85bd62bd:0f7f121b
devices=/dev/sda1,/dev/sdb1

Sorry it took me so long to respond but here it is.

doorito 04-08-2007 11:57 AM

raid5 on mdadm
 
Hi:

I'm new/old at linux. The good thing about Linux is, once it's setup there is not much the user have to do to maintain it. The problem with it is once it's time to redo the system you've forgotten what your originally did.

Anyways:

I have a similar issue with my system. I'm running Debian 3.1.5 kernel 2.6.8.3.x and using mdadm for my raid setup. I have various drives setup

/dev/hda
/dev/hdb
/dev/hdc

/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd

The most important are the /dev/sd[abcd] drives. I'm trying to setup RAID5 on these drives. I have read and followed various instructions on this and other forums and have already configured/rebuild multiple times only to end up with the same result.

The problem is mdadm doesn't appear to be reading /etc/mdadm/mdadm.conf on boot, and because it doesn't get read on boot I always get this message "mdadm: no devices found for /dev/md0". There are also a bunch of other messages that followed, but suffice to say if mdadm can't find any devices belonging to /dev/md0 array it will error out and will not create the array.

The reason I believe mdadm is not reading mdadm.conf is because I can logon and execute the command to assemble the array:
#mdadm -A /dev/md0
mdadm: /dev/md0 has been started with 4 drives.

I also test /etc/fstab by:
#mount -a

#df -h
shows the mounted file system
/dev/md0 101G 33M 96G 1% /raid5

This is a pain especially if I can't rely on the system to complete it's boot-up without pausing at "mdadm: no devices found for /dev/md0" , give root password for maintenance or CONTROL-D to continue.

Here's my /etc/mdadm/mdadm.conf
DEVICE partitions
DEVICE /dev/sda /dev/sdb /dev/sdc /dev/sdd

ARRAY /dev/md0 level=raid5 num-devices=4 UUID=23ff6bb9:eb8d753f:2682b942:7ae393e
7
devices=/dev/sda,/dev/sdb,/dev/sdc,/dev/sdd


It doesn't matter if I remove the first line "DEVICE partitions" it still pauses

Here's my /etc/fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda3 / ext3 defaults,errors=remount-ro 0 1
/dev/hda1 /boot ext3 defaults 0 2
/dev/hdc /done_downloading ext3 defaults 0 2
/dev/hdb1 /downloading ext3 defaults 0 2
/dev/md0 /raid5 ext3 defaults 0 2
/dev/hda2 none swap sw 0 0
/dev/hdd /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0


I've also checked /etc/rd2.d to make sure the link to mdadm is proper...

I've also checked /etc/init.d mdadm and mdadm-raid file, from what I can tell they look proper...

Is there anything else I'm missing? If some linux/mdadm guru or someone experience them me (and I know there are plenty out there) who can give me some info on this problem, I will be extremely greatful.

I know it's a long read but please understand my delimma. :(


All times are GMT -5. The time now is 05:50 PM.