mdmadm at boot time

Will this work in a virtual machine??? The OP is trying to make a RAID in a virtual machine which does not make sense to me. I guess he wants to test but a VM is not the same as bare metal and RAID is a very bare metal operation. The question is will this actually work? Perhaps a different VM environment might allow it. ie type 1 versus type 2???

Yes it will. A VM like VirtualBox virtualises the disk at the level of the hardware controller. Even bare metal OSes like DOS believe they are using a real disk.

On 2010-10-13 16:34, Per Jessen wrote:

> I took another look at your mdadm.conf - your ARRAY lines are a little
> different to what I have on a vanilla openSUSE installation:

Wouldn’t initrd have to contain a copy of that file? During boot in that setup, /etc is not
readable, nothing you configure would make any difference.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Well maybe. But it looks like in this case RAID config information is missing. Have you ever setup a RAID in a Vbox VM with any distro?? Is the controler emulation really exactly like the real thing? Is the sector mapping to file structure having some effect? I have never heard of anyone doing this with a type 2 VM. Maybe it is possible but then again maybe not. The system the OP is trying to emulate is running on bare metal. OpenSuse ought to run fine on bare metal. VM???

Carlos E. R. wrote:

> On 2010-10-13 16:34, Per Jessen wrote:
>
>> I took another look at your mdadm.conf - your ARRAY lines are a
>> little different to what I have on a vanilla openSUSE installation:
>
> Wouldn’t initrd have to contain a copy of that file? During boot in
> that setup, /etc is not readable, nothing you configure would make any
> difference.

initrd does have a copy, or at least an mdadm.conf that has the the root
device. The others are not needed. I don’t think the OP is booting
from RAID though.


Per Jessen, Zürich (9.1°C)
http://en.opensuse.org/User:pjessen

qsummon wrote:

>
> this is the output before manually assemble the raid
>
> nfs-test01:~ # more /proc/mdstat
> Personalities : [linear]
> unused devices: <none>
>
> This is the outout after mdadm
> nfs-test01:/etc # mdadm --assemble /dev/md0
> mdadm: /dev/md0 has been started with 4 drives.
>
> nfs-test01:/etc # cat /proc/mdstat
> Personalities : [linear] [raid6] [raid5] [raid4]
> md0 : active raid5 sdb[0] sde[3] sdd[2] sdc[1]
> 3144192 blocks level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
>

Okay. Back to square 1. How about output in logs, any mention of mdadm
and the array?


Per Jessen, Zürich (9.0°C)
http://en.opensuse.org/User:pjessen

I just went for the easy way and found a workaround
I have created an script in /etc/init.d called automdmad with the following entries
I have to make sure to have the mdadm.conf, cause it will look for it

#!/bin/bash
/sbin/mdadm --assemble /dev/md0
/sbin/vgchange -ay vgtest

and then chkconfig -s automdadm 3

now after the reboot I can see the /dev/md0 and the Volume group on it

For any reason boot.md and mdadmd are not recognizing the array

This was a test in a VM I did because I want to migrate my NFS server at home from ubuntu server to OPEN SUSE

Now I know how to do it, I will go for it

Thanks

On 2010-10-13 17:06, gogalthorp wrote:
>
> Will this work in a virtual machine???

Yes, of course.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On 2010-10-13 21:06, qsummon wrote:

> For any reason boot.md and mdadmd are not recognizing the array

Assuming they run (chkconfig mdadmd), the reason should be in the log.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

openSUSE by default does not automatically assemble raid sets at boot time. I recommend you create a file /etc/mdadm.conf . The format is similar to this:

DEVICE containers partitions
ARRAY /dev/md0 level=raid1 UUID=xxxxxxxx:xxxxxxxx:xxxxxxxx:xxxxxxxx
ARRAY /dev/md4 UUID=xxxxxxxx:xxxxxxxx:xxxxxxxx:xxxxxxxx

I don’t know when the “level=” clause stopped being required.

randyC08 wrote:

> openSUSE by default does not automatically assemble raid sets at boot
> time.

If openSUSE was installed/configured knowing about those RAID arrays,
YaST creates an mdadm.conf automatically.


Per Jessen, Zürich (9.1°C)
http://en.opensuse.org/User:pjessen

VMs are very good, it’s very hard for the OS to know it’s not running on bare metal. The VM does emulate down to bare metal level. The disk controller looks like one of the standard models, ditto the Ethernet controller, parallel port controller.

Software RAID doesn’t require anything more than the standard disk access available to all the filesystems in Linux. And all the standard filesystems will work in a VM.

The only logs at the boot time are that the service mdadmd runs fine (but never detects the raid)
I have create an mdadm on the ubuntu server and actually that one is working because when If you run mdadm /dev/md0 --assemble without the -c, it will look for mdadm.conf in order to assemble it.
Is the mdmad.conf that creates YAST different?

On 2010-10-15 06:06, qsummon wrote:
>
> The only logs at the boot time are that the service mdadmd runs fine
> (but never detects the raid)
> I have create an mdadm on the ubuntu server and actually that one is
> working because when If you run mdadm /dev/md0 --assemble without the
> -c, it will look for mdadm.conf in order to assemble it.
> Is the mdmad.conf that creates YAST different?

Could be.

We told you that you should create it all from the opensuse install, and see how it does things.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

I try to install OPEN SUSE with the disks “plugged” to the VM and works

Last time, I install the OS and after that assign the disk to the VM, and that the reason didn’t work
The reason for that, is because I’m planning to do a migration from Ubuntu to OPEN SUSE, and looks the safer way to install the OS without the disks with the raid/data

I couldn’t find the reason why is working now, the mdadm.conf that yast build is exactly the same I had in my previous test.

Thanks all for all the help

On 2010-10-15 21:06, qsummon wrote:

> I couldn’t find the reason why is working now, the mdadm.conf that yast
> build is exactly the same I had in my previous test.

Compare the insides of initrd.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)