From unknown Tue Jun 17 20:16:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#41698 <41698@debbugs.gnu.org> To: bug#41698 <41698@debbugs.gnu.org> Subject: Status: [parted ISSUE] using cyl to align partitions fails Reply-To: bug#41698 <41698@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:16:21 +0000 retitle 41698 [parted ISSUE] using cyl to align partitions fails reassign 41698 parted submitter 41698 Zhiqiang Liu severity 41698 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 03 21:30:53 2020 Received: (at submit) by debbugs.gnu.org; 4 Jun 2020 01:30:53 +0000 Received: from localhost ([127.0.0.1]:44801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgeib-0000FU-09 for submit@debbugs.gnu.org; Wed, 03 Jun 2020 21:30:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:33906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgeY9-0008NW-EO for submit@debbugs.gnu.org; Wed, 03 Jun 2020 21:20:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgeY9-0000Kh-8F for bug-parted@gnu.org; Wed, 03 Jun 2020 21:20:05 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48354 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgeY8-0007Z8-8Y; Wed, 03 Jun 2020 21:20:04 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A235647F4EE9540D352A; Thu, 4 Jun 2020 09:20:00 +0800 (CST) Received: from [127.0.0.1] (10.166.215.235) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 4 Jun 2020 09:19:53 +0800 Subject: Re: [parted ISSUE] using cyl to align partitions fails From: Zhiqiang Liu To: , , , , , , , , References: <699f7589-0c83-523a-c3f2-307c1df86133@huawei.com> Message-ID: <032faedb-4117-a237-2929-04f38ce6521d@huawei.com> Date: Thu, 4 Jun 2020 09:19:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <699f7589-0c83-523a-c3f2-307c1df86133@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.166.215.235] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.32; envelope-from=liuzhiqiang26@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/03 21:18:12 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: friendly ping... CC:bug-parted@gnu.org On 2020/6/1 9:56, Zhiqiang Liu wrote: > Hi: > Now I parted a disk with command “parted /dev/sdb -s mkpart primary 0cyl 128cyl” > but the result was unexpected. The partition started 512 kB but not [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=liuzhiqiang26%40huawei.com;ip=209.51.188.17;r=debbugs.gnu.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [209.51.188.17 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 03 Jun 2020 21:30:52 -0400 Cc: lixiaokeng@huawei.com, linfeilong , arnout@mind.be, rjones@redhat.com, bug-parted@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) friendly ping... CC:bug-parted@gnu.org On 2020/6/1 9:56, Zhiqiang Liu wrote: > Hi: > Now I parted a disk with command “parted /dev/sdb -s mkpart primary 0cyl 128cyl” > but the result was unexpected. The partition started 512 kB but not expected 1 MB. > What’s more, the size of partition was 33.4 MB but not expected 1 GB. The commands are as follows, > 1. dd if=/dev/zero of=/dev/sdb bs=1M count=10 > 2. parted /dev/sdb -s mklabel msdos > 3. parted /dev/sdb -s mkpart primary 0cyl 128cyl > ->Warning: The resulting partition is not properly aligned for best performance: 1s % 2048s != 0s > > After analysis, the reason of size changed was that cylinder’s size was changed. > And the reason of starting position changed was that partition could not align > by 2048 sectors. When partition tried to align 2048 sectors, the end sector of > partition could not be in range of [127.5, 128.5) *cyl, which didn’t meet > command “128cyl”. > > I found that one patch for parted/libparted/arch/linux.c as show in > https://dcantrel.fedorapeople.org/patches/parted/0001-Use-BLKSSZGET-to-get-device-sector-size-in-_device_p.patch is > related with the problem. ioctl (arch_specific->fd, BLKSSZGET, §or_size) are used to get dev->bios_geom.sectors, > which changes from 63 to (1 + sector_size/PED_SECTOR_SIZE_DEFAULT). > > The patch has changed the cylinder’s size, and using cyl to align partitions will always fail. > However, I do not have any idea to solve the problem. Could you help me? > > Best regards. > Zhiqiang Liu >