Removable devices with UTF-8

Hi is there a way how to make HAL mount removable devices with iocharset=utf8 option?
I tried this file:
cat /etc/hal/fdi/policy/uf8.pdi
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="block.is_volume" bool="true">
<match key="@block.storage_device:storage.hotpluggable" bool="true">
<merge key="volume.policy.mount_option.iocharset" type="string">utf8</merge>
</match>
<match key="@block.storage_device:storage.removable" bool="true">
<merge key="volume.policy.mount_option.iocharset" type="string">utf8</merge>
</match>
</match>
</device>
But no success.

As a problem may have several solutions, I propose another method to mount removable medias with chosen mount options and at a chosen mount point.
The advantage of that method, I think, is that only one file is used and easily edited, and nothing else has to be modified in the system (no .fdi files are touched).
Here is the batch file which I named mountusb :
#!/bin/bash
# Script mountusb by Bernard Baeyens (berbae) 2009-06-18
# to mount plugged in removable medias, using hal and pmount
# without knowing the device name
# without modifying the /etc/fstab file
# without needing to create a fixed directory under /media
# The device name attributed by udev is transmitted to hal and can be accessed
# with the utility hal-get-property.
# So with this method it doesn't need to be a fixed name.
# The user must maintain the three lists below, for the removable medias he uses.
# List of the variable part of the hal udi for the removable medias
UDI=(0000_0002 DA8E_98E0 68E8_9D1A)
# List of the corresponding desired pmount options
OPTIONS=("--sync --noatime" "--sync --noatime" "--sync --noatime")
# List of the corresponding label used to mount the device under /media
# pmount will create the /media/<label> directory itself
LABEL=(sony stick1 stick2)
NB=${#UDI[*]}
for (( I=0;I<$NB;I+=1 )); do
DEVICE=$(hal-get-property --udi=/org/freedesktop/Hal/devices/volume_uuid_${UDI[$I]} --key=block.device 2>/dev/null)
MOUNTED=$(hal-get-property --udi=/org/freedesktop/Hal/devices/volume_uuid_${UDI[$I]} --key=volume.is_mounted 2>/dev/null)
if [ a$DEVICE != a ] && [ -b $DEVICE ] && [ a$MOUNTED != a ] && [ $MOUNTED == false ]; then
echo "Executing command : pmount ${OPTIONS[$I]} $DEVICE ${LABEL[$I]}"
if pmount ${OPTIONS[$I]} $DEVICE ${LABEL[$I]}; then
echo "To unmount the device use : pumount /media/${LABEL[$I]}"
fi
fi
done
# To unmount before plugging out the media : pumount /media/<label>
# The command will remove the /media/<label> directory after the unmounting
The values in the file correspond to a Sony walkman and two memory sticks of mine.
The UDI values can be determined by plugging in the removable media and consulting the output of the lshal command.
I hope that this batch could be useful to someone.
Edit : Added a test to execute pmount command only if the volume is not already mounted.
Last edited by berbae (2009-06-20 09:25:06)

Similar Messages

  • Problems with usb / sd removable devices (not/badly copying)

    Hi everybody
    the problem is when I plug an usb stick or a SD card, all with FAT32 fs, GNOME (I use gnome-shell) asks me if I want to mount and open the device.
    so, it loads properly and when it's open I can do all the things you are supposed to do with them.
    The issue first appaired when I copied some pics to an SD card. It appaired the progress bar saying it completed the copy process.
    So I umounted the device and removed it. Some other people said that actually there weren't any files in the SD card.
    Supposing it was bad/corrupted fs I formatted the card and put back the images there. Same issue. I was starting to think the SD card was damaged
    until I had the same problem while copying music to my phone (via USB cable).
    I noticed it created all the files but didn't store any actual data (e.g. size of files was always 0 byte) or even didn't do anything (neither created the file) sometimes.
    Searching the web I found that it wasn't syncing - so they told me to do the sync command on the shell - nothing solved.
    So as I read on the wiki [fstab], I mounted the devices with options "sync,flush", which in fact solved the problem.
    [Actually I later found that it works even without the flush option, just with the sync option]
    Doing so I solved the problem and could copy all the data to the devices.
    What I want to know is: how can I say to GNOME (or anyother GNOME uses to mount devices) "well, whenever I put a removable device, mount it with the sync option" ?
    thank you in advance,
    azzka
    PS: [not so important]: I noticed very slow copying bitrate, and I did what the wiki says about but didn't solve anything. Any ideas?

    Yep HV,
    Verify the discs in the disc utility and see if that works. It'll probably take an hour or so cos the disc utility's performance has been less than favorable.
    Try this: Turn off the computer, disconnect the drives, then restart the computer. Now, re-connect the drives while the computer is running, let them mount and see if you can eject them. One would assume it is a permissions issue, however, with the multitude of glitches appearing with ext drives and USB devices in Leopard it's hard to assume anything.
    Persevere!

  • IPod not recognised as a device with removable storage on computer

    Hi All,
    My computer is not recognising my iPod as a device with removable storage (it is not showing up in 'My Computer' when I open it), even though I have the Enable Disk Use on? Is it an issue with my computer or a setting on my ipod I have over looked. My computer system is Windows XP, and my iTunes is version 9.
    Please help !

    Oh and in addition, my iPod is a 160gb Classic

  • Devices with Removable Storage - not being read or recognized.

    Good morning:
    My PC is HP Pavilion m7640n.
    Specifically LITE-ON DVDRW SHM-165H6S is not reading DVDs or CDs.
    Tried to download driver but there are instructions I do not understand involving a required CD.
    Any thoughts about why the "Devices with Removable Storage" are not being recognized?
    Cheers,
    Jamie

    A few things you could try:
    1.Use a different port and recheck the issue.
    2. You may try the same on a different computer.
    3.If the above doesn't help then get the device checked by an authorised service centre.
    S.Sengupta, Windows Entertainment and Connected Home MVP

  • Purchased a 2nd hand iPhone - unable to set up as it displays as associated with prior owners email - he has removed device from his account but still won't let me complete set up. Any advice on next steps?

    Display shows previous owner set up find my phone function & it is linked to their apple account. Owner has removed device from a/c but
    it still won't allow me to proceed with set up.

    Hello Penng185,
    Steps to be done to remove the device from the previous owner's iCloud Account, if you have already done this things then there might be something that you might have missed due to which the iPhone is still showing the Find My iPhone Activation Lock screen.
    Resolution : http://support.apple.com/kb/ts4515
    If the previous owner is with you and can access the device
    Ask them to enter their Apple ID and password on the Activate iPhone screen (shown above) to remove the device from their account. You can then proceed through the rest of the device setup process.
    If the previous owner is not present
    Contact them and ask them to follow these steps to remove the device from their account:
    Sign in to their iCloud account at www.icloud.com/find.
    Choose the device from their Find My iPhone device list by clicking All Devices and selecting the correct device.
    Click "Remove from Account" to remove the device from the account.
    After the device has been removed from the previous owner’s account, turn it off by pressing and holding the Sleep/Wake button located on the top right side of the device. Then restart your device and proceed with device setup as you would normally.

  • Apple Charger Plugged In PC, but now Charging or Showing on the Devices with Removable Storage

    when i plugged my ipod touch to the computer it makes a sound and it never charges or show on the device with removable storage

    A few things you could try:
    1.Use a different port and recheck the issue.
    2. You may try the same on a different computer.
    3.If the above doesn't help then get the device checked by an authorised service centre.
    S.Sengupta, Windows Entertainment and Connected Home MVP

  • How can I make my iPod touch 2G appear under "devices with removable storage"?

    My ipod always appears under "portable devices" under "my computer". I use Windows 7. I want to know why it does not appear under "devices with removable storage". I manually manage its contents. Please give any suggestions that may help. Thanks!

    - Because via My Coputer yu can only access the the photos (DCIM folder) taken by or saved to the iPod. The iPod touch (and iPad and iPhone) do not have a disk mode like other iPods)
    - You need a third-party program like SharePod to access music w/o iTunes

  • The device is not with me. remove device from icloud account will enable new user to retrieve my data

    The IOS device is not with me. By removing device from icloud account will enable new IOS device user to retrieve my data?

    If you remove it from your account all of the data that is in the account will be removed from the iPad.

  • Remove already registered Apple devices with my Apple ID

    Hi Folks
    I just to clear the list of limited Apple registered products with my apple ID. But when I login into my account. It doesn't show me any product registered to my apple ID. And every time I use another apple device with my Apple ID. I get a mail, saying that this device has been associated with your apple ID. Can somebody tell me the way where to login to see those registered devices.
    Thanks
    Pankaj Gupta

    i'm having the same problem ever since the new update!  i have no idea why it won't work, i've tried everything!

  • HT4906 how can i remove devices set up with my apple id so that when sold on they dont get my photos etc through i cloud

    how can i remove devices from my apple id , as device i have replaced still gets my photos etc from icloud ?

    thanks , i understand what your saying and thats fine if you do that before handing the phone over but it was i bought for ex girlfriend second hand and let her use my apple id for apps etc i have since changed passwords but cos my id is still the only active one on her phone last week she got 190 of my sent emails is there a way to remove the device once its left my hands ?

  • How do I use my late 2011 iMac ( with thunderbolt) as external monitor for laptop/Xbox or other device with hdmi as output.

    May be this question has been asked thousand times. how do I use my mid 2011 iMac ( with thunderbolt) as external monitor for laptop/Xbox or other device with hdmi as output. if apple hasn't removed that feature and has just moved that functinoality to thunderbolt then how can I use it. currently there is no laptop available with thunderbolt output. no 3rd party converter available. whats the use of having feature on latest functionality if we cant use it. I wish they would have made one port has mini-dvi and other thunderbolt for backward compatibility untill some vendor comes up with converter.

    It Says :
    Mac (21.5-inch, Mid 2011) and iMac (27-inch, Mid 2011) and later computers support Target Display Mode via Thunderbolt to Thunderbolt cable (2 m) when the source is another Thunderbolt-equipped computer.
    Name one computer model/vendor which has thunderbolt as output for display + audio. this is so stupid to move to new technology without availbility of its compatible devices.

  • How do I associate a device with my Apple ID?

    I have an iPad and an iPhone.  I sync them with my iMac desktop computer, and never with any other.  I always use the same Apple ID.  As far as I know, it's the only one I have.
    Recently, I purchased an app using my iPad.  The next time I synced the iPad with the computer, I got an alert saying "The purchased item 'App' on the iPad
    'Etchemendy's iPad' could not be transferred to your iTunes library because you are not authorized for it on this computer."  The alert goes on, in fine print, to say, "To authorize this computer for items purchased from the iTunes Store, choose Store > Authorize This Computer."
    So I choose Store > Authorize This Computer, and I get a second alert saying, "This computer is already authorized."  A nifty little continuous loop that neatly precludes me from using the app on any device except the one I used to purchase it.
    But it gets better.  In stumbling around trying to figure out what's going on here, I accessed "My Account" using iTunes on my desktop computer (logging in with the same Apple ID I used to purchse the troublesome app).  When I click "Manage Devices," I arrive at a box that says, "These computers and devices are associated with your Apple ID for Automatic Downloads or to download previously purchased music, apps, and books..."  It then gives me a "list" showing just one device -- my iPhone.  The iPad is not shown here.  Neither is the desktop computer iTunes just told me is already authorized.  There's a button that says "Remove" next to the iPhone.  And two bigger buttons.  One says "Cancel" and the other says "Done."  There is no "add a device" option.
    So how to I associate a device with my Apple ID?  And, as a matter of fact, why aren't all the devices I registered using my Apple ID already associated with it?  I never had any of these problems till the big iOS system upgrade a few months ago.  Since which, my interactions with Apple have nearly all been nightmarish.  Apple obviously put the WAY wrong guy in charge of iOS development.
    Oh.  And BTW, when I look at the drop-down menu for choosing the "product" I'm having a problem with, only about half the devices registered with my Apple ID appear there.  And I have no clue what kind of iPad I currently have.  I have the warranty right in front of me, and all it says is "iPad WiFi 64GB Black." No doubt if I try to solve this using Apple phone support, I'll have to pay $20 to straighten out Apple's problem for them.  Which is why I'm here.

    My guess is you're using a long Apple ID and just omitted or mistyped a letter sometime, or something similar.
    Anyway, the way to recover is this:
    You cannot change ownership of the mistyped Apple ID to the correct one.  After all, the mistyped one purchased it.  However, you can authorize purchases from the mistyped Apple ID on your devices by doing Store > Authorize This Computer on iTunes on your computer, and enter the mistyped Apple ID and password.  Then sync again and you'll be all set.
    When you change computer (e.g., sell your current one and buy a replacement), you'll have to repeat this process.

  • How to FaceTime and iMessage on multiple apple devices with one iTunes account

    We recently received iPad 2's for Christmas and was looking for some advice on how to FaceTime and iMessage on multiple apple devices with One iTunes Account (Apple Id).  I have created or attached other e-mail addresses to our apple id but do not know how to use them on the new devices.  Our home MacBook Pro uses our main apple id for FaceTime.  The iPads have been setup with the main apple id w/o being able to use FaceTime and iMessage.
    Please Help...
    I appreciate the help and support.

    P and V-
    If you are trying to connect to someone with a different Apple ID, I think all the devices should work, but one at a time.
    The problem is when you try to connect between two with the same Apple ID.  Once the calling device tries to make the connection, it finds the second device to be "busy".  That is where each needs to use a different E-Mail address when setting it up.
    On iOS devices, when you press the Home button to exit an App, the App may still be active in the background, even when the device is sleeping.  If FaceTime or iMessage is merely being active that way, it may be enough to "tie up" the E-Mail address.
    From the Home screen, double click your Home button.  You will see a list of recent Apps along the bottom of the screen.  Press and hold on one of them until they start to wiggle.  You will then see a red minus sign on each.  Pressing the minus sign will remove an App from the list, and stop it from working in the background.  (Click the Home button to stop the wiggling, and again to hide the recent Apps.)
    Fred

  • How to authorize just one of two devices with one account.

    My friends,
    I really don't know what forum to post this question: in iPhone, iPod Touch or iTunes.
    Well, the problem is simple. I have one Apple Apps account, one iPhone, mine, and an iPod Touch given away to my cousin. Both share the same iTunes library and I've synced in his iPod some of the apps I've bought. The problem is that I don't want my cousin to access less buy Apple apps by himself. I've made him clear that he shouldn't try to access, but he is a rebel boy and insists on accessing and therefore he blocks my account every time he tries guessing my password. How can I remove his iPod Touch authorization to access my account?????
    Desperado!!

    The iTunes account that is available on an iPhone and iPod Touch is transferred to the device via the iTunes sync process - with the iTunes account that iTunes is logged in to when syncing the device with iTunes.
    The only way to resolve this and remove your iTunes account from the Touch is restoring the Touch with iTunes as a new Touch followed by not syncing iTunes content with the same iTunes account. Let your rebel cousin fend for himself with his own iTunes account followed by purchasing and downloading his own iTunes content. That way when trying to be a rebel by purchasing iTunes content with someone else's account and not respecting your wishes - especially after giving him this Touch along with free iTunes account purchased with your iTunes account, he needs to learn what consequences can mean when not respecting you and your wishes. Or take the Touch away from him. I believe it sounds like it is time for some tough love.

  • Multiple devices with the same GUID

    Hi,
    According to the Zenworks Command line utilities reference https://www.novell.com/documentation...a/bb15p2z.html
    There exists an option to register a device with a new GUID by doing the following...
    register (reg) [-g] [-k <key>] [-u <username> -p <password] <ZENworks Server addressort>
    Registers the device in a Management Zone.
    You can use the following options:
    g - Lets you create a new device object with a new GUID and password for the device if you have multiple devices with the same GUID. When you register a device by using this switch, all the associations (policies and bundles) assigned to the original device object are removed. You cannot use this option to create a new GUID for a Primary Server or a Satellite device. The local user must have Local Administrator rights to use this option.
    I would like to know if it is possible to have such a command line option for the agent installation. So built into the agent installer, a command line option to force the agent to register with a new GUID.
    We are having CONTINUOUS problems with the above scenario. When we move devices from one computer lab to another and re-image the device, Zenworks keps trying to assign the same GUID to the device and this mixes up our Dynamic Workstation groups, which then affect the applicable policies to each device.
    I would like to know if there is an option to tell the installer to stop remembering the GUID and simply register the device with a new guid on agent installation.
    This way we can build that into the post imaging scripts which install the zenworks agent.

    Hi Craig,
    OK, I've had a look at the ZCM Reconcile rules and run a few tests to see if it is possible to get the machines not to reconcile (use a new GUID after imaging).
    As I have explained before, sometimes this result is desired in our case especially when we move machines around from lab to lab.
    So far, no matter what configuration I use, I cannot get Zenworks to generate a new GUID for a device that is getting re-imaged (without doing so only after the fact by unregistering the machine and reregistering the machine via the zac und and zac reg -g).
    We use dynamic workstation groups to assign policies and bundles to machines so reconciling the devices is not necessary most of the time. We need an option to tell the machine to register with a new GUID on installation of the agent. Surely such an option can be built into the agent installer?
    The options in the ZCM config management "reconcile settings" I tested with are:
    Serial Number - Unticked/Unselected
    Mac Address - Unticked/Unselected
    Machine Name - Unticked/Unselected
    Enable Differentiation - Unticked/Unselected
    I then also tested:
    Serial Number - Unticked/Unselected
    Mac Address - Unticked/Unselected
    Machine Name - Ticked/Selected
    Enable Differentation - Ticked/Selected
    and also:
    Serial Number - Unticked/Unselected
    Mac Address - Unticked/Unselected
    Machine Name - Ticked/Selected
    Enable Differentation - Unticked/Unselected
    With all three different configurations, I re-imaged the same machine, which renames the machine via the first post imaging installation script to match the DNS name. Thereafter the Zenworks agent gets installed, which then renames the machine back to what it was registered into the Zenworks database with on first installation.
    We need a method of telling Zenworks NOT to reconcile when we want it to. It should not reconcile every time and thereby rename the machine netBIOS name.
    Is there any way to achieve this?
    Originally Posted by CRAIGDWILSON
    Quite Simple,
    Let's say a HDD Dies and you replace it.
    All you need to do is bring down an image and the machine will come back as it was with all the same WS and Device associations.
    The same thing could apply if bringing in new Hardware.
    If a new computer were to replace an old computer but the name stayed the same, everything could be automatic depending on the rules setup.
    It is all a matter of how you tell ZCM to reconcile devices.
    The Help in the ZCC under these items should explain how it works so you can setup your rules to meet your use cases.

