Stephen Gran on 18 Dec 2007 15:47:08 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Adding new drives to fstab


On Tue, Dec 18, 2007 at 05:59:08PM -0500, Art Alexion said:
> I don't really understand the new UUID method of adding drives to
> fstab.  I just added a bunch of new drives to this computer and I'm
> not sure how to set them up.

Welcome to the brave new world of libata.

> Grub is on /dev/hda I think, but the root OS drive is /dev/sda2 (I
> think)

First, take a look at `ls -l /dev/disk/by-uuid/` - that should answer
most of your questions about what is what in fstab.

Second, lets step back and understand the problem a little better.  The
underlying problem is that in the device probing subsystem, the probes
are done asynchronously, so that what was sda on the previous bootmight
get probed later this time around and show up as /dev/sdc.  IDE
nomenclature (hda for primary master and so on) papered over this, but
now that most IDE bus modules are moving to libata, the drives will get
the same sd* names, and will come up semi randomly named as well.

So, the question is then how to get persistent names for devices, so
that you can find your root filesystem and your various devices in a
predictable way.  Mounting by uuid, label, diskid, etc are all ways to
provide a persistent name for a device whose node can and will change
out from under you.  udev rules are another way to do this - have udev
create a symlink /dev/cdrom -> /dev/whatever when it sees your cdrom
drive come up.

I tend to prefer the udev method, as the symlinks can be much more
sensibly named than the uuid stuff, and I'll remember what they mean and
that kind of thing.  The problem is it doesn't work for finding /boot to
get at your kernel image, of course, so you need at least one stupid
name in fstab, and a lot of distros have decided that 'in for a penny,
in for a pound' works for them.

> I need help with two things:
> 
>         1. how to detect which drive is on which /dev device
>         2. how to edit fstab to mount them.

So, to be more concrete, you can prod around in /sys/block to look at
drive characteristics if you just want information like 'which drive is
the seagate one?'  I would advise writing udev rules for removable file
systems, and then mount based on the symlink.  For permanent file
systems, use the uuid thing if you've already started on it.  It's on
eof the more reliable ones.
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | If it is a Miracle, any sort of         |
|  steve@lobefin.net             | evidence will answer, but if it is a    |
|  http://www.lobefin.net/~steve | Fact, proof is necessary.   -- Samuel   |
|                                | Clemens                                 |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug