wipe_dev() fails with ENOSPC on partitions smaller than 1024 bytes (ChromeOS GPT layouts)
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- linux, python
调研方向
从 archinstall/lib/disk/device_handler.py 开始,重点查看 DeviceHandler.wipe_dev() 和 _wipe(),然后运行 issue 中独立的 loop-device 复现。完成的标准是:擦除 512 字节分区不再引发 ENOSPC,同时普通分区仍会将 1024 字节置零。
由索引模型根据 Issue 内容生成。
描述
Which ISO version are you using?
Omarchy 4.0.4 ISO, which ships archinstall 4.4 unmodified: its archinstall/lib/disk/device_handler.py is byte-identical to the 4.4 tag. The affected code is unchanged on master.
The installation log
Not available: the live session was rebooted before /var/log/archinstall/install.log was saved. There is a standalone reproduction below instead. omacom/omarchy#9246 quotes the traceback from the same failure on other machines, ending in open(dev_path, "wb") → OSError: [Errno 28] No space left on device.
describe the problem
A wipe/full-disk install of a disk previously used by ChromeOS or ChromeOS Flex fails with OSError: [Errno 28] No space left on device.
DeviceHandler.wipe_dev() calls _wipe() on every existing partition, and _wipe() writes a fixed 1024 bytes:
with open(dev_path, 'wb') as p:
p.write(bytearray(1024))
ChromeOS GPT layouts contain several 512-byte partitions (KERN-C, ROOT-C, reserved and firmware slots). The ChromiumOS disk-format reference says "Each minimal-size partition (including the C kernel and C rootfs) is only 512 bytes". Writing 1024 bytes to one of them fails after 512 bytes with ENOSPC, which aborts the installation.
Reproduction (as root, any Linux):
truncate -s 64M t.img
sgdisk -o -a 1 -n 6:100:100 t.img && sgdisk -a 2048 -n 1:2048:0 t.img # one 512-byte partition, one normal
LOOP=$(losetup -fP --show t.img)
python -c "with open('${LOOP}p6', 'wb') as p: p.write(bytearray(1024))" # OSError: [Errno 28] No space left on device
python -c "with open('${LOOP}p1', 'wb') as p: p.write(bytearray(1024))" # fine
Reproduced on Linux 6.8 (loop device) and under the Omarchy ISO's 7.2.4 kernel with an NVMe disk. Seen on real hardware on a Lenovo ThinkPad (Samsung NVMe) and on two MacBook Airs (omacom/omarchy#9246), each after ChromeOS Flex. Clearing the partition table first (wipefs -a + sgdisk --zap-all) avoids it.
A fix follows in a pull request: write min(1024, device size) bytes, taking the size from seeking to the end of the block device. On normal partitions the behaviour is unchanged (1024 bytes zeroed); on a 512-byte partition all 512 bytes are zeroed instead of raising.
- 主要语言
- Python
- 星标
- 8.5k
- 派生
- 774
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
archlinux/archinstall 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
archlinux/archinstall#4836 ·
维护者通常 1 天内回复
-
dms profile可能已有人在做 @h8d13 于 15 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
archlinux/archinstall#4820 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
archlinux/archinstall#4603 ·
维护者通常 1 天内回复
-
Create `archinstall-meta` package to tie in all dependencies可能已有人在做 @VykosMolt 于 47 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
archlinux/archinstall#4385 · 2 条评论 ·
维护者通常 1 天内回复
-
Archinstall fail未关闭
难度 4/5 3-5 天 新手友好度 45/100
archlinux/archinstall#4838 · 2 条评论 ·
维护者通常 1 天内回复
查看 archlinux/archinstall 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
sierra-research/tau2-bench#635 ·
维护者通常 1 天内回复
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python ones可能已有人在做 @fmuia 今天认领。 未关闭documentation skill
难度 2/5 1-3 小时 新手友好度 83/100
lnccbrown/ssm-simulators#406 ·
维护者通常 4 天内回复
-
难度 1/5 1 小时以内 新手友好度 95/100
btclib-org/btclib-ecc#309 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
jbacalso24/mimry#459 · 1 条评论 ·
维护者通常 1 天内回复
-
auth bug high-priority
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复