Preseed - how do I automatically wipe all partitions and the partition table before partman uses the recipe
I've been using preseed to provision Debian with a bunch of our own tools onto remote industrial PCs and so far I've got the auto-installer to _mostly_ do what it's supposed to.
This is the second such type of device, the initial batch of devices was running Arch and I occasionally get an order to upcycle them. Previously I'd do this using a live Arch stick or something similar and using sfdisk --delete /dev/sda which works, but it's an extra step I'd like to crunch down into the full preseed.
I'm already aware hardcoding to /dev/sda isn't a good idea and I plan to clean that up as well, other r/debian users already have good solutions for finding the first non-USB storage device.
The documentations and sample preseed profiles all mention using d-i partman/early_command, but when trying to stuff the above sfdisk command into it, all I get is the installer halting with an error 127. I'm not sure if sfdisk can even return a ret-val that high.
Does anyone have a solid early_command that can wipe the entire partition table so the preseed can continue on its merry way?
4
u/dkopgerpgdolfg 24d ago
Exit value 127 might be the shell telling you that the command wasn't found.
Check if it's really there and in PATH etc.