From: John Robinson <john.robinson@anonymous.org.uk>
To: Manuel Arostegui <manuel@tuenti.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Lenny to squeeze mdadm problem + e2label problem
Date: Thu, 23 Feb 2012 01:32:36 +0000 [thread overview]
Message-ID: <4F459734.4050100@anonymous.org.uk> (raw)
In-Reply-To: <CAA8xrZdnBD+GTgk759aQigey0qVBQk-FsMj27_3ik8bjnTP_jw@mail.gmail.com>
On 22/02/2012 11:44, Manuel Arostegui wrote:
> Hey all,
>
> Whilst trying to upgrade one box from Debian Lenny to Debian Squeeze I
> have run into some problems with mdadm and the RAID labeling.
>
> Kernel: 2.6.32-41
> mdadm version: v3.1.4
> Disks: 4
>
> RAID devices:
> /dev/md0 - boot - RAID1 - ext3
> /dev/md1 swap
> /dev/md2 - "/" - RAID1 - ext3
> /dev/md3 - "/var/lib/mysql" - RAID10 - xfs
>
> When doing the dist-upgrade and replacing the kernel + udev the system
> changes the RAID devices to md124, md125, md126 etc.
> As far as I have read, this makes sense - as mdadm is changing
> superblock and has to recalculate the whole RAID. This is big problem,
> if you have devices into /etc/fstab, like we do.
mdadm doesn't change superblocks in the manner you suggest - there isn't
even an option yet to --update=metadata. I don't know Debian but it
sounds like the dist-upgrade must be doing something odd. Your device
names ought to be being preserved. Does doing a dist-upgrade involve a
reboot part-way through? It ought to have your mdadm.conf in its initrd,
or at the very least preserve your hostname, and maybe it doesn't.
The nearest I have seen is booting a system with a rescue CD when
existing arrays get auto-assembled with high numbers (from 127 down)
which can cause problems the next time you reboot back into the original
system (because the on-disc metadata now thinks the array prefers to be
e.g. md127 instead of md0). This is all to do with a missing mdadm.conf
and/or the hostname not matching the arrays' homehost.
[...]
> If we re-check the labels we can see all the devices got the same
> label (the one assigned to md0, md1 etc), so probably grub is trying
> to boot from single devices, and not from the md0 which is /boot
Grub always boots from single devices. This is why you have to use
metadata 0.90 or 1.0 with RAID-1 for /boot. Generally the BIOS and
therefore grub will boot from the first available drive, so if your
normal first drive dies, the second drive becomes the first and you can
still boot. Having said that, grub2 has real support for md RAID so you
can boot off any metadata and RAID level with it, as long as the BIOS
can read grub off the first drive.
> This is blkid's output:
>
> /dev/sdb1: LABEL="boot" UUID="6d15111c-d2d9-4636-b2a5-7954ddcbcae2"
> SEC_TYPE="ext2" TYPE="ext3"
[...]
> /dev/md0: LABEL="boot" UUID="6d15111c-d2d9-4636-b2a5-7954ddcbcae2"
> SEC_TYPE="ext2" TYPE="ext3"
[...]
>
> As we have to migrate loads of machines, using labels is the fastest
> and cleanest way to do it. Just create the labels and change
> /etc/fstab across all the machines and voilá. But we cannot get it
> running. Is there any workaround to work with labels and avoid all the
> disks in the raid to get them as well?.
As you can see, it doesn't work. This will always happen with mdadm
metadata version 0.90 and 1.0 with RAID-1 and is the only way grub can
boot at all.
> Using UUID doesn't seem like a good idea, as they may change with
> future dist-upgrades, mdadm upgrades etc.
Using UUID won't work anyway, for the same reasons as using the label
doesn't work.
> Has someone had same/similar problem with mdadm?
It's not really a mdadm problem, I think you need to find a way to fix
whatever it is that's causing your arrays to be renamed/renumbered.
The only other thing that occurs to me is to check whether the upgrade
process gives you a symlink like /dev/md/d0 which points to /dev/md127
(and similarly for your original md1-3), and if it does, fix up your
Lenny systems to have those symlinks and use them in your fstab.
Sorry I can't give any more positive help.
Cheers,
John.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2012-02-23 1:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 11:44 Lenny to squeeze mdadm problem + e2label problem Manuel Arostegui
2012-02-23 1:32 ` John Robinson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F459734.4050100@anonymous.org.uk \
--to=john.robinson@anonymous.org.uk \
--cc=linux-raid@vger.kernel.org \
--cc=manuel@tuenti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).