[Leaplist] fstab
Bryan J. Smith
b.j.smith at ieee.org
Thu May 29 09:35:00 EDT 2008
On Wed, 2008-05-28 at 19:47 -0400, Phil Barnett wrote:
> So, I used to look at my fstab to figure out where I had mounted all those
> partitions so when I reinstall I get them back where they belong.
> Look how nice Fedora 8 left it for me.
> # cat fstab
> UUID=c / ext3 defaul
> UUID=340a1958-06eb-4f5d-b1ff-13607fa60ac8 /usr ext3
> defaul
> UUID=d905dd18-503c-4d4f-a92b-9ac79a744485 /usr/local ext3
> defaul
> UUID=337f07b7-e00b-4890-a557-c4c6e71c5ff5 /var ext3
> defaul
> UUID=94c21234-6677-477e-acbb-200cbbce42c2 /tmp ext3
> defaul
> UUID=da246920-b575-4e5f-80d2-b02eecad33f3 /home ext3
> defaul
> UUID=a1cd2131-8439-4c90-ad72-2dddf4819c0a /boot ext3
> defaul
> tmpfs /dev/shm tmpfs defaults 0 0
> devpts /dev/pts devpts gid=5,mode=620 0 0
> sysfs /sys sysfs defaults 0 0
> proc /proc proc defaults 0 0
> UUID=8b4ac091-4fc2-42b5-b4cf-989275661f3c swap swap
> defaul
The UUID is the only "safe" way to mount a filesystem.
Not by direct device. Not by label. This isn't a "Red Hat-only" thing
either (search some of the Ubuntu archives, especially for enterprises,
LTS, etc... ;), although Red Hat often takes the blame for being the
first to implement a GNU/Linux core subsystem/kernel standard.
As always, Red Hat Bugzilla has the history. Here's the relevant
Bugzilla entry marking the change for Rawhide (which went into F9):
https://bugzilla.redhat.com/show_bug.cgi?id=364441
> So, I now wonder if 82707eb7-6b3b-4140-90e2-6a31abb998d1 is /dev/hda1 or what?
If it's mounted, it will be displayed with various tools ("df"). The
idea here is that you do _not_ need to know what device it is, or need
to have "unique labels," for the system to find something.
This is now the default after an install/upgrade because people were
often moving storage around (especially SANs) and causing label
conflicts, let alone such things aren't an option for direct device
entries. ;)
> Maybe I could install Windows...
Standard bashing, Windows comments, etc... are typical. This was an
enterprise change, and it's not only Red Hat implementing it, whereas
Microsoft would have sided with home consumers, and left the problems
in-place. ;)
Anyone who manages massive enterprises of RHEL with countless storage
_wishes_ this was the default in RHEL already. But you'all go ahead and
say otherwise, which only says things to potential, technical leads who
run into the device/label issues when they have 15,000 servers. ;)
On Wed, 2008-05-28 at 22:15 -0400, Jim Hartley wrote:
> Just out of curiosity, did you use LVM on this install?
This has _nothing_ to do with LVM.
The UUID is, by its very name, the "unique" ID on the filesystem. It's
been part of the stock kernel since 2.2. This is why there was a slight
change in Ext3 meta-data from 2.0 to 2.2. XFS and several other
filesystems honor it as well.
> But they were already screwing around with stuff on Fedora 7,
Yep. Red Hat has this nasty habit of being concerned about "hard coded"
reference information in its configuration files. It has a nasty habit
of causing issues with multiple disks, storage area networks, etc...
and, even more consumer-centric (Gasp! No, not Red Hat!), external USB
devices. @-ppp
Ever put an old Linux disk in an external storage enclosure and it won't
mount on another system? Now you know why. ;) GNOME uses "LABEL" to
name the filesystem under /media. Now GNOME will fall back to UUID when
they conflict.
> using something called "LABEL".
Yep. Because users move around disks, LABEL solves that problem.
Unfortunately, if more than one LABEL exists, neither will mount.
Hence the move to UUID.
> Why do they keep <sarcasm>improving</sarcasm> stuff?
Because it's an otherwise bitch to manage 15,000 servers with hard coded
references. LABEL helped, but didn't address conflicts. UUID is the
unique way to mount filesystems.
You can use the /dev/disk meta to find your "raw" devices.
> I suppose if things get TOO bad, I could try *BSD,
> but no way in Hell am I going back to Windoze!!!!
> Maybe I should redo FSTAB the way it SHOULD be and hope the system still
> boots?
Actual "raw" device, LABELs and UUIDs are all usable in /etc/fstab.
On Thu, 2008-05-29 at 00:27 -0400, Phil Barnett wrote:
> > try $ls -l /dev/disk/by-uuid/
> That worked, but I did not expect what I saw. Interesting.
Huh? Here's mine on my notebook ...
$ ls -la /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 340 2008-05-29 08:49 .
drwxr-xr-x 6 root root 120 2008-05-29 08:49 ..
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 2b7012a2-2d82-4d29-a7bb-05d3fe2f779b -> ../../sda2
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 317cbd21-e35b-4c8e-aa93-58484e664e03 -> ../../sda3
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 3D4555B129E33CFC -> ../../sda1
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 471E-9FD4 -> ../../sdd1
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 47E0-3BD3 -> ../../sda7
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 4831-1D67 -> ../../sdc1
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 74f84eba-e4dd-483d-b783-6099c3ee1a13 -> ../../sdb6
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 875ea0c9-038e-46b8-9997-5c7d35b7c67c -> ../../sdb7
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 8aaa5ec5-c0fc-4a48-b4c0-ad379b1014f1 -> ../../sdb8
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 a920ce13-55fb-4cd5-8e16-7df595b160f3 -> ../../sda5
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 b41d9dca-7bcb-40e4-9dc5-be1fe635a8e4 -> ../../sdb3
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 b7b45c9e-d963-4326-a08e-e32dd196cc64 -> ../../sdd2
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 c78f79ad-a4da-4395-b473-da2b9d78795f -> ../../sdc2
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 d76b1c3c-9c0a-43ae-9993-711be8ef90a3 -> ../../sda8
lrwxrwxrwx 1 root root 10 2008-05-29 08:49 ffc7d84c-a1a2-46ba-add6-9d0537703ccc -> ../../sda6
You'll note not only Linux Ext3/XFS UUIDs, but NTFS (sda1) and FAT
(sda7, sdc1, sdd1).
This solves a long, long time and major enterprise issue. ;)
--
Bryan J Smith Professional, Technical Annoyance
mailto:b.j.smith at ieee.org http://www.linkedin.com/in/bjsmith
-------------------------------------------------------------
Fission Power: An Inconvenient Solution
More information about the Leaplist
mailing list