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

2013-02-05 Thread Thomas Bächler
Am 05.02.2013 14:30, schrieb Baurzhan Muftakhidinov:
> What concerns me here is that there is no consistency on less powerful 
> machine.

There is no consistency. Period. Not on more powerful and not on less
powerful machines. There never was, there never will be.

In some form, this "problem" has existed for at least a decade, yet
people still consider it a new problem because they've just now seen it
for the first time.

Udev has provided persistent and predictable naming schemes for hard
drives for a long time (almost a decade probably). You MUST use those.




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-02-05 Thread Colin Guthrie
'Twas brillig, and Baurzhan Muftakhidinov at 05/02/13 13:30 did gyre and
gimble:
> 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.


As others have already commented, you simply should not use /dev/sd* at
all in any definition either on the kernel command line or in your fstab.

Distros switched many years ago to using UUIDs for fstab and kernel
command line entries - long before systemd existed.

Forget those /dev/sd* names, they are meaningless.

Use the UUID or use the LABEL. Anything else is just going to break in
confusing ways. Solutions for the problem already exist - better just to
use them.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-02-05 Thread Reindl Harald


Am 05.02.2013 14:30, schrieb Baurzhan Muftakhidinov:
> 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.

that's what random means :-(

> 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?

yes

> 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.

UUID's or at list LABEL= for mount-points were invented long before
systemd became a topic, finally it was ALWAYS luck to get the
same /dev/sdX but since this is meaningless because for years
anything and anybody refers UUID's nonody is wasting his time to
try make it more stable for no benefit



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-02-05 Thread Baurzhan Muftakhidinov
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  wrote:
> On Tue, Feb 5, 2013 at 9:30 AM, Baurzhan Muftakhidinov
>  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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-02-05 Thread Tom Gundersen
On Tue, Feb 5, 2013 at 9:30 AM, Baurzhan Muftakhidinov
 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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-02-05 Thread Reindl Harald


Am 05.02.2013 09:30, schrieb Baurzhan Muftakhidinov:
> Hello,
> 
> 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?

for what?

disks are mounted these days with UUID's an the
/dev/sdx is meaningless



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-02-05 Thread Baurzhan Muftakhidinov
Hello,

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?

Regards.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel