GNU bug report logs - #21560
bug-parted Digest, Vol 154, Issue 8

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: parted; Reported by: Rod Smith <rodsmith@HIDDEN>; dated Fri, 25 Sep 2015 17:12:02 UTC; Maintainer for parted is bug-parted@HIDDEN.

Message received at 21560 <at> debbugs.gnu.org:


Received: (at 21560) by debbugs.gnu.org; 25 Sep 2015 17:46:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 25 13:46:27 2015
Received: from localhost ([127.0.0.1]:43719 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZfX4k-00025v-TX
	for submit <at> debbugs.gnu.org; Fri, 25 Sep 2015 13:46:27 -0400
Received: from mail-yk0-f174.google.com ([209.85.160.174]:36425)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <phillsusi@HIDDEN>) id 1ZfX4j-00025n-1c
 for 21560 <at> debbugs.gnu.org; Fri, 25 Sep 2015 13:46:25 -0400
Received: by ykdt18 with SMTP id t18so121935179ykd.3
 for <21560 <at> debbugs.gnu.org>; Fri, 25 Sep 2015 10:46:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-type:content-transfer-encoding;
 bh=p1zTA4pxdPxB9qBYYNp4MGnLFpbzc9KALh0eROgdrBE=;
 b=PQIzBMgFX5Dv/jEvUXqtmd54eG7cRdCTnCd0GhAlHRayusFmHRujh4QI62GNAAyOdX
 8uTJwrJ9L2dkgnoSB/CQghW8qvPKFRtlI1JFU6MsmMO9xSCSmQE75wJdkOIpQUaiP5Vi
 sb8e23jdOWQoDao01AZh1M1sAfVAlWvg8JwqWy3s2DeN3QeCmhoFyQVHjwuGc5bK9r59
 MAaq7jeRIOqb99Rk4euyMkgrX4fN5JqkqLzPzDzRowktWTUtV3wDeWv9dfYXtE16ezse
 lbcGFYNG3unSVrPvkqE53uNUqVPPmmC9rGk2EvVfTZm1tEJBjFGwKNQifbbyqbK5kTpS
 3mOg==
X-Received: by 10.170.54.197 with SMTP id 188mr5890057ykw.123.1443203184360;
 Fri, 25 Sep 2015 10:46:24 -0700 (PDT)
Received: from [10.1.1.230] (fl-67-77-88-12.sta.embarqhsd.net. [67.77.88.12])
 by smtp.googlemail.com with ESMTPSA id
 c137sm3365389ywa.43.2015.09.25.10.46.23
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 25 Sep 2015 10:46:23 -0700 (PDT)
Subject: Re: bug#21560: bug-parted Digest, Vol 154, Issue 8
To: Rod Smith <rodsmith@HIDDEN>, 21560 <at> debbugs.gnu.org
References: <mailman.177.1443196875.20173.bug-parted@HIDDEN>
 <56057DF9.5040302@HIDDEN>
From: Phil Susi <psusi@HIDDEN>
X-Enigmail-Draft-Status: N1110
Message-ID: <5605883B.3090000@HIDDEN>
Date: Fri, 25 Sep 2015 13:45:31 -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: <56057DF9.5040302@HIDDEN>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 21560
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On 9/25/2015 1:01 PM, Rod Smith wrote:
> I've seen this type of layout before. I don't know of anything that will
> create it if given the choice, but I'm pretty sure that sfdisk will
> create such a layout if it's forced to do so. You might try using sfdisk
> to create a series of logical partitions with no gaps between them but a
> big gap between the start of the extended partition and the first
> logical partition to reproduce this behavior.

I remember that.  Also, I once had something corrupt my NTFS filesystem
and had to run the chkdsk from the installer cd to try and repair it,
and it decided to replace the boot sector with a FAT one.  Fortunately I
found a hex editor and restored the backup copy from the middle of the
volume.  Windows bad... grr...

