setup-disk: fix partition failed on some machines
On some machines, sfdisk partition failed as 1M start offsets
not aligns.
When set a aligned start offsets
value. It works fine.
But it's recommended not to specify start offsets
according to sfdisk
manpage.
So this PR deprecated it.
https://man.archlinux.org/man/sfdisk.8.en#DESCRIPTION
The recommended way is not to specify start offsets at all and specify partition size in MiB, GiB (or so). In this case sfdisk aligns all partitions to block-device I/O limits (or when I/O limits are too small then to megabyte boundary to keep disk layout portable). If this default behaviour is unwanted (usually for very small partitions) then specify offsets and sizes in sectors. In this case sfdisk entirely follows specified numbers without any optimization.
Here is the case on scaleway
Block volumes
VM.
localhost:~# setup-disk -m sys /dev/sda
WARNING: The following disk(s) will be erased:
sda (10.0 GB SCW b_ssd )
WARNING: Erase the above disk(s) and continue? (y/n) [n] y
Sector 2048 already used.
Failed to add #1 partition: Result not representable
localhost:~# cfdisk /dev/sda
Disk: /dev/sda
Size: 9.31 GiB, 10000000000 bytes, 19531250 sectors
Label: gpt, identifier: B1472781-8E53-AA4F-AD26-45AEBE9AB83F
Device Start End Sectors Size Type
>> Free space 8192 19531216 19523025 9.3G
localhost:~# fdisk -l /dev/sda
Found valid GPT with protective MBR; using GPT
Disk /dev/sda: 19531250 sectors, 1344M
Logical sector size: 512
Disk identifier (GUID): b1472781-8e53-aa4f-ad26-45aebe9ab83f
Partition table holds up to 128 entries
First usable sector is 8192, last usable sector is 19531216
localhost:~# cat /sys/block/sda/queue/optimal_io_size
4194304