[Grml] Re: Wishlist: automount by names

Michael Prokop mika at grml.org
Thu Aug 31 10:26:54 CEST 2006


* T <mlist4suntong at yahoo.com> [20060830 23:15]:
> On Wed, 30 Aug 2006 17:48:15 +0200, Michael Prokop wrote:

> > Sorry, I don't understand your problem. :)

> > If you are using filesystem labels just mount them using:

> > mount -L $LABEL /mnt/test

> > If you need stable root devices you can use UUIDs as well:
> > http://michael-prokop.at/blog/2006/08/11/stable-root-device-aka-uuid/

> > What do you mean with automount and "use udev to access them by their
> > names"? What should /etc/fstab look like in your opinion? Did I miss what
> > you are searching for? :)

> OK. Let me explain in detail.

> First about disk labels and udev:
> =================================

> I have many disk partions. One type is OS, so I have os11, os12, till os14.
> The other type is caches, eg, cache11, cache12 & cache13. Currently only
> my os12 is mounted, and all my caches are mounted. 

> Udev knows about all my disk labels:

> $ ls /dev/disk/by-label/* | grep os
> /dev/disk/by-label/os12

> $ ls /dev/disk/by-label/* | grep cache
> /dev/disk/by-label/cache11
> /dev/disk/by-label/cache12
> /dev/disk/by-label/cache13

Sure, nothing new and just symlinks to the real devices.

> Yes, you can use UUIDs to make stable root devices. But udev also allows
> using disk labels as well, beside UUIDs. To me this is an better option.
> It is intuitive, and as long as they are mounted correctly, I don't need
> to care about UUIDs. 

> In other words, I want to mount my HD/USB devices not by UUIDs but by
> labels. Eg. the disk partition labeled os12 would always mounted on
> /mnt/os12.

That's what I already mentioned and demonstrated:

,---- [ demo on grml with a fs with label foo ]
| grml at grml ~ % ls -la /dev/disk/by-label
| total 0
| drwxr-xr-x 2 root root  60 2006-08-31 11:04 ./
| drwxr-xr-x 6 root root 120 2006-08-31 11:04 ../
| lrwxrwxrwx 1 root root  10 2006-08-31 11:04 foo -> ../../hda2
| grml at grml ~ % su
| root at grml ~ # mount -L foo /mnt/test
| root at grml ~ # mount | grep hda
| /dev/hda2 on /mnt/test type xfs (rw)
`----

I don't see the need for the entries in /etc/fstab. But I don't want
to stop investigating in new ideas, so I try to elaborate a little
bit.

Mounting by label already works (see my demo). An entry like:

  LABEL=foo /mnt/foo auto .....

in fstab would (IMO) cause more problems than the current:

  /dev/hda2 /mnt/foo auto .....

does. Possible reasons:

* people are used to the "old-style" fstab entries;
  that's what they (usually) expect to get when they use a
  "Linux for sysadmins"

* what about multiple identical LABELs? How should this be handled
  smoothly without any further confusion?

I personally don't think 'la /dev/disk/by-label', 'vol_id
/dev/ice42' and/or 'mount -L foo /mnt/test' are that hard for people
who want to mount devices via fs-label. :)

But your feature request lead me to a possible nice addon:
To provide the filesystem's labels as directories in /mnt so
mounting hasn't to be done via /mnt/test. :)

The implementation would be something like:

  # for label in /dev/disk/by-label/* ; mkdir /mnt/$(basename $label)

in the booting sequence so 'mount -L foo /mnt/test' is possible
straight forward.. Maybe integration in rebuildfstab would be useful
too, so directories for new fs-labels are present as well. Does this
sound useful for you? Could you live with that? :)

> Now for the automount:
> ======================

> Instead of building HD partions into /etc/fstab, buit it into automount
> rules. So, whenever I cd into /mnt/os12, the disk partition labeled os12
> is automatically mounted -- all taken care of by automount. 

No.

Automounting sucks. The automounting stuff at Knoppix (what you
mention in another mail) was such annoying that I wanted to get rid
of it completely. People using grml know what they are doing and
what they want to do. Especially when rescuing systems you
definitely don't want any automatizations on your filesystems.  Oh
and just try automounting with directory completion of the shell -
anything but *not* amusing.

> Now for USB pens:
> =================

> It should be taken care of by pmount-hal. According to Florian Kulzer:

> ,-----
> | ... you will not need fstab entries for pluggable devices anymore.
> | Devices will be mounted at the correct mount point automatically. Even
> | better, if you use the "pmount-hal" command then the devices will be
> | mounted by their volume label so that you can address each medium
> | unambiguously and independent of the order in which you attached them.
> | This is also fully integrated in e.g. KDE and Gnome.
> `-----

pmount-hal requires running dbus/hald. Not an option for the default
behaviour of grml for me at the moment.

grml's udev solution for usb pens works for me. Just run 'mount
/mnt/external1' and usually that's it. Plain and simple. Mounting by
label is possible anyway and pmount-hal exists on grml too.
What are missing therefore? :)

regards,
-mika-
-- 
 http://grml.org/            # Linux for texttool-users and sysadmins
 http://wiki.grml.org/       # share your knowledge
 http://grml.supersized.org/ # the grml development weblog
 #grml @ irc.freenode.org    # meet us on irc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://ml.grml.org/pipermail/grml/attachments/20060831/15c5055f/attachment-0003.pgp>


More information about the Grml mailing list