From owner-freebsd-hackers@freebsd.org Sat Oct 13 15:47:30 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C107F10CE363 for ; Sat, 13 Oct 2018 15:47:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 440897FD77 for ; Sat, 13 Oct 2018 15:47:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd36.google.com with SMTP id l25-v6so11333893ioj.0 for ; Sat, 13 Oct 2018 08:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TidZ04wsHSDyTb8XvVuEM+lnk6LupR7u7hZaIP+EAhI=; b=Wtn4g/hqOI2dE3J2Hku5ktS0AWJfIh1JOp20e5kowojHxnVCkpJWBWOwP5yPLWVzGA 5nizOLRi8pWPg2L+lSu1OlzS9aNE4UWA3e0IDCF52WviYtnI6Cp0yUW1tow8ZxfqVk6d 7hi+Ecoi9whdFK2H7CAwcJlF/ODcsD654GHMRdNMTzkJA9G+x4nwbH6zV+8/MUHtf5uw w7TB8ebcEIYqpc2TQsXjY21rPJP2P1ScMsVoXTKlgilDCduKPs2Q9rYsn2dLoEkRjX5H D0ReYj7IbYESVSnvP8EZxqjXhZ/c82DAX9rsnEJIeIbv1D1uz19QQPnlFcttogFYbyI9 H6BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TidZ04wsHSDyTb8XvVuEM+lnk6LupR7u7hZaIP+EAhI=; b=EdGQytjEr1wSsRcFe325IorbxbCSa/ewBLLw9I/4VcEaDQA3k3ua4PNujHk6WP/mla eQvt1HTACpA56Y7OcaudiPrHXNFbhj+TMzKiuSSZIsbev/rLuaABgLBueZx+zNA5j+Gx dg8WOI+O/jOp+SOA+O5rHZC5TK2veS9a1aZKomRvy3gTxVeHsCLaqxBQlsg9AKmi/8Be HG2ilfYhl05Hh9gX7ua6EdT9LmAslJ49tVhdJ7T5XhN4371CL6WEj07kO1XP7up8oPHK IvPCY/eGDQJq20hagf+kx4rFCRk4KdQBvQB01iaUKJzA39iydj29RIAkOPymb3ihGshV Px/Q== X-Gm-Message-State: ABuFfog9AFr3HsLnmMgb10hb6cpPCzEEYKypn787Aob/xcznltKn8/eM TIvzQgKSzYN4WfhXopc7mfdzYGMH72CWicsmR7Sf/DtYpOs= X-Google-Smtp-Source: ACcGV61+nrSLbz9iKdWqTxKOzFtqSQXm4csHhVRg8/jHEWHvHokWPHS3hquKttFuzdyNngfnxMoG0M9ABx1gaI7vMNo= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr7220108ioa.168.1539445648210; Sat, 13 Oct 2018 08:47:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sat, 13 Oct 2018 09:47:17 -0600 Message-ID: Subject: Re: recursive GPT partitioning To: Wojciech Puchar Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2018 15:47:30 -0000 On Sat, Oct 13, 2018 at 9:27 AM Wojciech Puchar wrote: > i have 2 SSDs in server which is GPT partitioned. Among others there are > lots of partitions for virtual machines. i use glabel to label these > partitions > > Each partition is geli encrypted andthen partitioned MBR or GPT way > depending on many things. > > for geli encrypted partition then subdivided with MBR i can directly > access (of course if bhyve is not running on it) it with for example > > /dev/label/partitionname.elis1 - to access first subpartition of geli > encrypted "partitionname" labeled partition. > > > but with GPT subpartitioned partition it doesn't work. i need to use > ggatel to access subpartition. > > can it be changed? > static int g_part_gpt_probe(struct g_part_table *table, struct g_consumer *cp) { struct g_provider *pp; u_char *buf; int error, index, pri, res; /* We don't nest, which means that our depth should be 0. */ if (table->gpt_depth != 0) return (ENXIO); is what enforces that. It would be easy enough to add an option here such that you could do: #ifndef GPT_MAX_DEPTH #define GPT_MAX_DEPTH 0 #endif ... if (table->gpt_depth > GPT_MAX_DEPTH) return ENXIO; Warner