Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752548AbYLQPId (ORCPT ); Wed, 17 Dec 2008 10:08:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751209AbYLQPIV (ORCPT ); Wed, 17 Dec 2008 10:08:21 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:38479 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbYLQPIU (ORCPT ); Wed, 17 Dec 2008 10:08:20 -0500 Date: Wed, 17 Dec 2008 10:08:13 -0500 From: Christoph Hellwig To: Kay Sievers Cc: Christoph Hellwig , Andreas Dilger , Chris Mason , Andrew Morton , Stephen Rothwell , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel Subject: Re: Notes on support for multiple devices for a single filesystem Message-ID: <20081217150813.GA2858@infradead.org> References: <1227183484.6161.17.camel@think.oraclecorp.com> <1228962896.21376.11.camel@think.oraclecorp.com> <20081211141436.030c2d65.sfr@canb.auug.org.au> <20081210200604.8e190b0d.akpm@linux-foundation.org> <1229006596.22236.46.camel@think.oraclecorp.com> <20081215210323.GB5000@webber.adilger.int> <20081217132343.GA14695@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 17, 2008 at 03:50:45PM +0100, Kay Sievers wrote: > Sounds all sensible. Btrfs already stores the (possibly incomplete) > device tree state in the kernel, which should make things pretty easy > for userspace, compared to other already existing subsystems. > > We could have udev maintain a btrfs volume tree: > /dev/btrfs/ > |-- 0cdedd75-2d03-41e6-a1eb-156c0920a021 > | |-- 897fac06-569c-4f45-a0b9-a1f91a9564d4 -> ../../sda10 > | `-- aac20975-b642-4650-b65b-b92ce22616f2 -> ../../sda9 > `-- a1ec970a-2463-414e-864c-2eb8ac4e1cf2 > |-- 4d1f1fff-4c6b-4b87-8486-36f58abc0610 -> ../../sdb2 > `-- e7fe3065-c39f-4295-a099-a89e839ae350 -> ../../sdb1 > > At the same time, by-uuid/ is created: > /dev/disk/by-uuid/ > |-- 0cdedd75-2d03-41e6-a1eb-156c0920a021 -> ../../sda10 > |-- a1ec970a-2463-414e-864c-2eb8ac4e1cf2 -> ../../sdb2 > ... Well, it's not just btrfs, it's also md, lvm and xfs. I think the right way is to make the single node for the /dev/disk/by-uuid/ just a legacy case for potential multiple devices. E.g. by having /dev/disk/by-uuid/ 0cdedd75-2d03-41e6-a1eb-156c0920a021 -> ../../sda10 0cdedd75-2d03-41e6-a1eb-156c0920a021.d foo -> ../../sda10 bar -> ../../sda9 where foo nad bar could be uuids if the filesystem / volume manager supports it, otherwise just the short name for it. > For recue and recovery cases, it will still be nice to be able to > trigger "scan all devices" code in btrfsctrl (own code or libbklid), > but it should be avoided in any normal operation mode. Again, that's something we should do generically for the whole /dev/disk/ tree. For that we need to merge libvolume_id and libblkid so that it has a few related but separate use cases: - a lowlevel probe what fs / volume manager / etc is this for the udev callout, mkfs, strip size detection etc - a way to rescan everything, either for non-udev static /dev case or your above recovery scenario - plus potentially some sort of caching for the non-recovery static /dev case I've long planned to put you and Ted into a room and not let you out until we see white smoke :) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/