Hal mount folder named "/media/uuid" of all storeage devices.

hay guys new here, I've been trying to figure out how to get HAL to use the devices UUID for the mount folders name. (For example /media/5ee2c068-fab8-4b64-8061-e7662c9c2169) this is so when i make symbolic links to folders on my removable storage devices i don't need to worry about the order i mount mount my removable drives. I know that well at least the time when i used Ubuntu as my primary distribution it was the default configuration to do this.
After doing a bit reading of Hal's default policy files i  noticed that when Hal is invoked to mount a volume it will call the binary "hal-storage-mount" (located in  "/usr/lib/hal") and so I'm guessing this is the mounting command that handles creating a folder in "/media" and mounting the volume to that directory.  so what i would like to know if anyone knows how to configure either hal or "hal-storage-mount" itself to achieve what I'm asking?
any help would be greatly appreciated
Last edited by BRAXS69 (2010-06-05 13:22:23)

lamdacore wrote:
I am not sure how to tell hal to auto-make the folders. You could always make the folders manually and set the mountpoints in fstab.
Another option is (specifically for your purpose of creating symbolic links - I do this personally). Set labels on your partitions! HAL automatically creates the mount points in /media according to the partition's label.
You can use gparted to edit the labels.
Ah i didn't know that Hal would use the labels if its available, i guess I'll stick with this option for the mean time. I don't really think configuring my fstab for this case would be very viable for me since it my portable hard drives that I'm trying to setup and having to manually invoke remounting fstab every time i plug something in would be a  little crazy.
i kinda  like using the uuid for the mount directory, it think kinda adds a little bit more security and robustness because it 's unlikely any other device would have the same uuid but they could quite easily have the same label.
polymetr wrote:
I have next settings:
1. Autofs :
auto.master:
/var/autofs/hal /etc/auto.hal --timeout=5
2. /etc/auto.hal:
#!/bin/sh
set -e
for volume in `hal-find-by-capability --capability autofs`; do
if [ "`basename $volume`" = "$1" ]; then
device=`hal-get-property --udi $volume --key block.device`
fstype=`hal-get-property --udi $volume --key volume.fstype`
fsopts=`hal-get-property --udi $volume --key volume.autofs.mount_opt
ions`
echo "-fstype=$fstype,$fsopts :$device"
exit
fi
done
3. /etc/hal/fdi/policy/hal-autofs-policy.fdi:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<!-- cleanup symlinks in /media if needed -->
<match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
<append key="info.callouts.add" type="strlist">hal-autofs-cleanup</append>
</match>
<!-- options below are used by automounter with /etc/auto.hal executable map -->
<match key="volume.fsusage" string="filesystem">
<match key="@info.parent:storage.hotpluggable" bool="true">
<!-- usb disks, mmc cards -->
<match key="volume.fstype" string="vfat">
<append key="info.capabilities" type="strlist">autofs</append>
<merge key="volume.autofs.mount_options" type="string">noatime,nosuid,nodev,noexec,gid=igor,uid=igor,fmask=133,dmask=022,codepage=866,iocharset=utf8,flush</merge>
</match>
<match key="volume.fstype" string="ext2">
<append key="info.capabilities" type="strlist">autofs</append>
<merge key="volume.autofs.mount_options" type="string">defaults,noatime,nosuid,nodev</merge>
</match>
</match>
<match key="@info.parent:storage.removable" bool="true">
<!-- CD/DVD discs, usb sticks formatted in iso9660 -->
<match key="volume.fstype" string="iso9660">
<append key="info.capabilities" type="strlist">autofs</append>
<merge key="volume.autofs.mount_options" type="string">ro,nosuid,nodev,unhide,iocharset=utf8,utf8</merge>
</match>
</match>
<!-- callouts to add/remove symlinks -->
<match key="info.capabilities" contains="autofs">
<append key="info.callouts.add" type="strlist">hal-autofs</append>
<append key="info.callouts.remove" type="strlist">hal-autofs</append>
</match>
</match>
</device>
</deviceinfo>
4. /usr/lib/hal/scripts/hal-autofs:
#!/bin/sh
key=`basename $UDI`
case $HALD_ACTION in
add)
while [ -h /media/$key ]; do sleep 0.1; done
ln -fs /var/autofs/hal/$key /media/$key
remove)
rm -f /media/$key
esac
/usr/lib/hal/scripts/hal-autofs-cleanup:
find -L /media -mindepth 1 -maxdepth 1 -type l | xargs -r rm
When I insert on example a flash disk I see in /media link:
volume_uuid_7B40_CFDC -> /var/autofs/hal/volume_uuid_7B40_CFDC
If I go in the volume_uuid_7B40_CFDC directory then the flash disk is being got mounted:
/dev/sdc1 on /var/autofs/hal/volume_uuid_7B40_CFDC type vfat (rw,noexec,nosuid,nodev,noatime,gid=1001,uid=1000,fmask=133,dmask=022,codepage=866,iocharset=utf8,flush)
wow thats quite a bit to churn through, but what it looks like you've had to completely rewrite the polices to invoke your custom "hal-autofs" script and clean up scripts for all the volume devices? very new to how hal is configured and operates. so I'm guessing that you had to make it call a custom script instead of using "hal-storage-mount" and the other scripts involved with the management of mounting and unmounting volumes? does this mean that "hal-storage-mount" can not take custom arguments or be configured to use the uuid for the mount directory's name instead of the label or the "disk"?
though the "hal-autofs" script seems strange, i don't see anywhere where it invokes mounting of the device but i do see that it makes a symbolic link from /var/autofs/hal/<device key> to /media/<device key> (done a little bit of research)so I'm guessing that I'll have to install autofs in order to achieve what I'm trying to do. but does that mean that autofs will mount automatically any and every storage volume and hal will just make a symbolic link to the /media directory when you call hal and say you want to use the volume even though its already mounted. Thats kinda risky isn't it unless i've misunderstood autofs workings having the volume mounted when you unplug the device isnt exactly best practice.....
Thanks guys this is providing some great insight

