confusing /etc/fstab

Jeff Vian jvian10 at charter.net
Tue Feb 1 01:20:16 UTC 2005


On Mon, 2005-01-31 at 15:32 -0600, Paul F. Almquist wrote:
> On Monday 31 January 2005 13:33, Pedro Fernandes Macedo wrote:
> > Paul F. Almquist wrote:
> > >Labeling does introduce a problem:  What happens if 2 partitions have the
> > > same label?  Which one does mount choose?  I do not know the algorithm
It doesn't.  The conflict cannot be resolved, and it will hang

> > > but I do know that mount does not know which one you want to use.  In the
> > > technical college where I taught Unix/Linux system administration we had
> > > removable IDE drives in our lab machines. (standard IDE drives in a tray
> > > that slides into a bay the in cabinet.  works good.  I use them at home
> > > too)  I had a removable drive bay on my office machine. A couple of times
> > > I had to make some repairs to corrupted student drives.  Since the drives
> > > are not hot-swappable   I would power down my machine, insert the
> > > student's drive, power up and boot. Their partition labels were the same
> > > as on my internal IDE drive and as a result would bet mounted instead of
> > > my partitions.  After a couple time of messing with that I changed the
> > > /etc/fstab file on my system to use device names instead of labels.
> > >
> > >fsck also recognizes the labels, probably other disk related commands 
> > > too.
> > >
> > >paul
> >
> > In such cases , I strongly suggest changing the labels. Here I used to
> > have FC2 and FC3 test releases (during FC3 test) installed.
> > The root for FC2 was labeled / , the one for FC3 was labeled fc3/ . And
> > the same way for other partitions.
> > Now , if you need to insert another disk with the same labels , you can
> > always change the root=LABEL=/ part on grub to point to the right device.
> > This change can be done at boot time (just press "a" on grub screen) and
> > it probably will fix the issue, since the kernel will know exactly which
> > partition to use on boot time.
> That would take care of getting the right root partition but what about the 
> case where, for example, /usr was in a separate partition on each disk with 
> the same labels?
> 

It is for that reason, that I seldom use labels.
A machine that has drives already labeled at boot time will give new
partitions created new labels. Swapping different drives in with
conflicting labels will always cause a problem when labels are used in
fstab for mounting.

I always put the partition name in fstab instead of using labels and
thus do not have the conflict.

In general, different partitions with the same label will always
conflict when labels are used.

> Fortunately I rarely had to deal with the problem and since I retired last May 
> I won't likely run into to it again.
> 
> paul
> -- 
> Paul F. Almquist
> paul at almquist.name
> Eau Claire, WI  USA
> 




More information about the fedora-list mailing list