GNU bug report logs - #63890
automatic alignment using 0% broken

Previous Next

Package: parted;

Reported by: Harald Dunkel <harri <at> afaics.de>

Date: Sun, 4 Jun 2023 10:10:01 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Harald Dunkel <harri <at> afaics.de>
To: bug-parted <at> gnu.org
Subject: automatic alignment using 0% broken
Date: Sun, 4 Jun 2023 12:09:12 +0200
Hi folks,

How comes that sometimes "mkpart test 0% ..." is properly aligned, and
sometimes it isn't? Sample:


{root <at> lola:code () 589} parted -a optimal /dev/sda
GNU Parted 3.5
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) mkpart test 0% 1%
(parted) u s p
Model: ASMT USB 3.0 TOSATA (scsi)
Disk /dev/sda: 976773168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End       Size      File system  Name  Flags
 1      65535s  9764714s  9699180s               test

(parted) rm 1
(parted) mkpart test 0% 4GiB
Warning: The resulting partition is not properly aligned for best performance: 34s % 65535s != 0s
Ignore/Cancel? i
(parted) u s p
Model: ASMT USB 3.0 TOSATA (scsi)
Disk /dev/sda: 976773168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End       Size      File system  Name  Flags
 1      34s    8388607s  8388574s               test

(parted)

{root <at> lola:code () 589} cat /sys/block/sda/queue/optimal_io_size
33553920
{root <at> lola:code () 590} cat /sys/block/sda/queue/minimum_io_size
512
{root <at> lola:code () 591} cat /sys/block/sda/alignment_offset
0
{root <at> lola:code () 592} cat /sys/block/sda/queue/physical_block_size
512


Why is the start of the partition not properly aligned for the 2nd mkpart?
It is "0%", as in the first case.

Is there some way to tell parted to *always* align start and end
properly, even if they were given in MiB instead of multiples of
65535s? I would be fine if parted adds a few sectors to the partition.


Regards
Harri




This bug report was last modified 2 years and 16 days ago.

Previous Next


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