Trying to create a 7TB partition using parted, but parted always complains as follows:
Tried “parted -a optimal“, but the result is same.
(parted) mkpart primary 0 7000G
Aviso: The resulting partition is not properly aligned for best performance. Descartar/Ignore/Cancelar/Cancel?
Parted uses the following algorithm to determine optimal alignment for newly created partition. If none of the following conditions, 2a, 2b, or 2c are satisfied, then the warning message “” would be displayed by parted utility.
Always use the reported alignment offset as offset.
If optimal io size is present in the topology info, use that as grain.
If optimal io size is not present in topology info and alignment offset is 0 and minimum io size is a power of 2, use the default optimal alignment (grain 1MiB).
If not 2a and 2b, use the minimum io size, or if that is not defined the physical sector size as grain (iow the minimum alignment).
In this case, the corresponding sysfs values are:
# cat /sys/block/sdb/queue/optimal_io_size
# cat /sys/block/sdb/queue/minimum_io_size
# cat /sys/block/sdb/alignment_offset
# cat /sys/block/sdb/queue/physical_block_size
With a sector count of 13674214832 for the disk, 13674214831 should be used as the end sector for using parted on this disk.
With the optimal_io_size value 1835008 exceeding 1MiB, parted wants to align to the optimal_io_size. 1835008 / 512 = 3584 sectors for the optimal size in sectors. The start of a partition should be a multiple of 3584 sectors for optimal performance. To make a single partition for this disk with this alignment, the parted command:
mkpart p ext2 3584s 13674214831s
This should generate a partition with the optimal alignment and should avoid the warning too.
(parted) mkpart p ext2 3584s 13674214831s
Warning: You requested a partition from 1835kB to 7001GB
The closest location we can manage is 1835kB to 7001GB
Is this still acceptable to you? Yes/No? Yes
(parted) unit s p
Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sdb: 13674214832s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size Filesystem Name Flags 1 3584s 13674214798s 13674211215s p