backgroud
as usual, Trying to create a 10TB partition using parted,I type command like
1 | parted -s -a optimal /dev/sdb mklabel gpt -- mkpart primary xfs 1 -1 |
but parted always complains as follows
1 | The resulting partition is not properly aligned for best performance |
soulation
Add optimal_io_size to alignment_offset and divide the result by physical_block_size. In my case this was
1 | # cat /sys/block/sdb/queue/optimal_io_size |
The trailing ‘s’ is important: it tells parted that you’re talking about sectors, not bytes or megabytes
finally,let check it,the partition will have been created with no warnings. You can check the alignment thusly (replacing ‘1’ with the partition number if necessary):
1 | (parted) align-check optimal 1 |