* Ext2/Ext3 partition label abuse
@ 2002-03-08 9:49 Boszormenyi Zoltan
2002-03-08 14:33 ` Guest section DW
2002-03-08 18:24 ` H. Peter Anvin
0 siblings, 2 replies; 4+ messages in thread
From: Boszormenyi Zoltan @ 2002-03-08 9:49 UTC (permalink / raw)
To: linux-kernel
Hi!
I have a RedHat 7.2 machine installed from scratch.
Recently I installed RedHat 7.2 on another machine
that has two harddisks (/dev/hda and /dev/hdc)
The second is in a removable bay.
Linux was installed on /dev/hdc.
My main machine also has a hdd bay (/dev/hdc) and I have
put the new machine's removable hdd into the main one
and booted up. (I had to copy some files and no network
between the machines.)
On boot I had strange errors that said that this and that
partitions cannot be found. I observed the following.
The / partition contains the main machine's data from /dev/hda2
although the mount command lists / as mounted from /dev/hdcX.
Every other partitions are mounted from /dev/hdc.
The problem is that /etc/fstab as used by RedHat, lists the partition
by LABEL=/mountpoint which labels can be found on both
/dev/hda and /dev/hdc.
The /proc/partitions "file" lists the partitions in disk-reversed order,
e.g.:
/dev/hdc1 ....
...
/dev/hdc10 ...
/dev/hda1 ...
...
/dev/hda9 ...
Is there a way to fix this? Yes there is: vendors should not use
LABEL=XXX method in /etc/fstab. Either use the proper
device/partition or the UUID. The downside is that fsck messages
would not be as pretty-printed as now. Or maybe the partitions
should not be registered in disk-reversed order...
Best regards,
Zoltán Böszörményi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Ext2/Ext3 partition label abuse
2002-03-08 9:49 Ext2/Ext3 partition label abuse Boszormenyi Zoltan
@ 2002-03-08 14:33 ` Guest section DW
2002-03-08 18:02 ` Mike Fedyk
2002-03-08 18:24 ` H. Peter Anvin
1 sibling, 1 reply; 4+ messages in thread
From: Guest section DW @ 2002-03-08 14:33 UTC (permalink / raw)
To: Boszormenyi Zoltan; +Cc: linux-kernel
On Fri, Mar 08, 2002 at 10:49:00AM +0100, Boszormenyi Zoltan wrote:
[I had two disks with the same labels on one machine and that caused
problems with booting]
Yes, if you have an fstab file that says: mount the filesystem with
label "ROOTDISK" on /, and then come with two filesystems that both are
labeled "ROOTDISK", then it is hardly surprising when problems arise.
The same will happen if you use UUID instead of label but created the
other disk by copying the first using dd.
You can change fstab for example with an editor.
You can change labels for example with the e2label utility.
Labels have an advantage for example when you add or remove a SCSI disk:
the label stays the same but the disks are renumbered.
Also when you add or remove partitions, causing a renumbering.
Using UUID is slightly more stable, slightly less user-friendly.
Attaching a significance to the order of items in /proc/partitions
is a bad idea.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Ext2/Ext3 partition label abuse
2002-03-08 14:33 ` Guest section DW
@ 2002-03-08 18:02 ` Mike Fedyk
0 siblings, 0 replies; 4+ messages in thread
From: Mike Fedyk @ 2002-03-08 18:02 UTC (permalink / raw)
To: Guest section DW; +Cc: Boszormenyi Zoltan, linux-kernel
On Fri, Mar 08, 2002 at 03:33:45PM +0100, Guest section DW wrote:
> On Fri, Mar 08, 2002 at 10:49:00AM +0100, Boszormenyi Zoltan wrote:
>
> [I had two disks with the same labels on one machine and that caused
> problems with booting]
>
> Yes, if you have an fstab file that says: mount the filesystem with
> label "ROOTDISK" on /, and then come with two filesystems that both are
> labeled "ROOTDISK", then it is hardly surprising when problems arise.
> The same will happen if you use UUID instead of label but created the
> other disk by copying the first using dd.
>
> You can change fstab for example with an editor.
> You can change labels for example with the e2label utility.
>
> Labels have an advantage for example when you add or remove a SCSI disk:
> the label stays the same but the disks are renumbered.
> Also when you add or remove partitions, causing a renumbering.
> Using UUID is slightly more stable, slightly less user-friendly.
>
> Attaching a significance to the order of items in /proc/partitions
> is a bad idea.
It would be nice if the raid code could do that with drive serial numbers...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Ext2/Ext3 partition label abuse
2002-03-08 9:49 Ext2/Ext3 partition label abuse Boszormenyi Zoltan
2002-03-08 14:33 ` Guest section DW
@ 2002-03-08 18:24 ` H. Peter Anvin
1 sibling, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2002-03-08 18:24 UTC (permalink / raw)
To: linux-kernel
Followup to: <3C88890C.6010303@mail.externet.hu>
By author: Boszormenyi Zoltan <zboszor@mail.externet.hu>
In newsgroup: linux.dev.kernel
>
> The /proc/partitions "file" lists the partitions in disk-reversed order,
> e.g.:
>
> /dev/hdc1 ....
> ...
> /dev/hdc10 ...
> /dev/hda1 ...
> ...
> /dev/hda9 ...
>
> Is there a way to fix this? Yes there is: vendors should not use
> LABEL=XXX method in /etc/fstab. Either use the proper
> device/partition or the UUID. The downside is that fsck messages
> would not be as pretty-printed as now. Or maybe the partitions
> should not be registered in disk-reversed order...
>
Or maybe mount(8) should signal an error if a label is ambiguous
instead of mounting a random partition.
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-03-08 18:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-08 9:49 Ext2/Ext3 partition label abuse Boszormenyi Zoltan
2002-03-08 14:33 ` Guest section DW
2002-03-08 18:02 ` Mike Fedyk
2002-03-08 18:24 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox