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

Baurzhan Muftakhidinov baurthefirst at gmail.com
Tue Feb 5 05:30:58 PST 2013


Alright,
I've tried on netbook and on relatively powerful laptop to boot 10 times
latest ArchLinux's archboot image from the USB drive.

On laptop, hard disk was /dev/sda 10 times out of 10 tries,

On netbook, only 3 times hard disk was /dev/sda and 7 times USB drive
became /dev/sda.

What concerns me here is that there is no consistency on less powerful machine.

So I should just believe in the RANDOM choice on every boot on my netbook?

On Debian with sysvinit it works just fine. When I change sysvinit to
systemd (kernel and udev are the same),
I see the situation I am talking here.

This is what I asked for, maybe there is some kind of timeout for
detecting disks.

Thanks.

On Tue, Feb 5, 2013 at 3:36 PM, Tom Gundersen <teg at jklm.no> wrote:
> 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.
>
> HTH,
>
> Tom


More information about the systemd-devel mailing list