Skip to content

Commit

Permalink
records/2024-10-02: Correct GPT table size = 17 KiB
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Feb 7, 2025
1 parent c9762e3 commit e5f387e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/records/2024-10-02.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
SPARSE_SIZE indicates the consecutive number of bytes (defaults to 4k) that must contain only zeros for qemu-img to create a sparse image during conversion. If SPARSE_SIZE is 0, the source will not be scanned for unallocated or zero sectors, and the destination image will always be fully allocated.
```

在添加 `-S 0` 后测试,`qemu-img convert` 能够正常工作。由于一个 GPT 项只有 128B,而 `qemu-img` 默认 sparse size 为 4K,因此如果刚好对应的块设备区域没有被写零清空,那么本来为 0 的 GPT 表区域就会包含残留数据,进而导致了分区表校验和错误。
在添加 `-S 0` 后测试,`qemu-img convert` 能够正常工作。由于整个 GPT 表有 17 KiB,而 `qemu-img` 默认 sparse size 为 4K,因此如果刚好对应的块设备区域没有被写零清空,那么本来为 0 的 GPT 表区域就会包含残留数据,进而导致了分区表校验和错误。

相关问题已反馈 Proxmox: <https://bugzilla.proxmox.com/show_bug.cgi?id=5754>。经过内部讨论,我们暂时修改了 `QemuServer.pm` 添加 `-S 1M` 参数,并且 `apt-mark hold qemu-server` 锁定版本避免该 Perl 代码被覆盖。

Expand Down

0 comments on commit e5f387e

Please sign in to comment.