Comment 22 for bug 1347726

Revision history for this message
dragon788 (dragon788) wrote :

I was running into the same issue and finally by luck happened upon a set of slides that allowed me to automate this and there was an accompanying code repository with the full preseed file. https://github.com/uweplonus/adia-install/blob/master/initrd/preseed.cfg#L3

Many people suggest using `preseed/early_command umount /media/*` but this hasn't worked for quite some time due to the timing of when the preseed portion runs compared to the partitioning.

The correct way to do this is to add the following anywhere in your preseed file that is referenced by the boot command.

```d-i partman/early_command string \
USBDEV=$(list-devices usb-partition | sed "s/\(.*\)./\1/");\
BOOTDEV=$(list-devices disk | grep -v "$USBDEV" | head -1);\
debconf-set partman-auto/disk $BOOTDEV;\
debconf-set grub-installer/bootdev $BOOTDEV; \
umount /media;
```