Maybe you are looking for

  • Macbook Pro won't start after Mountain Lion download.

    Downloaded Mountain Lion for my 2007-08 Macbook Pro. Internet was painfully slow (60kb/sec, usually 15 mgb/sec). After not using it a week while vacationing, I started it up, and it was working fine until it randomly shut down and brought up an error

  • Question: Keep getting "Renew Subscription" message

    I purchased the Creative Cloud educator package, so I am charged monthly access for the entire year. I am able to open Photoshop just fine, but when I try to open Illustrator, I keep getting a pop-up that says, "Renew Your Subscription." I follow the

  • Change what data type data socket requests from OPC server

    I suspect this is a foregone conclusion, however just in case; is there a way to make Datasocket request items from an OPC server in a different data type than variant? I have a server that scales integers (native data type) and offers tham as floati

  • Jax-ws and apache axis

    This is a newbie question. Can you tell me the difference between jax-ws and apache axis. Is it possible to build web services just using jax-ws and not apache axis. What would be advantages and disadvantages. Thanks.

  • Updation of Custom fields in MBEWH from MBEW

    Hi ABAPpers, Can anyone give me any clarity  if I append same structure in both MBEW and MBEWH, then during the update will these custom fields also gets updated? Or do we have any other procedure to do this? Edited by: VKUPPILI on Dec 9, 2011 1:17 P