Comment 9 for bug 1564977

Revision history for this message
Ryan Harper (raharper) wrote :

It's not random; one or more of the drives on the various machines is set to use 4k sectors.

I've reproduced the failure by forcing qemu to run the target disks in 4k mode (logical_block_size=4k,physical_block_size=4k).

Then we fail the same way. The root of the issue is that values from /sys/class/block/XXX/size are *always* reported in 512b sizes, no matter if the devices is in 4k or some other size.

This exposed a bug in the calcuation of where to start and end for any partition past the first one.

The fix is to convert the size/start to bytes and divide by the logical_block_size_bytes, to return to drive native sector count.