> I wouldn't trust the Windows partitioning tools as far as I could throw
> them if they were written to a CD-R made of solid neutronium. I've seen
> too many tales over the years of them doing weird things with
> partitions, and especially with extended and logical partitions. I
> recall a rash of problem reports a few years ago in which the Windows XP
> (IIRC) installer was converting a logical partition into a primary
> partition but leaving it inside the extended partition. In other words,
> it's entirely believable that the Windows tools set things up this way
> -- but I certainly don't know that for a fact. Using sfdisk is likely to
> be an easier way to reproduce the issue.

I tried with fdisk first and it seems to insist on not just one sector
but an entire cylinder ( wtf? ) between the partitions.  I looked at
sfdisk and it seems to only work in cylinders.  Of course that was on my
14.04 system, so maybe I need to check a more recent version.

> I've only looked at this briefly, but this line looks like it might be
> something to do with manipulating the extended partition rather than a
> logical partition. If part is the logical partition being created and if
> part->prev is the extended partition, then this would be passing
> ped_geometry_new() the start point of the extended partition and the
> required size of the extended partition to hold the logical partition
> being created.

The sector argument gives the sector where the EBR it should write is
located.  The initial call gives it the first sector of the extended
partition, i.e. the EBR for partition 5.  Then when it recurses into
itself, it passes the sector of part->prev->geom.start, where part is
partition 6, and so it is passing the first sector of partition 5.





Information forwarded to bug-parted@HIDDEN:
bug#21560; Package parted. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Sep 2015 17:11:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 25 13:11:33 2015
Received: from localhost ([127.0.0.1]:43698 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZfWWy-0001I5-LU
	for submit <at> debbugs.gnu.org; Fri, 25 Sep 2015 13:11:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53437)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rodsmith@HIDDEN>) id 1ZfWWw-0001Hq-NI
 for submit <at> debbugs.gnu.org; Fri, 25 Sep 2015 13:11:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rodsmith@HIDDEN>) id 1ZfWWT-0001Ml-1F
 for submit <at> debbugs.gnu.org; Fri, 25 Sep 2015 13:11:23 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:33693)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rodsmith@HIDDEN>) id 1ZfWWS-00017w-SY
 for submit <at> debbugs.gnu.org; Fri, 25 Sep 2015 13:11:00 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60420)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rodsmith@HIDDEN>) id 1ZfWNc-00018G-AX
 for bug-parted@HIDDEN; Fri, 25 Sep 2015 13:01:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rodsmith@HIDDEN>) id 1ZfWNY-00046k-74
 for bug-parted@HIDDEN; Fri, 25 Sep 2015 13:01:52 -0400
Received: from eastrmfepo202.cox.net ([68.230.241.217]:59019)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rodsmith@HIDDEN>) id 1ZfWNY-00046Z-2Z
 for bug-parted@HIDDEN; Fri, 25 Sep 2015 13:01:48 -0400
Received: from eastrmimpo306 ([68.230.241.238]) by eastrmfepo202.cox.net
 (InterMail vM.8.01.05.15 201-2260-151-145-20131218) with ESMTP
 id <20150925170146.WGGJ17465.eastrmfepo202.cox.net@eastrmimpo306>
 for <bug-parted@HIDDEN>; Fri, 25 Sep 2015 13:01:46 -0400
Received: from nessus.rodsbooks.com ([98.182.36.23]) by eastrmimpo306 with cox
 id MV1l1r00b0Vxc5u01V1lhc; Fri, 25 Sep 2015 13:01:46 -0400
X-CT-Class: Clean
X-CT-Score: 0.00
X-CT-RefID: str=0001.0A020205.56057DFA.00E6,ss=1,re=0.000,fgs=0
X-CT-Spam: 0
X-Authority-Analysis: v=2.0 cv=Ao4wKpBP c=1 sm=1
 a=5/GQi7ztvdfnmBZvbhqgsw==:17 a=28bguoTQAAAA:8 a=ff-B7xzCdYMA:10
 a=8pif782wAAAA:8 a=fxJcL_dCAAAA:8 a=onCKLALDZOuPHLMfoNQA:9 a=pILNOxqGKmIA:10
 a=5/GQi7ztvdfnmBZvbhqgsw==:117
