diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index 88e08653e8..7f582095cd 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -617,7 +617,11 @@ def _wipe(self, dev_path: Path) -> None: @type dev_path: str """ with open(dev_path, 'wb') as p: - p.write(bytearray(1024)) + # Never write past the end of the device: ChromeOS GPT layouts contain + # 512-byte partitions, and a 1024-byte write to them fails with ENOSPC. + size = p.seek(0, os.SEEK_END) + p.seek(0) + p.write(bytearray(min(1024, size))) def wipe_dev(self, block_device: BDevice) -> None: """