From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753131AbbIQQCY (ORCPT ); Thu, 17 Sep 2015 12:02:24 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:36689 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753095AbbIQQCW (ORCPT ); Thu, 17 Sep 2015 12:02:22 -0400 Subject: Re: Failover root devices To: Drew DeVault , linux-kernel@vger.kernel.org References: <20150917001628.GA1126@homura> From: Austin S Hemmelgarn Message-ID: <55FAE401.8050700@gmail.com> Date: Thu, 17 Sep 2015 12:02:09 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150917001628.GA1126@homura> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms040409070403030809020400" X-Antivirus: avast! (VPS 150917-2, 2015-09-17), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a cryptographically signed message in MIME format. --------------ms040409070403030809020400 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-09-16 20:16, Drew DeVault wrote: > I would like to see Linux support multiple root devices, so that it can= > attempt one and move on to the next if it is not present. I've reviewed= > the relevant code during boot-up and it seems like a good place for me > to submit my first patch, but I want to bring it up for discussion here= > on LKML first. > > The design I had in mind is something like this: > > root=3Ddevice;device;device;... > > Where 'device' follows the current format (/dev/sdX, UUIDs, and so on, > via name_to_dev_t). I would modify prepare_namespace to iterate through= > each offered root device until one works. > > My use-case for this feature is that I would like to be able to change > the hardware of my machine and boot up differently based on what's > present. In my case, I would like to install my system normally, with > /boot on its own partition, and keep a seperate userspace on a flash > drive. Then, during boot-up, if the flash drive is present, it would be= > used as the root device. If it's not present, a partition on disk would= > be selected. I think this is an excellent idea, in addition to the above use-case, it = would allow for distros to automatically launch a recovery image if the=20 main root device has failed for some reason. That said, using the term failover for this is probably not the best=20 idea, many people associate it almost exclusively with online failover=20 and high-availability setups, and trying to do something like that with=20 the root file system is just asking for trouble (I'll be happy to go=20 into specifics as to why if someone asks). > The only potential roadblock with this feature that comes to mind is > figuring out how to handle time-outs between root devices. I think it > would be wise to choose a sensible default value, and provide another > cmdline parameter to tweak it. The prepare_namespace flow might end up > looking something like this: > > 1. Wait rootdelay seconds > 2. Check 1st device, not present > 3. Recheck 1st device until rootfailoverdelay seconds has passed > 4. Move on to 2nd device, present -> boot > > Or: > > 1. Wait rootdelay seconds > 2. Check 1st device, not present > 3. Recheck 1st device until rootfailoverdelay seconds has passed > 4. Move on to 2nd device, not present > 5. Recheck 2st device until rootfailoverdelay seconds has passed > 6. GOTO 2 > > And so on. As for this, I'd say default to the first method, and then provide an=20 option to switch to the second (both have practical uses). > I also need to research how the various init systems interact with this= > part of the boot process. I suspect systemd probably does something > silly wrt waiting for the root device. Since this feature would (of > course) be backwards compatible, it might be wise to just implement it > here and let the init systems add support for the feature themselves. If you're using an initramfs (which is a requirement from what I=20 understand for using systemd), then this could be done entirely in the=20 initramfs. The issue with that is that there is no standard syntax for=20 doing it, and no way to do it without an initramfs (both of which would=20 be nice to have). > Advice? Who should I send my patches to when they're ready? Please CC > me, I do not subscribe to LKML. Use scripts/getmaintainer.pl (or just check the MAINTAINERS file=20 directly) to determine this, but make sure to Cc at least LKML for the=20 changes as well. --------------ms040409070403030809020400 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC Brgwgga0MIIEnKADAgECAgMQblUwDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBw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