From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A40DB138CD3 for ; Thu, 28 May 2015 12:44:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 79B71E089D; Thu, 28 May 2015 12:44:29 +0000 (UTC) Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 40707E0851 for ; Thu, 28 May 2015 12:44:28 +0000 (UTC) Received: by igbhj9 with SMTP id hj9so113011010igb.1 for ; Thu, 28 May 2015 05:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=bM5pCSpjTS4ogT1A/qADzMXLj8M8DGHGlXMC0Go2+Ew=; b=C7tg57I9SrHXPbR4OIXuIlvi/RcPJ4vU9xXpefKYFw9dcOckeAgnR4K4LnMsUUupdC Jb80wrk5+NETXI6/cp7hJO1aotbLX0pyFGV9fjTc/h+M5U/j+m0TuQbgCAs7NEqu0ETL U/oZJlDX02g/0TFpEjb7i+Joka0XmrsfZ4toxzi1iphKNyhMX6/8CtqUeMdvMG2LaV/w hzJLd0aml4oDAZ4vsxFwQDI0jvSe7mr19JNbe1JlhiuRuivBegjv50foZwp4st+JAsog ZsLW/D4+rm9ThhNsg+sC5KZc+eeXVg+funvJFywinJyUb+kYLM7+uuy3WSaNUU+mal2N FTEA== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.43.163.129 with SMTP id mo1mr8894016icc.61.1432817067652; Thu, 28 May 2015 05:44:27 -0700 (PDT) Sender: freemanrich@gmail.com Received: by 10.107.6.34 with HTTP; Thu, 28 May 2015 05:44:27 -0700 (PDT) In-Reply-To: <2435178.sru4gdrlxQ@wstn> References: <2988031.1MpZN5Nf01@wstn> <8190245.y8rOlDDBFo@wstn> <201505272140.38862.michaelkintzios@gmail.com> <2435178.sru4gdrlxQ@wstn> Date: Thu, 28 May 2015 08:44:27 -0400 X-Google-Sender-Auth: 4niqtGD6DUg3O1HO3m_HCyceL8U Message-ID: Subject: Re: [gentoo-user] General weirdness - a tale of woe. From: Rich Freeman To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 6a2b2afa-4f64-41c0-80cf-8d2cc4fa87fb X-Archives-Hash: f77c06a186cc590a14a775fb047d9a31 On Wed, May 27, 2015 at 8:01 PM, Peter Humphrey wrote: > > My mdadm.conf is now this: > DEVICE /dev/sd[ab]1 > DEVICE /dev/sd[ab]5 > DEVICE /dev/sd[ab]7 > ARRAY /dev/md1 devices=/dev/sda1,/dev/sdb1 > ARRAY /dev/md5 devices=/dev/sda5,/dev/sdb5 > ARRAY /dev/md7 devices=/dev/sda7,/dev/sdb7 > > I'll see how that goes; so far no complaints about finding no arrays in the > config file. I've never used UUIDs, preferring to be able to read what I'm > specifying. > The problem with this sort of approach is that you're hard-coding device names. If for whatever reason your devices are lettered differently, mdadm may not assemble the array. Here is an example of one of my old mdadm.conf files: DEVICE /dev/sd[abcdefgh][12345] /dev/hd[abcde][12345] #ARRAY /dev/md126 UUID=e424848a:593e3c8e:0e120ac2:958f662e #ARRAY /dev/md124 UUID=dae2458d:e144dbde:34d5107b:2f8c859e #ARRAY /dev/md127 UUID=4096c546:a0d9d5c4:5063dd02:38d16c75 This tells mdadm to scan all those permutations of device names, find anything with those UUIDs and attempt to assemble the arrays, giving them the preferred minor numbers. Some of those device names probably don't even exist (not all of those drives have 5 partitions, etc). It doesn't matter - mdadm just checks the ones that do exist. Then if for whatever reason sdd is now hdc it doesn't matter. With an approach like yours, mdadm will attempt to create md1 by looking ONLY at sda1 and sdb1, and if that pair forms a valid array it is started, and if not it is not. If you add a new drive to your system or for whatever reason the kernel/udev rules change a little or some race condition changes a little then your devices might get different names, and the array will not be assembled. UUIDs are often preferable in these kinds of configurations, because you're less likely to run into duplicate identifiers, they don't change, and so on. If I mount root=UUID=foo, then my initramfs will try really hard to find that partition and mount it. If I mount root=label=foo then it will still try hard, but if for some reason I have more than one device with that label I could end up booting from the wrong one. If I mount root=/dev/sda1 then my boot may fail if I add a new drive, if the kernel behavior changes, if the udev behavior changes, and so on. I don't believe either the kernel or udev makes promises about device names being stable. It often works out this way, but it isn't ideal to depend on this. -- Rich