Re: Problem with Raid Array persistence across reboots.



Chandler, Alan wrote:

I created a raid array with mdadm, thus

mdadm --create=/dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]4

and then turned /dev/md0 into a LVM physical volume, volume group and
some logical volumes.

This worked great until I rebooted, at which point the start-up scripts
failed to recreate the raid array, and I got into tricky problems with
duplicate LVM PVs with the same UUID. [and ironically, since I used raid
to avoid it, some data loss - although fortunately I DO have backups]

Two questions

1) In the Debian world, how do you make raid arrays persistent across
reboots?

[It appears that Debian does not use raidtools and /etc/raidtab as the
linux raid howto says)

2) If I do manage to create the array, what stops vgscan during LVM
startup from picking up 3 physical volumes (/dev/md0, /dev/sda4 and
/dev/sdb4) with the same UUID and only find /dev/md0?

Greetings Alan:

You don't mention which version of Debian you're using - the raid tools
have varied a lot between the last few releases - but assuming Sarge:

The configuration is stored in /etc/mdadm/mdadm.conf and looks like:

DEVICE partitions
ARRAY /dev/md3 level=raid1 num-devices=2
UUID=62297b2a:13d5cbb3:b889437a:6095a0d0
devices=/dev/sda6,/dev/sdb6
ARRAY /dev/md2 level=raid1 num-devices=2
UUID=27192fb9:88d9191f:bbbf6c42:8656233f
devices=/dev/sda5,/dev/sdb5
ARRAY /dev/md1 level=raid1 num-devices=2
UUID=b483771d:b60355eb:afe973c0:92db52e2
devices=/dev/sda2,/dev/sdb2
ARRAY /dev/md0 level=raid1 num-devices=2
UUID=aa772038:8b2a1989:339b0f8f:f93b96b5
devices=/dev/sda1,/dev/sdb1

by default (my arrays were created by the installation program, not by
hand). Note: the above shows wrapped in my mail window. ARRAY starts a
line, and the UUID finishes the line. The devices line is indented
below the ARRAY line.

To answer your questions:

1) If you have a configuration file in /etc/mdadm, it should be mostly
automagic, provided that all of the required drivers are either built
into your kernel or in your initrd. Even without the configuration
file, mdadm will usually do a pretty good job by reading the
superblocks. Biggest problem here is not having the drivers loaded
early enough.

2) More magic. LVM2 looks at the superblocks and ignores the MD
components, by default. That is configurable behavior in the
/etc/lvm/lvm.conf file with the md_component_detection directive.

Congratulations on the backup. We've had arrays go sideways during
upgrades, but we've always managed to put them back together without too
much damage.

Good Luck.

-Scott


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: mdadm: raid not working after stop/reboot
    ... > array using mdadm -S, I'm not at all able to get it running again. ... used in your raid array must be fdisk'd to type "fd" or Linux Raid ... Then create your array, format it, mount it, set it in /etc/fstab and reboot. ...
    (Debian-User)
  • Re: Un-RAID on ICH8R?
    ... copy the data and partition from the RAID0 array, to the new disk. ... Disconnect the RAID array, ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: problem with grub
    ... I created and LVM on sdb. ... filesystem from sda onto sdb, I want to configure grub so that it boots on ... sda1 relates to the biggest partion on the first array and sdb1 relates to the only partition on the second raid array. ... Because we needed more space for backuppc, the initial plan was to create an lvm on the second raid array, boot to it and see if it worked, if so extend it by incorporating the first raid array. ...
    (Debian-User)
  • Re: Is there anything to RAID stuff and that fits 2 or more SSDs in a 3.5 inch bay?
    ... Flash SSDs in a single 3.5 inch bay and makes the array ... look like a single device to the (motherboard) SATA controller. ... ACTUAL RAID array? ... multiple hard drives. ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: Urgent!How to change /dev/sda to /dev/sdc!
    ... > system boots.(not connect to disk array when installing the Radhat ... recorded in the superblock of the raid array. ... If that's exactly what your problem is, then mdadm has a "force" ... Once raid array is up and running you don't have to record its setup ...
    (comp.os.linux.hardware)