Artificial intelligent assistant

How to specify reproducible disk partitions in Debian preseed file when device file ordering (sda, sdb ...) may change? I'm about to automate the installation of Debian by using the preseed mechanism (preseed file added to initrd). The computers to be provisioned have multiple SATA disks. I would like to specify in the preseed file precisely what partition to put on what disk. This is possible, of course, by specifying the associated device files (sda, sdb, sdc). However, if I understand correctly, the association between disk and device file is not a priori defined in general, and may even change after rebooting in certain situations. I am especially concerned about usb sticks or other portable hard drives. I have encountered such a situation myself, when the usb stick was /dev/sda during installation from that very stick. So, how do I ensure, that the right partition is placed on the right disk, each time the preseeded ISO image is used for installation?

The summarize the answer, based a comment from @MarkPlotnick: The key is to understand, that there are multiple device files representing the same drive. The most well known are /dev/sda, /dev/sdb etc. where the ordering is not well defined. However, drives can also be refered to by using the device files in /dev/disk/by-id. These device files are bound to the serial numbers of the disks and are therefore unambigously and reproducably defined. And as it turns out, I could use those device files in the preseed as a replacement for /dev/sda etc.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5254457e3c8dfabb5b93f4a98b9671dc