From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ciZ84-0003pz-31 for mharc-grub-devel@gnu.org; Mon, 27 Feb 2017 23:11:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciZ82-0003ps-CL for grub-devel@gnu.org; Mon, 27 Feb 2017 23:11:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciZ7v-0000RK-Pz for grub-devel@gnu.org; Mon, 27 Feb 2017 23:11:10 -0500 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:36721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ciZ7v-0000PB-FB for grub-devel@gnu.org; Mon, 27 Feb 2017 23:11:03 -0500 Received: by mail-lf0-x229.google.com with SMTP id y193so250995lfd.3 for ; Mon, 27 Feb 2017 20:11:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=cqzYdW5ZOvaJdDH2pwSwbqBbXWUKvvDLHi3sijCv9Hs=; b=PqbI+MRMzQA2y5ACLM8FdJvUgDEc5AU4Bt82EU+hVu5mDZRMfaUP/rPxPQKtzYb+pg KD1+7u1jeJGP4fNdaNsdjbAmFVDgKvsw0dq1YrjbSTju+XreHuM6RySNO3l6oB+cC/Ui LTwOcG+AMd0lLnXfKfmX8phxW5UDgDZH2AO4uOcoikMFYpImbvy3J4mS0Jh5C81/B6pP LpOoKmEMaTJK6jzASb42Srr7xdQFzEpBaZBxJNc3U7f2BFsNprHvZcQFsUNLataH/TOd 1jT1ZK0DnM/RrUjug+DsRO9aAvJRjMle2vn0RA/TUDBFghbkG0JmCf2R0NaCUjL2JMNK h48w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cqzYdW5ZOvaJdDH2pwSwbqBbXWUKvvDLHi3sijCv9Hs=; b=UZH4DukkbXsL+NSruuPA6WTxRiFhP0sYQidWlLsvt8fAxm+O6j7o+4oNMaRFSIoXRS lIdmU8Uq00pM6c4ys6Wx0brSJhpBe3PjW874hUy56lyterK5pmWZ+zb0oKfyATrNMe+d gRlH6YV6qG89Qg6IGnTtKUAlBVr10H0WLe8EKqMbntqqOGL9qUf1NLIgqq0rBGsciscO zKetH/stetgW1kstaGJyVBZ5OEuqA4q33H8mcCCrLCcYWZUiS8zb5SRwKZElodIPPyLB PYbwZU+KupWJDXzNth/bIPHd3JQ/jmnOe1lbWKfQZ6bMd/OZklD7I1L/RifZ7/YY/ICt JK0Q== X-Gm-Message-State: AMke39mR+z9BtxPotuYLC0kX/QkS08/36yCHSZB8a13v6Rc3/Z/tgiekSWh8FlDaHGyFUw== X-Received: by 10.25.37.10 with SMTP id l10mr70065lfl.17.1488255061938; Mon, 27 Feb 2017 20:11:01 -0800 (PST) Received: from [192.168.1.6] (ppp109-252-90-129.pppoe.spdop.ru. [109.252.90.129]) by smtp.gmail.com with ESMTPSA id 79sm89526ljj.45.2017.02.27.20.11.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 20:11:01 -0800 (PST) Subject: Re: [PATCH 1/1] add --partuuid to probe To: grub-devel@gnu.org References: <20170214180035.3461-1-skenton@ou.edu> <2e48f17a-20d7-c9cb-2300-1bc5fec88f12@gmail.com> From: Andrei Borzenkov Message-ID: Date: Tue, 28 Feb 2017 07:11:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::229 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 04:11:11 -0000 27.02.2017 21:20, Vladimir 'phcoder' Serbinenko пишет: > On Mon, Feb 27, 2017, 09:55 Andrei Borzenkov wrote: > >> 27.02.2017 03:37, Vladimir 'phcoder' Serbinenko пишет: >> ... >>>>>>> This is not NT-style. NT uses partition offset. Who uses this format? >>>> Are >>>>>> >>>>>> This is used by util-linux and Linux kernel. >>>>>> >>>>>> >>>>>> * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing >>>> the >>>>>> * unique id of a partition if the partition table provides >> it. >>>>>> * The UUID may be either an EFI/GPT UUID, or refer to an >> MSDOS >>>>>> * partition using the format SSSSSSSS-PP, where SSSSSSSS is a >>>>>> zero- >>>>>> * filled hex representation of the 32-bit "NT disk >> signature", >>>>>> and PP >>>>>> * is a zero-filled hex representation of the 1-based >> partition >>>>>> number. >>>>>> >>>>>>> you sure that partition numbers are synced with user? Even in >> presence >>>> of >>>>>>> Solaris and bsd partitions. >>>>>>> >>>>>> >>>>>> It is not clear what we should return for nested partition. I'm not >> sure >>>>>> whether linux kernel scans nested partitions at all in which case we >>>>>> probably should follow the suite and assign PARTUUID to top-level >>>>>> partitions only. >>>>>> >>>>> Linux scans nested partitions and it uses though numeration in >> dev/sdaX, >>>> in >>>>> some cases shifting numbering of normal partitions. In those cases grub >>>> and >>>>> Linux numeration get out of sync >>>>> >>>> >>>> Can you provide example? >>> >>> Bsd and Solaris partitions. I remember we had problem with numbering of >>> those. >>> >> >> Linux ignores nested BSD partitions (just tested). There are no special >> files created. Of course someone needs to test what happens under >> *BSD/Solaris in this case. >> > Kpartx or normal sdX? Is bsd-partition support enabled in kernel build? > OK I see, kernel skips BSD partition marked as "unused". So it appears that kernel always puts special nested partitions after normal logical MSDOS partitions, so it will not skew MSDOS partition numbers. [ 1.529752] vda: vda1 vda2 vda3 < vda5 vda6 > vda2: /* * Look for partitions in two passes: * First find the primary and DOS-type extended partitions. * On the second pass look inside *BSD, Unixware and Solaris partitions. */ For such partition (vda7) PARTUUID is empty. P.S. I wonder whether we correctly map such partition ... no, we do not. 10:~ # cat /tmp/foo (hd0) /dev/vda 10:~ # grub2-probe -m /tmp/foo -t compatibility_hint -d /dev/vda2 hd0,msdos2 10:~ # grub2-probe -m /tmp/foo -t compatibility_hint -d /dev/vda5 hd0,msdos5 10:~ # grub2-probe -m /tmp/foo -t compatibility_hint -d /dev/vda7 hd0,msdos2 >> >> I never liked idea of artificial partition GUIDs for MBR, but as long as >> only Linux is using them and we are consistent with its usage - so be it. >> >>>> I tried to create nested partition table, but >>>> Linux will not display it (actually attempt to "blockdev --rereadpt >>>> /dev/vda5" fails with "Invalid argument"). >>>> >>>> if (!disk_part_scan_enabled(disk) || bdev != bdev->bd_contains) >>>> return -EINVAL; >>>> >>>> Where bdev->bd_contains points to containing device for partition and to >>>> itself for the whole disk. >>>> >>>> As util-linux does not scan partition table itself, it does show these >>>> nested partitions either.