GNU bug report logs - #41698
[parted ISSUE] using cyl to align partitions fails

Previous Next

Package: parted;

Reported by: Zhiqiang Liu <liuzhiqiang26 <at> huawei.com>

Date: Thu, 4 Jun 2020 01:31:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Zhiqiang Liu <liuzhiqiang26 <at> huawei.com>
To: <dcantrell <at> redhat.com>, <psusi <at> ubuntu.com>, <bcl <at> redhat.com>, <dongdwdw <at> linux.vnet.ibm.com>, <polzer <at> gnu.org>, <clausen <at> gnu.org>, <buytenh <at> gnu.org>, <neal <at> cs.uml.edu>, <Matt_Domsch <at> dell.com>
Cc: lixiaokeng <at> huawei.com, linfeilong <at> huawei.com, arnout <at> mind.be, rjones <at> redhat.com, 41698 <at> debbugs.gnu.org
Subject: bug#41698: [parted ISSUE] using cyl to align partitions fails
Date: Thu, 4 Jun 2020 09:19:52 +0800
friendly ping...
CC:bug-parted <at> 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, &sector_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
> 





This bug report was last modified 5 years and 14 days ago.

Previous Next


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