Fix location of GPT header on 4K LBA devices.

BUG: 453333
This commit is contained in:
Andrius Štikonas 2022-05-04 17:48:35 +01:00
parent d247e027a1
commit 36881cde62
1 changed files with 2 additions and 1 deletions

View File

@ -451,7 +451,8 @@ bool SfdiskBackend::updateDevicePartitionTable(Device &d, const QJsonObject &jso
// Read the maximum number of GPT partitions
qint32 maxEntries;
QByteArray gptHeader;
CopySourceDevice source(d, 512, 1023);
qint64 sectorSize = d.logicalSize();
CopySourceDevice source(d, sectorSize, sectorSize * 2 - 1);
ExternalCommand readCmd;
gptHeader = readCmd.readData(source);