[systemd-devel] Booting with USB flash disk installed results in wrong disk numbering

Tom Gundersen teg at jklm.no
Tue Feb 5 01:36:35 PST 2013

On Tue, Feb 5, 2013 at 9:30 AM, Baurzhan Muftakhidinov
<baurthefirst at gmail.com> wrote:
> I have systemd in both Arch and Debian sid, on my netbook.
> I have noticed that when I power on netbook with USB flash disk installed,
> this USB drive sometimes becomes /dev/sda.
> Is this correct? How can I ensure that hard disk is first, at every boot?

You cannot. The kernel will enumerate the devices in the order it
becomes aware of them, which is not deterministic. To get reliable
device names you should use /dev/disk/by-*/* which are guaranteed to
be stable between boots. Alternatively, as Reindl suggests, both the
kernel commandline and fstab (and probably others) support specifying
devices by UUID=, LABEL=, PARTUUID= or PARTLABEL=, which correspond to
the /dev/disk/by-* entries.



More information about the systemd-devel mailing list