SCIENTIFIC-LINUX-USERS Archives

June 2007

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jon Peatfield <[log in to unmask]>
Reply To:
Jon Peatfield <[log in to unmask]>
Date:
Mon, 18 Jun 2007 11:55:41 +0100
Content-Type:
multipart/mixed
Parts/Attachments:
TEXT/PLAIN (1867 bytes) , halcheckdisk (418 bytes)
On Mon, 18 Jun 2007, Keith Lofstrom wrote:

> Color me old-fashioned, but the new SL5 behavior of mounting a CDROM
> in /media using the CD's volume name is annoying (and hard to write
> scripts for).  For example,  if the CD is named "New Volume", it
> mounts as "/media/New Volume" (a filename including a space).  This
> could be especially nasty if two CDROMs or two USB keys have the
> same volume name.
>
> Is there something I can tweak so that the CD on /dev/cdrom always
> mounts as /media/cdrom or /mnt/cdrom ?  I imagine this has to do
> with autofs, but the documentation on that is sparse.

I think it is HAL/hald rather than autofs since we disable autofs and 
still have removable media getting automatically mounted... :-)

If you have clashes then I *think* it will avoid using the same name but I 
can't remember why I think this.  Since SL5 the /etc/fstab file is no 
longer updated for removable media devices so users can't directly use 
mount/umount either but the gnome-mount utility (and possibly others!) 
talks to hald to request mounts etc so it can be done from the 
command-line.

I have a terrible little script I'm playing with atm which I've attached 
to this message, it dumps some properties of any hal object which has the 
volume capability (including device, volume.label and mount-path)...  I'd 
restrict it to just *removable* devices if I could work out how...

I have a feeling that just running 'hal-device' and parsing all the output 
might be simpler than trying to get volume info the way that this script 
does it.  I was hoping that someone else had already written a nice piece 
of perl to interact with hal but I've yet to find anything...  Are there 
any nice hal modules for python or some other scripting language?

-- 
Jon Peatfield,  Computer Officer,  DAMTP,  University of Cambridge
Mail:  [log in to unmask]     Web:  http://www.damtp.cam.ac.uk/



#! /bin/bash # # first stab at probing for removable devices to let us display a set # to users and let them for i in $(hal-find-by-capability --capability volume) do echo Hal entry $i for j in info.product volume.label volume.mount_point volume.fstype linux.hotplug_type block.device block.storage_device do printf "%-30s: %s\n" $j "$(hal-get-property --udi $i --key $j)" done echo done

ATOM RSS1 RSS2