[Leaplist] fstab
Bryan J. Smith
b.j.smith at ieee.org
Thu May 29 17:06:50 EDT 2008
Jim Hartley wrote:
> Because of the way I installed things, the LABELs in my Fedora 7
> fstab are VERY confusing.
> I first installed some version of CentOS on /dev/sda3
"I first installed" ... now we're getting somewhere.
I could reflect back to your "typical" comment, but I won't.
It's quite admittedly argumentative for me to do so. ;)
> (actually, at that point it was /dev/hda3!),
Upstream kernel is now labeling all devices as /dev/sdX# and no
longer separate "Winchester" (hd) and "SCSI" (scsi) devices. Newer
kernels in newer distros reflect this, not just Fedora.
> with /home on /dev/sda8 and a spare partition
> (same size as /dev/sda3) on /dev/sda5.
> Then I put Fedora 6 on /dev/sda5 and used it for a while.
> Something get messed up
Did you change the disk layout at some point?
I.e., remember that hda5/sda5 is the first Logical slice (partition)
in an Extended disk label (a primary slice/partition marked as
Extended), and sector 0 is used to store the slice info for the
Extended disk label. So hda5/sda5 starts at sector 1 of the
cylinder/head, not 0. So if you resize or move that filesystem, the
geometry of that filesystem is one less sector.
I.e., it geometry won't work if relocated anywhere else. ;)
Hence why I _always_ use hda5/sda5 for swap. ;)
It's also yet another, major reason why I use LVM -- to avoid stupid
disk geometry issues in general -- including the Extended/Logical
issues. In fact, even Microsoft introduced Logical Disk Manager
(LDM), the type 42h slice (aka "Dynamic Disk"), for such reasons as
well.
> and the easiest fix was to wipe that partition and put Fedora
> 7 on it. Now the Fedora 7 partition (root) has LABEL=/tmp while
> the CentOS partition has LABEL=/. Yuck!
Damned if you do, damned if you don't. ;)
I.e., 2 things ...
1. LABELs have to be unique, this is not surprising. Normally
Fedora's Anaconda installer would realize there is already a
"LABEL=/" and enumerate it as "LABEL=/1". But in your case ...
2. Newer Anaconda versions are "smart enough" to read the existing
labels when you do not wipe the disk. As such, they reuse them. So
it seems you were using the slice previously for a filesystem with
the label "/tmp", which the Anaconda in Fedora 7 preserved.
What I meant by "damned if you do, damned if you don't," Fedora used
to just "blow away" the existing label (so it would do #1). But,
again, due to customer requests, we switched to #2. Most customers
want #2. The way to avoid #2 is to "blow away" the disk label
(partition table).
Personally I don't install a system without filesystem labels, and
dynamically generate them in a script for my Anaconda Kickstart
files. But even for people who install from a GUI for one system,
this is not an issue either.
_Again_, I could reflect back to your "typical" comment. ;)
But to be more productive, just "work the problem" and give you
something to consider -- if you are going to re-install and otherwise
"muck around" with your volumes, please learn the tools to do so. In
this case ...
$ man 8 e2label
Also remember if you change the root (/, or separate /boot if you
have one) filesystem's label, you must:
A) Modify /etc/fstab (as with any filesystem)
B) Modify /boot/grub/grub.conf (only / and /boot, if separate)
> I suppose if I could figure out how to edit the LABELs
> (make them something like LABEL=/Fedora7 and LABEL=/CentOS)
> it wouldn't be too bad, but I don't know where they've
> hidden that info.
Yeah, I know. It's only the very first hit using a man page keyword
search for "label" on my RHEL 5.1 system ... (big grin)
$ man -k label
e2label (8) - Change the label on an ext2/ext3
filesystem
findfs (8) - Find a filesystem by label or UUID
idna_to_ascii_4i (3) - convert Unicode domain name label to text
idna_to_ascii_4z (3) - convert Unicode domain name label to text
...
Jim, I know this is frustrating for you. I'm not trying to exploit
your frustration. But understand things change for a reason.
The LABEL change was made quite awhile ago, because of issues with
using device references. Not just for enterprise considerations, not
just for software RAID, but for USB devices. But even that wasn't
enough.
Everyone agrees -- even Ubuntu -- that UUID is the way to go now.
The new GIO-GVFS also uses it too. UUID has been in the kernel since
2.2.
--
Bryan J. Smith Professional, Technical Annoyance
b.j.smith at ieee.org http://www.linkedin.com/in/bjsmith
------------------------------------------------------
Fission Power: An Inconvenient Solution
More information about the Leaplist
mailing list