Similar Messages

  • Dolphin mounts partitions in /media folder

    I am running Arch with systemd and LXDE and updating the system regularly.  I find that if I mount a partition through Dolphin file manager, it mounts them in /media folder.  On the other hand, if I mount them from thunar file manager, it mounts them to /run/media/username folder. Is this a known problem or there is something wrong with my system?
    On google, I found some links but they are not of much help:
    https://bbs.archlinux.org/viewtopic.php?id=115610
    http://www.linuxine.com/story/kdes-dolp … de-systemd
    https://bugs.kde.org/show_bug.cgi?id=291251

    This is expected behaviour. Dolphin uses udisks which mounts to /media, Thunar uses udisks2 (I think via gvfs), that one now mounts to /run/media.
    Last edited by teekay (2012-11-17 18:08:27)

  • Music in itunes but not in media folder, how do i get all of my music into the media folder

    some of my music is in the media folder for itunes but loads of it isnt showing up and i dont know how to get it al into the media file so i can then change to a different computer and brand new ipod

    Hi there LaurenRebekah29,
    You may find the information in the articles below helpful.
    iTunes 11 for Windows: Change where your iTunes files are stored
    http://support.apple.com/kb/PH12365
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/ht4527
    Consolidate your files in the iTunes folder
    You can consolidate all the files in your library in the iTunes folder—for example, to make it easier to move your library to a new computer.
    Choose File > Library > Organize Library.
    Select “Consolidate files.”
    Files remain in their original locations, and copies are placed in the iTunes folder.
    To create folders (Music, Movies, TV Shows, Podcasts, Audiobooks, and so on) inside your iTunes folder, and place all your imported media files in the appropriate folders, select “Reorganize files in the folder ‘iTunes Media.’”
    -Griff W. 

  • My old computer crashed and deleted my iTunes media file with all my playlist. However, my iPod has the playlist I lost on the computer. How can I replace (reverse synch?) my iPod media information back onto my (now reinstalled) virgin iTunes media folder

    My old computer crashed and deleted my iTunes media file with all my playlist.However, my iPod has the playlist I lost on the computer. How can I replace (reverse synch?) my iPod media information back onto my (now reinstalled) virgin iTunes media folder?

    Yes it's possible to sync music back from a iPod back into iTunes that (I assume) wasn't purchased on the iTunes Store.
    Apple allows iTunes Store purchases on devices to be reversed back into iTunes, just not cd rips and stuff like that. For that it's a one way trip to the device from iTunes.
    I likely can't suggest such software here, but if you visit iLounge you can ask what is the latest software that works for your platform.
    Really it only takes a mere few minutes to backup your iTunes Library and stick in a few cd/dvd's or a external drive. iTunes even has a menu command for it to make it oh so simple. Please use it and backup all your data.
    Hard drives fail, computers burn up, thieves steal, stuff gets forgotten. Plan for something happening because it will.
    Good Luck

  • ITunes creating duplicate files under a hidden folder named "Volumes".

    It seems my iTunes program is secretly making a duplicate file in a hidden folder called "Volumes" on my laptop hard drive. It's now maxxed out my drive and I need to both remove the "Volumes" folder and make sure it doesn't get created and happen again.
    Details:
    Using a Powerbook G4 with an 80gb drive. Using iTunes 8. The iTunes library program is in the usual place on the lap top hard drive but the music library folder, where all the files get saved to, is on an external drive labeled "Media".
    Clicking normally and searching around my laptop hard drive, I do not see or am able to access the folder named "Volumes". But I know it exists as I ran a scan program called jdiscreport and it clearly shows a huge folder, 45gb, named "Volumes". There are also a few old flacs in the "Volume folder also. The iTunes duplicate files are in identically named folders as the external drive: iTunes Music located within Media, located within Volumes.
    When I rip a CD in iTunes (or the iTunes-LAME program I sometimes use), the files do go to the proper external folder as expected and as I've set in the iTunes preferences section. So why is iTunes also saving the same thing to this mystery "Volumes" folder on the lap top hard drive? How do I get rid of this folder without wiping my drive? How do I stop it from continuing?
    Help, I have 2gb of free space left!
    Thanks, James

    Hi I am having a similar issue, It all started when I tried to restore from the Time Machine and it threw a error back stating that there is no disk available. I was wondering how come and went to find out what is happening and was shocked to find out that actually my entire Macintosh HD has a duplicate copy inside the /Volumes folder. I went to the XTERM to investigate and found that the / (root) has a Users folder where all my stuffs like pictures, music, movies, documents reside and the same data or content is duplicated in the /Volumes/Macintosh HD/Users folder
    I first thought that it was only a link, but I later found that it is not a link and it is indeed a physical copy of all my User folders inside the /Volumes/Macintosh HD/Users folder and actually occupying my Hard disk space.
    I am not sure how this happened or how it is duplicating itself. I am also afraid to delete the stuffs inside the /Volumes folder as it might crash my system (it is already hidden - I assume it is hidden for some purpose). Please suggest any options, how I can get rid of these duplicated data and how to avoid such duplication in the future.
    Thanks
    Regards
    Chelvam.S.T

  • My download are going to a different folder. They usually went to a folder named 'Downloads' and now they go to a folder named 'Temp', Why is this?

    Usually when i download something it goes to a folder named 'Download', however, now they go to a folder named 'Temp'.

    Get info on the drive.  What format?  FAT drives may be behave erratically for heavy-duty use of the kind you are doing. It's okay to leave a flash drive FAT formatted for light use but for heavy-duty file transfer I think you can encounter issues.
    iTunes does not look at files directly.  It maintains a database (library.itl) of the files in its collection.  When you play a track it looks up where that file is located and goes and plays the file in that location.  If you manually move a file or folder used by iTunes that database is no longer correct and you get broken links ( ! ).  If you want to move files or folders with iTunes you have to let iTunes do it.  Since iTunes is organizing your library there isn't much flexibility in what you can do other than move the whole collection to a different folder by changing the media location preference in preferences.
    Lion - Disk Utility - https://discussions.apple.com/message/16925522 - repairing your drive using Disk Utility on Lion's recovery partition.

  • Importing .ISO files into SCVMM2012 R2 - Folder Naming Quirk

    We've run into a folder naming issue in regards to importing .ISO's into the VMM Library. When specifying a folder to import the .ISO into, VMM adds %20 to the folder names where spaces are. Not a huge deal but wonder if anyone has a way around this without
    using dashes or underscores. 
    Orange County District Attorney

    No, it's a bug, I have ran into this all over the UI and has caused me no end of pain. I have reported it but I have had no word if this will ever be fixed 
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. http:\\robbieroberts.wordpress.com

  • When dragging in folder from media browser, some clips missing?

    I've noticed a strange problem where if I drag a folder with video clips in from the media browser, not all of the clips will make it into the project all of the time.
    Whereas if I open up that folder and select all the media files individually, they all make it into the project.
    There doesn't seem to be any consistency that I can see when I drag in a folder and not all the files therein make it into the project. Has anyone ever seen this behavior before? This must be a bug.
    Currently using Premiere Pro CC 2014 - 2014.0.1 on a Mac Pro (Mid 2010)

    Actually - technically all of these clips are in the project. See I have a lot of unlogged clips in my project. I'm having another editor log the clips on a different computer, then I'm bringing the logged clips back into the project, and then just double checking the file count of the original folder and the file count of the new folder to see that they match up.
    Does this shed any more light? The fact it's not consistent is what is weird. Is it possible maybe the clips that are already in a project and in a sequence somewhere don't get imported?
    Any thoughts on how I can make the process smoother given the work flow? Thanks.

  • I have a back up of the folder 'iTunes Media' on a Nas (LaCie CloudBox). I do a weekly update. Everything is cool.Now I would  love to keep the folder on the Nas and delete the one on my internal HD. What kind of trouble i may run into?

    I have a back up of the folder 'iTunes Media' on a Nas (LaCie CloudBox).
    I do a weekly update.
    Everything is cool.
    Now I would  love to keep the iTunes Mediafolder on the Nas and delete the one on my internal HD.
    What kind of trouble I may run into?
    Where are the hidden catches?
    What can go wrong, and how can i undo any mistake?
    I also have an iTunes Match acccount.
    Cheers
    rudy

    HI
    Read this user tip Make and keep a backup of your iTunes library, and only stream from the cloud.
    Problems? No hidden catches. Whilst streaming using match, you will need a wifi connection. You main worry is that if your NAS drives fails, you need to redownload your music from match but this could take time depending on how large your collection is. Personally I keep an additional backup of all my music as a matter of course.
    Jim

  • Disable Gnome auto mount for one specific UUID

    I am using Gnome 3 (gnome disk utility,udisks,udev stack i think).
    I have a device (Garmin Edge 800) that I am only going to use in Virtualbox so I want to prevent it from automatically mounting in Gnome. However I want other devices to auto mount as normal so disabling auto mount entirely isn't an option.
    The device got two UUIDs and previously I could write a HAL fdi policy to ignore devices with those UUIDs, but now that HAL is deprecated I am not able to figure out how to do this.
    Last edited by lessthanjake (2011-06-29 09:56:30)

    There's probably a udev config file somewhere (udev wiki perhaps) but you can do it with fstab "noauto" that's what I do for partitions I don't want to auto mount.

  • Folder named "ABBYY FineReader 5 Sprint" in Applications....

    Hello everyone,
    When I open my Applications folder in Finder, there is a folder named "ABBYY FineReader 5 Sprint" among all of the applications. When I open this folder, there is nothing at all in it, however at the bottom of its window, it says there are 5 items and 129.9 GB available. Does anyone know the purpose of this folder, and should it be there at all? Is it safe to delete it?
    Any help would be appreciated.
    Thanks in advance,
    joe

    Thanks for marking it as solved joe. Lexmark doesn't have a great reputation for supporting OS X, they do to a certain extent but they don't cover all of their printers for Macs. If you scan the printer section of the various discussion forums, Lexmark come up a bit too often as something people have problems with.
    I favour Epson and Canon printers and scanners. They have long worked well with the drivers that come wit the Mac and who wants to fluff around with installing drivers. Today it is reasonable to expect to plug something in and have it print.
    Have a look at some of the models here:
    Some All in One printers
    and choosing a few, do search on Google to find reviews of the model, just to get some feedback on other's experiences of using them, which can be informative.
    regards roam

  • 'AVCHD content' package instead of a 'Folder' named PRIVATE in Mountain Lion

    'AVCHD content' package instead of a 'Folder' named PRIVATE in Mountain Lion prevents FCPX from recognising it as a Camera Archive thus can't import media.
    Does anybody know how to work around this issue?
    I know how to look inside the package, but seeing the contents does not help importing it into FCP X.

    Karsten, I believe you are doing exactly the same steps, but see some kind of different names on the buttons. When I press Cmd+I, I get into the Camera Import dialog. I have to then press Open Archive... to import from a folder, that has a copy of SD card.
    That is why I am calling it a Camera Archive.
    Then I select the Card1 or Card2 folders that contain a copy. This is a great screen:
    Card1 was copied while Mac OS was still 10.7, Card2 - after an upgrade to 10.8.1. Card1 imported into FCP X 10.0.5 flawlwssly, while Card2 gives me an error a screenshot of  which is higher in the thread.
    As for Tom's request - I did exactly that. Except for Card1 will not show it's contents in the column view - I have to Ctrl+Click and select Show Package Contents to get inside.
    Hopefully this clarifies the situation a bit more. I'm stuck with the project at the moment

  • Someone else's photos (333 of them) showed up as mounted folder after crash

    So iPhoto has been crashing a lot as I have been updating keywords using Keyword Assistant (I recently imported ~3500 pictures). When iPhoto re-opens after a crash, sometimes I lose some of the changes I recently made.
    But to my big surprise, when it auto-reopened iPhoto after the most recent crash, I had 333 photos in a mounted folder (with an eject button) labeled "Joe Schmoe's Photos" dated 2006/09/29 to 2007/08/05. I do not know this person, do not recognize the photos, and I seem to have pictures dated through yesterday. I am not a .Mac subscriber, nor do I share my photos online through iPhoto, but it would seem that I have been granted access to Joe Schmoe's photos.
    If I indeed have been accidentally granted access to someone else's photos, this is a huge security concern! I have a screen shot of this and will share it with an Apple developer/employee, but do not want to post it here because of privacy issues related to showing someone else's pictures to the world.
    If anyone has any ideas of what else might be going on, I'm all ears.
    Note the following:
    -I was connected to the internet(wirelessly) at the time of the crash/re-open.
    -These photos are not in my library, but seem to be a separate mounted folder.
    -The name does not show up in searches of my computer nor in the finder/desktop as a mounted drive.
    -There is no exposure info on any of the pictures
    -When it crashed and reopened (again, just now), Nathan Bowen's photos are still there, but it seems to take time to load them (like they're downloading perhaps)
    Message was edited by: mudder

    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Do you Twango?

  • Ovi Suite folder naming format on photo sync?

    When I want to sync my photos on my n900 onto my PC, it now dumps everything taken within the same month into the same folder.
    How do I change the folder naming convention/format, for example if I want everything taken today to be in its own folder as opposed to being mixed in with photos taken last week?
    This is a problem now because I use my N900 for photo taking a lot and the folder naming format does not match what I have always used in the past and continue to use with my regular digital camera.
    This was always an option in PC Suite, but doesn't appear to be an option in Ovi Suite, unless I'm missing something. Thanks.

    The problem is that it's creating totally new folder directories and the naming format of the folder is not the way I have all my other photos organized. 
    My other photos are arranged in folders by the day they were taken. Ovi Suite creates one new folder for each month and then drops everything from that month into that folder.
    For example:
    My Pictures/2010_07_19 -- this is the format I have all of my other photos from other cameras created when I transfer photos from them to my computer.
    My Pictures/N900/2010-07 -- this is the format that Nokia Ovi Suite is creating for me and there's no way that I see that I'm able to change the naming convention to match what the rest of all my photos are. Everything taken this month would drop into that same folder, which is too difficult to keep organized.
    Am I just missing something as to how I can change the naming convention of the folder when syncing via Ovi Suite?

  • Have saved Bookmarks from my desktop Win XP on a USB stick in a folder named "Bookmarks" How to "import" these Bookmarks in my new new notebook wih Win7 Home Premium with Firefox?

    First of all thank you for solving my installation of Firefox on my new notebook. I have successfully installed Firefox on that new PC.
    Now I have another problem. I have successfully copied my Book marks from my desktop onto a USB stick in a folder named "Bookmarks" I am trying to 'import" the same Book marks in my Firefox on my new notebook. I cannot. I have tried various ways via "organise bookmarks" or "import" but I do not seem to be able to do it. Any suggestions?

    See http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox
    Did you save (export) the bookmarks to an HTML file or did you create a JSON backup?<br />
    A JSON backup needs to be restored and will replace all currently present bookmarks.<br />
    An HTML backup is imported and those bookmarks are merged with the existing bookmarks.

Maybe you are looking for