I liked it in previous versions of Fedora Core that a cdrom would always get mounted in a fixed location, e.g. /media/cdrom or /media/cdrecorder so you could just access it, or have scripts access it in the same location. Now, cds and other removable media are mounted using the name of the media, eg "/media/K3b data project" Is there a way to customize the mount point to get the old behaviour back (or to get some other predictable behaviour)?
Access from scripts is one reason I would like that, cd's with 'weird" characters in the name (probably encoded in another characterset) are another reason. The above mentioned "/media/K3b data project" was already problematic for some programs! And not just some weird programs: bash-3.1# eject umount: /media/K3b\040data\040project: not found (and this was using eject-2.1.5-0.1.fc5, last week's update) Such behaviour is just broken, but I don't know if it is eject that is broken, or gnome-mount / udev / hal or whichever component that thought that putting spaces in mountpoints would be a nice touch!
David
On Tue, 2006-08-29 at 17:27 +0200, David Jansen wrote:
I liked it in previous versions of Fedora Core that a cdrom would always get mounted in a fixed location, e.g. /media/cdrom or /media/cdrecorder so you could just access it, or have scripts access it in the same location. Now, cds and other removable media are mounted using the name of the media, eg "/media/K3b data project" Is there a way to customize the mount point to get the old behaviour back (or to get some other predictable behaviour)?
Personally, I'd like both at the same time, so if someone has a hint on that, chime in as well.
That gives you predictable hardware addresses, as well as specific volume addresses (i.e. you can always find the contents of the CD-ROM versus the CD-burner, or always find the particular disc wherever its inserted).
Personally, I'd like both at the same time, so if someone has a hint on that, chime in as well.
I didn't find much in the way of documentation on HAL, but I poked around in: /usr/share/hal/scripts/hal-system-storage-mount
I decided a symlink to the cdburner would be adequate. Then I added the following (my bash is weak) before the last line:
<snip>------------- # cr33 modified MAKE_SYMLINK="true"
if [ "$MAKE_SYMLINK" == "true" ]; then SYMLINK_ROOT="/mnt" SYMLINK_NAME="cdburner" SYMLINK_DEVICE="/dev/hda" if [ "$HAL_PROP_BLOCK_DEVICE" == "$SYMLINK_DEVICE" ]; then SYMLINK_RESULT=$(ln -fsn "$MOUNT_ROOT/$MOUNTPOINT" "$SYMLINK_ROOT/$SYMLINK_NAME" > /dev/null 2>&1) # if [ $? -ne 0 ]; then # echo "Failed to create symlink - check modifications to " >&2 # echo "/usr/share/hal/scripts/hal-system-storage-mount" >&2 # fi fi fi #end cr33 <snap>--------------
HAL should then create a symlink from the newly mounted /media/NAME to /mnt/cdburner, as long as the block.device is /dev/hda. Not elegant, but enough to point a drive in ~/.wine to /mnt/cdburner. You'll have to edit SYMLINK_ROOT, SYMLINK_NAME, SYMLINK_DEVIC...
I commented out the status check (OK, my bash is terrible) because I haven't figured out where HAL logs events or messages. Chose /mnt for the symlink - seems like there's never anything in there with FC5.
Passing an option to HAL to create symlinks that correspond to the block device *seems* like a good idea...
Thoughts wecome.
Chris