fstab error - why does this work at all?

I have put this post here as it isn’t really a problem but it puzzles me

We built a 12.1 machine and then cloned it using clonzilla and
rolled it out to 30 machines. Unfortunately we forgot to check
fstab and the image had disk by id rather than by device.
( this is only an experimental build so don’t berate me for not testing it properly first )

so the first two lines of fstab are like this

/dev/disk/by-id/ata-ST3160813AS_9SY2FC78-part3 swap swap defaults 0 0
/dev/disk/by-id/ata-ST3160813AS_9SY2FC78-part2 / ext4 acl,user_xattr 1 1

instead of

/dev/sda3 swap swap defaults 0 0
/dev/sda2 / ext4 acl,user_xattr 1 1

Since /dev/disk/by-id/ata-ST3160813AS_9SY2FC78-part3 etc doesn’t exist on the cloned
machines I don’t understand why these machines work at all. They get as far as the lizard
splash screen and then pause for 90 seconds then they continue and work ( apparently ) perfectly.

Changing the fstab to what it should be means they start in about 17 seconds, which isn’t bad for
an old machine…

Can someone explain why they worked at all

Ta

Mal

interele wrote:

> /dev/sda3 swap swap defaults
> 0 0
> /dev/sda2 / ext4 acl,user_xattr
> 1 1

Do NOT use this style. Use UUIDs or labels instead.

On 2012-04-12 11:56, interele wrote:
> Can someone explain why they worked at all

Because the system tries to guess the correct place and finds it. You might
see it in the boot messages if splash is not active, but then systemd is
not that verbose.

But do not use sdaX names. Labels or UUIDs for cloning.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Couple of questions spring to mind :-
Why not use use that style, the hardware is never going to change
How do you use UUID on imaged machines ?
I was under the impression that labels just pointed at device names

…well three questions

:slight_smile:

Mal

When we use /dev/disk/by-id/ata-ST3160813AS_9SY2FC78-part3, this names a specific hard drive and partition which will not change as you plug in USB drives or if a hard drive should not work. When you use /dev/sda1, this drive reference is relative and will/can be upset as hardware comes and goes. You could consider using /dev/sda1, but then after boot, run a script that fixes the /dev/sda stuff back to a UUID or disk by-id, specific to each machine.

To List sdx to by-id do a:

ls -l /dev/disk/by-id

For List sdx to by-uuid do a:

ls -l /dev/disk/by-uuid

Thank You,

On 2012-04-12 18:56, interele wrote:
>
> Couple of questions spring to mind :-
> Why not use use that style, the hardware is never going to change

Because it does. On some machines it doesn’t, in other it changes. The
kernel can not guarantee a fixed /dev/sdX name all the life, not even on
every boot.

For example, mine changes if I plug external eSATA disks, which should be
named after the internal… but they are not. Or, if you have a sata only
setup and one day you add an extra disk, perhaps an old pata disk - all
nodes change. On some machines it changes from one day to the next
depending on which disk is 1 ms faster to appear on the bus.

> How do you use UUID on imaged machines ?

The UUID is set when you format each partition; thus when you copy an image
you also copy the uuid. It is valid even if you plug the disk on a
different port.

> I was under the impression that labels just pointed at device names

Yes, true. But whereas a label is guaranteed to point at the same real
device, the “device” is not.

Linux changes…


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hi,

Thanks for getting back on this

In my environment I can guarantee the hardware won’t change in the lifetime of the machine ( it’s a school )
They only have 1 disk and anyone who was found adding anything to the machines would be in detention
until they were old enough to marry :wink:

On the second issue, yes, that’s is the problem. When the original machine is cloned the disks UUID are in
fstab which is different on the cloned machine, hence the 90 second pause and the original question.
The only way I could think of to use UUID on the cloned machines is visit each machine once it is up and
use blkid to get the UUID of the disk and then and manually change fstab. Once we go live in the summer
holidays it’s something I’d rather not do. With 400 machines the minimum amount of work I have to do
on each machine the better.

best wishes

Mal

interele wrote:
> Hi,
>
> Thanks for getting back on this
>
> In my environment I can guarantee the hardware won’t change in the
> lifetime of the machine ( it’s a school )
> They only have 1 disk and anyone who was found adding anything to the
> machines would be in detention
> until they were old enough to marry :wink:

Just because you can find a specific set of circumstances in which
something may or may not currently be true, doesn’t make it a good idea.

There is no need to use names like /dev/sda. DO NOT USE THEM.

> On the second issue, yes, that’s is the problem. When the original
> machine is cloned the disks UUID are in
> fstab which is different on the cloned machine, hence the 90 second
> pause and the original question.

No, you are thinking of the device ids used by suse, not UUIDs. i.e. You
have not understood what people have told you. Either you are careless
in reading or you are lazy in clearing up your doubts.

As usual, you’re not giving any respect to people who are trying to help
you, because you are refusing to do the background reading that you
obviously need to do.

So this is my last post in this thread.

On 2012-04-13 08:16, interele wrote:
>
> Hi,
>
> Thanks for getting back on this
>
> In my environment I can guarantee the hardware won’t change in the
> lifetime of the machine ( it’s a school )

There may be instances where you can get away with using the old system,
but you should not be doing it wrong even if you can. Even less in a
school, because they will think this is the correct method.

> On the second issue, yes, that’s is the problem. When the original
> machine is cloned the disks UUID are in
> fstab which is different on the cloned machine, hence the 90 second
> pause and the original question.

Wrong. The UUIDs are cloned, I told you that. THE IDs do change, the UUIDs
do not. Please read carefully what we write.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

So you could say …

In this situation it will work but we don’t recommend it
and you seem to have got mixed up with by-id and by-uuid

or you could just have a rant and insult me, which ever is easier

On Fri, 13 Apr 2012 17:49:15 +0530, interele
<interele@no-mx.forums.opensuse.org> wrote:

>
> So you could say …
>
> In this situation it will work but we don’t recommend it
> and you seem to have got mixed up with by-id and by-uuid
>
> or you could just have a rant and insult me, which ever is easier
>

what exactly are you feeling insulted for?


phani.

I ask every one to stay civil here and if you have nothing good to say that helps, then decide to say nothing or I will close this message thread. Please decide to help today and to not hurt.

Thank You,