X-CM-Score: 0.00
Authentication-Results: cox.net; none
Received: from [192.168.1.2] (nessus.rodsbooks.com [192.168.1.2])
 by nessus.rodsbooks.com (Postfix) with ESMTP id C5FF82A04CE
 for <bug-parted@HIDDEN>; Fri, 25 Sep 2015 13:01:45 -0400 (EDT)
Subject: Re: bug-parted Digest, Vol 154, Issue 8
To: bug-parted@HIDDEN
References: <mailman.177.1443196875.20173.bug-parted@HIDDEN>
From: Rod Smith <rodsmith@HIDDEN>
X-Enigmail-Draft-Status: N1110
Message-ID: <56057DF9.5040302@HIDDEN>
Date: Fri, 25 Sep 2015 13:01:45 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
MIME-Version: 1.0
In-Reply-To: <mailman.177.1443196875.20173.bug-parted@HIDDEN>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

On 9/24/2015 11:56 AM, Brian C. Lane wrote:
>>
>> While parted lays out the disk this way, it doesn't have to be.  The EBR
>> for each chained logical volume can be placed anywhere in the extended
>> partition.  In his case, it looks like both are at the start of the
>> extended partition.  This is perfectly ok and parted should accept it.
>> 
>> Now that I have both EBRs I'm able to reproduce the crash and will try
>> to fix it.
> 
> Are you sure? According to
> https://en.wikipedia.org/wiki/Extended_boot_record the EBR is at the
> start of each logical partition, and chains to the next.

I've seen this type of layout before. I don't know of anything that will
create it if given the choice, but I'm pretty sure that sfdisk will
create such a layout if it's forced to do so. You might try using sfdisk
to create a series of logical partitions with no gaps between them but a
big gap between the start of the extended partition and the first
logical partition to reproduce this behavior.

On hu, 24 Sep 2015 12:33:08, James Ring wrote:

> I wish I could remember exactly how I partitioned the disk. I think I
> resized the NTFS partition using the Windows 7 tools and then let the
> Ubuntu installer partition the rest of the disk.

I wouldn't trust the Windows partitioning tools as far as I could throw
them if they were written to a CD-R made of solid neutronium. I've seen
too many tales over the years of them doing weird things with
partitions, and especially with extended and logical partitions. I
recall a rash of problem reports a few years ago in which the Windows XP
(IIRC) installer was converting a logical partition into a primary
partition but leaving it inside the extended partition. In other words,
it's entirely believable that the Windows tools set things up this way
-- but I certainly don't know that for a fact. Using sfdisk is likely to
be an easier way to reproduce the issue.

> From: Phil Susi <psusi@HIDDEN>
> 
> I've also been looking at the parted code for writing the partition
> table and I'm beating my head against the desk now because I swear, it
> can't possibly work the way it is.  What am I missing here?
> 
> It *should* be writing the EBR for the next logical partition to start -
> 1, or prev->end + 1.  Instead, it does this:
> 
> geom = ped_geometry_new (disk->dev, part->prev->geom.start,
>                          part->geom.end - part->prev->geom.start + 1);
> 
> That says put it in the boot sector of the previous logical partition,
> doesn't it?

I've only looked at this briefly, but this line looks like it might be
something to do with manipulating the extended partition rather than a
logical partition. If part is the logical partition being created and if
part->prev is the extended partition, then this would be passing
ped_geometry_new() the start point of the extended partition and the
required size of the extended partition to hold the logical partition
being created.

Brian's quite right that this code needs more comments; it's clear as mud.

-- 
Rod Smith
rodsmith@HIDDEN
http://www.rodsbooks.com




Acknowledgement sent to Rod Smith <rodsmith@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-parted@HIDDEN. Full text available.
Report forwarded to bug-parted@HIDDEN:
bug#21560; Package parted. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.