Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Prevent Spotlight from indexing external hard drives Storage Devices
If you, like me, get annoyed by the index files Spotlight creates any time you create an external hard drive, you might want to try this hint. We're going to set up a launchd service which runs a script every time a hard drive is mounted. This script will touch the .metadata_never_index file (which prevents Spotlight from creating the index; see this hint) on the hard drive.

Let's start with the launchd service. Open Terminal and type the following, then press Return:
$ cd ~/Library/LaunchAgents/ 
Create the file com.index.no_index.plist with your favorite editor (vi, nano, etc.), and insert the following XML code:
 
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.index.no_index</string>
	<key>Disabled</key>
	<false/>
	<key>Program</key>
	<string>/Users/*YOUR_NAME*/no_index</string>
	<key>StartOnMount</key>
	<true/>
	<key>RunAtLoad</key>
	<false/>
	<key>KeepAlive</key>
	<false/>
	<key>EnableTransactions</key>
	<true/>
</dict>
</plist>
Do not forget to change *YOUR_NAME* to the name of you home folder. If you don't know what to put there type echo $HOME in Terminal.
read more (109 words)   Post a comment  •  Comments (6)  
  • Currently 2.84 / 5
  You rated: 4 / 5 (19 votes cast)
 
[24,900 views] Email Article To a Friend View Printable Version
Eject the Western Digital SmartWare VCD on login Storage Devices
Here is a simple, safe AppleScript that ejects the Western Digital SmartWare VCD on start up. Paste this code into the AppleScript Editor, save it as an application, and add it to your login items in the Accounts System Preferences panel. Note that this does not remove the VCD; it just keeps it off your desktop.
tell application "Finder"
  activate
  try
    eject disk "WD SmartWare"
  end try
end tell
[robg adds: I haven't tested this one, as I don't have the software in question.]
  Post a comment  •  Comments (9)  
  • Currently 2.56 / 5
  You rated: 3 / 5 (16 votes cast)
 
[12,419 views] Email Article To a Friend View Printable Version
Create a shared mounted volume for all users of a Mac Storage Devices
The motivation for this hint was to have one folder for common use, with read and write privileges for every user. In Mac OS X, the Shared directory can be used by all users. However, a file there is still owned by the user who put it there. Another user cannot edit the file without authentication. This hint creates a common volume named AppleBasket, where users can have files in common.

In practice, an encrypted disk image mounting automatically for every user is a good solution to this problem. The following AppleScript automates the unixy requirements in creating such a disk image. Here's the script:
(*
AppleBasket 1.0

Creates a common volume for all users.

Motivation for the script was to have a folder for common use, with read and write privileges for every user.
Tested with Mac OS X 10.4., 10.5 and 10.6. Requires launchd (appeared in Mac OS X 10.4).
Tuomas Rosberg 2010. Paste into a new document in AppleScript Editor, run from there or save as an application.
*)

-- To install or to uninstall:
tell application "System Events"
  set pListList to every item in folder "/Library/LaunchAgents/" whose name contains "AppleBasket"
  if pListList is not {} then
    set sList to {}
    repeat with i in pListList
      set s to POSIX path of i
      set sList to sList & s
    end repeat
    my Choices(sList)
  else -- pListList was empty.
    my CreateImage()
  end if
end tell
on Choices(sList)
  display dialog ¬
    "A job by this script already exists. Do You want to uninstall the job or proceed to new one?" buttons {"Uninstall", "Proceed"} default button "Uninstall"
  set theResult to button returned of the result
  if theResult is "Uninstall" then
    do shell script "sudo launchctl unload /Library/LaunchAgents/" with administrator privileges
    repeat with i in sList
      do shell script "sudo rm -f " & i with administrator privileges
    end repeat
    display dialog ¬
      "“AppleBasket” job has been uninstalled. Please log out and in." buttons "Quit" default button 1
  else -- the result is "Proceed".
    my CreateImage()
  end if
end Choices

-- Installing:
on CreateImage()
  -- To compile a unique name for the common volume:
  tell application "System Events"
    set aList to every item in folder "/" whose name contains "AppleBasket"
    set aList to aList & (every item in folder "/Users/" whose name contains "AppleBasket") -- In case of this script being used before.
  end tell
  set n to count aList
  if n is 0 then
    set n to ""
  end if
  set imageName to "AppleBasket" & n as text
  -- Info for the user:  
  display dialog ¬
    "The script will create “AppleBasket”, a common volume, readable and writable for every user, in directory /Users." & return & return & ¬
    "Next you will be asked for a password. Every user of the volume needs to enter it. (Only once if they save it in their Keychain.)" buttons {"Cancel", "OK"} default button "OK" with icon note
  if button returned of result is "OK" then
    display dialog ¬
      "Please give a password used for accessing “AppleBasket”. " default answer "Common Volume" buttons "OK" default button "OK"
    set pWord to text returned of the result
    display dialog ¬
      "The password for “AppleBasket” is “" & pWord & "”" & return & return & ¬
      "Write it down to help your memory!" buttons "OK" default button "OK" with icon note
    display dialog "To create common volume for every user you will be asked to authenticate as an administrator." & return & return & ¬
      "Create disk image " & imageName & "?" buttons {"Cancel", "OK"} default button "OK" with icon caution
    -- Action: Create an image of 1 GB volume owned by root:
    do shell script "sudo printf \"" & pWord & "\\0\" | hdiutil create -volname \"" & imageName & "\" -size 1g -type SPARSE -fs HFS+J -encryption AES-128 -stdinpass \"" & imageName & "\"" with administrator privileges
    tell application "Finder"
      activate
      set fileName to imageName & ".sparseimage"
      if (exists of file fileName of startup disk) is true then -- this tests success of previous "do shell script", may be too abundant.
        my MountCommands(fileName)
      end if
    end tell
  end if
end CreateImage

on MountCommands(fileName)
  -- Move the disk image:
  do shell script "mv -nv '" & fileName & "' /Users/" with administrator privileges
  -- Give disk image read and write permission for all users:
  do shell script "chmod 777 '/Users/" & fileName & "'" with administrator privileges
  -- Ready to write a preference list:
  set homeFolder to path to home folder as string
  set plistName to "org.AppleBasket.mount.plist"
  set newPlist to homeFolder & plistName -- A path string
  open for access newPlist with write permission -- Creates a new file, if it doesn't exist.
  set f to result
  write "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
  <key>Label</key>
  <string>org.AppleBasket.mount</string>
  <key>OnDemand</key>
  <true/>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/bin/hdiutil</string>
    <string>attach</string>
    <string>/Users/" & fileName & "</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>WatchPaths</key>
  <array>
    <string>/Volumes/</string>
  </array>
</dict>
</plist>" to f
  close access f
  -- The administrator stuff to make the job work:
  set newPlist to POSIX path of newPlist
  -- Unload launchd jobs of /Library:
  try
    do shell script "launchctl unload /Library/LaunchAgents/" with administrator privileges
  end try
  -- Move the plist to a folder watched by the system starter, launchd:
  do shell script "mv -f " & newPlist & " /Library/LaunchAgents/" with administrator privileges
  -- Change ownership of the plist to system and group to admin:
  do shell script "chown root:admin /Library/LaunchAgents/" & plistName with administrator privileges
  -- Change mode of file to read for all, execute for none:
  do shell script "chmod 644 /Library/LaunchAgents/" & plistName with administrator privileges
  -- Load launchd jobs of /Library:
  do shell script "launchctl load /Library/LaunchAgents/" with administrator privileges
  activate me
  display dialog "A per-user job for every user has been installed to mount of the common volume automatically. Please log out and in." buttons "Quit" default button 1
end MountCommands
Paste into a new document in AppleScript Editor, run from there or save as an application. AppleScript was chosen so that I could make a (spartan) user interface. Any other scripting language would be much easier to debug, but AppleScript was all I tinkered with on Mac OS 9, before having kids and real life. To make a bigger disk image, edit the -size variable to something larger, like 10g.

Note that if Fast User Switching is in use and the AppleBasket volume is mounted for a user other than current one, there will be problems.

The script may be useful for a family Mac. Alternatively, one can set up an external hard drive or some storage cloud for every user of their Mac, of course.

[robg adds: I haven't tested this one. You may want to check the original source of the script, to see if anything has changed since this hint was published.]
  Post a comment  •  Comments (12)  
  • Currently 2.47 / 5
  You rated: 5 / 5 (15 votes cast)
 
[10,087 views] Email Article To a Friend View Printable Version
One way to format a disk for Linux on a Mac Storage Devices
At present there is no method native to 10.6 Snow Leopard to format a drive with a Linux filesystem such as EXT2 or EXT3. This hint uses a bootable open-source Linux CD-ROM running the gparted application in order to format and partition these and many other filesystems.

To create a bootable CD that you can use to manipulate Linux-formatted drive volumes, take the following steps.
  1. Download the latest version of gparted-live -- make sure to get the ISO disk image.
  2. Burn the ISO to a CD using Disk Utility. This CD will boot your Mac into an open source Linux OS. Nothing in OS X or on your hard drive is changed, and you don't need to use Boot Camp or any emulation software.
  3. To boot into the CD, select it in the Startup Disk System Preferences pane and then restart. Warning! Use a USB keyboard and mouse, as this Linux OS cannot handle Bluetooth wireless.
  4. Be somewhat amazed as your Mac reboots and Unix code streams down the page. There are a couple of prompts for input along the way, before you arrive in the GUI of the OS.
  5. The gparted (Gnome Partition Editor) software launches automatically, and you can select any mounted volume for information and manipulation, and many filesystems are supported. There is extensive online documentation and support for this software.
  6. Be very careful! Formatting deletes all your data, so obviously the usual precautions about backing up apply. Be sure to select the correct volume on which to make any changes!
  7. Shut down when you have finished. Warning! Your Mac may not respond to the alt (option) key when you restart and you may have to manually eject the CD before you can reboot into OS X.
  Post a comment  •  Comments (4)  
  • Currently 1.96 / 5
  You rated: 2 / 5 (23 votes cast)
 
[26,263 views] Email Article To a Friend View Printable Version
Make OS X see expanded space in RAID setup Storage Devices
I expanded my RAID from 9TB to 13TB, and after it had finished, I noticed I had to resize the partition in order to use the new space. When I used Disk Utility, I got an error saying "Partition failed with the error: MediaKit reports partition (map) too small." After googling, I found the solution on the "life as i know it" blog, and thought I'd share the basics of the solution.

From the blog post, here's the essence of the problem and the solution:
Basically what’s going on here is that the GPT table is built only big enough for the drive it’s on. That’s a logical assumption - hard drives don’t magically get larger - unless they’re RAID arrays. We’re just removing the GPT partition information, and replacing it. Should things go crazy, as long as you’ve got the start and size information for the partition you care about, you should be good. No guarantees obviously, but I’ve done this three times and no data loss yet.
Read on for a summary of the fixes involved, and see the blog post for more details...
read more (185 words)   Post a comment  •  Comments (2)  
  • Currently 1.82 / 5
  You rated: 1 / 5 (17 votes cast)
 
[8,064 views] Email Article To a Friend View Printable Version
10.6: Fix a Drobo issue on non-64bit-capable Intel Macs Storage Devices
Snow Leopard only hintIf you installed the latest version of Drobo Dashboard (currently v1.6.1) on Snow Leopard, and you're also unfortunate enough to have a Intel Mac that doesn't support 64-bit, then you might notice a drop in performance of your Drobo, and possibly your system altogether.

Check your Console logs. If you see something like this...
com.apple.launchd[1]  (com.datarobotics.ddservice64d[325]) posix_spawn("...."): Bad CPU type in executable
com.apple.launchd[1]  (com.datarobotics.ddservice64d[325]) Exited with exit code: 1
com.apple.launchd[1]  (com.datarobotics.ddservice64d) Throttling respawn...
...then the Drobo installation software installed the 64-bit binaries and kexts, even though your machine doesn't support them. Here's how I fixed it.

read more (119 words)   Post a comment  •  Comments (2)  
  • Currently 2.73 / 5
  You rated: 4 / 5 (22 votes cast)
 
[12,579 views] Email Article To a Friend View Printable Version
10.6: Make some older FireWire drives work again Storage Devices
A small number of users lost the use of their older FireWire 400 disc burners (and perhaps other FireWire peripherals) after installing Snow Leopard. I have a fairly new Pioneer DVD burner installed in a circa-2001 LaCie enclosure, and I was one of the victims. The 10.6.1 update did not address this issue. Until Apple remedies the situation, here is a solution that works without any obvious side-effects:

Locate IOFirewireSerialBusProtocolTransport.kext in /System/Library/Extensions, and store it in a safe place. Replace this item with the same extension from Mac OS X 10.5.x Leopard. The date stamp on my copy was October 9, 2007. (You may still have a copy in your Time Machine backup.) After replacing the file, use Disk Utility to Repair Permissions. This step is vital, or else the replacement extension may not be recognized by the System. Finally, restart your Mac.

After the restart, if your FireWire drive worked properly under 10.5.x, it should work fine again.

NOTE: This hint involves mucking around in your System folder. Appropriate precautions are in order. Do not perform this operation if you are not experiencing issues with your FireWire devices. I did not originate this hint; it came to me as an anonymous reply to a message I posted to several places on the 'net.
  Post a comment  •  Comments (3)  
  • Currently 1.80 / 5
  You rated: 3 / 5 (15 votes cast)
 
[12,035 views] Email Article To a Friend View Printable Version
10.6: Enable native NTFS read/write support Storage Devices
Snow Leopard has the ability to mount NTFS volumes as read/write, but it's not enabled by default -- just read only is supported, as in 10.5. Here's how to get full read/write support for NTFS drives in Snow Leopard. First, uninstall NTFS-3G or Paragon if you're using either one.

Here's how to get read/write support for NTFS drives in Snow Leopard:
  1. In Terminal, type diskutil info /Volumes/volume_name, where volume_name is the name of the NTFS volume. From the output, copy the Volume UUID value to the clipboard.
  2. Back up /etc/fstab if you have it; it shouldn't be there in a default install.
  3. Type sudo nano /etc/fstab.
  4. In the editor, type UUID=, then paste the UUID number you copied from the clipboard. Type a Space, then type none ntfs rw. The final line should look like this: UUID=123-456-789 none ntfs rw, where 123-456-789 is the UUID you copied in the first step.
  5. Repeat the above steps for any other NTFS drives/partitions you have.
  6. Save the file and quit nano (Control-X, Y, Enter), then restart your system.
After rebooting, NTFS partitions should natively have read and write support. This works with both 32- and 64-bit kernels. Support is quite good and fast, and it even recognizes file attributes such as hidden files. My thanks go to Chrysaor, a MacRumors user who brought this to our attention.

[robg adds: I haven't tested this one, as I don't have any NTFS drives on my Snow Leopard machines. There may be good reasons why Apple left support disabled, so use at your own risk. Mac OS X Hints reader Jakimowicz submitted a similar hint which pointed out the free NTSF Mounter utility, which lets you enable read/write on NTFS volumes via a simple GUI.]
  Post a comment  •  Comments (48)  
  • Currently 2.95 / 5
  You rated: 3 / 5 (42 votes cast)
 
[346,774 views] Email Article To a Friend View Printable Version
One way to use an unsupported DVD burner Storage Devices
When buying a new DVD burning unit, I didn't waste a second on compatibility issues with Mac OS 10.5. Instead, I bought the first DVD burner available for around 20 Euros: A LG Electronics GH-22NP20. I attached it externally with an Delock Converter USB 2.0 to SATA/IDE.

First tests works quite well -- DVD and CD reading, and even CD burning, works with Mac OS 10.5's integrated software and drivers. But serious problems occurred when trying to burn a standard DVD: The burning software, Burn.app in my case, ends with an error stating the disk capacity is exceeded, regardless of the size of the files to burn. There are a lot of fine burning apps for free on the market, but non of them seem to work.

After digging around in the net, I came to the conclusion that this burner is incompatible to Mac OS 10.5. A lot of users have the same problems -- take a look at this Apple Discussions thread, for example. The only solution that seems to work: buy a version of Toast. I know this is an excellent piece of software, but really, buying software for about 100 Euros to run hardware that cost 20 Euros?

My first thought was to replace the LG drive with another Mac OS X-compatible one. But then I remembered a solution coming from the UNIX-side of Mac OS X. I gave it a try and it worked. Don't fear the Terminal (located in the Utilities folder in the Applications folder!). Read on for the solution in detail.
read more (379 words)   Post a comment  •  Comments (3)  
  • Currently 1.87 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (15 votes cast)
 
[13,959 views] Email Article To a Friend View Printable Version
Create lower case FAT volume names Storage Devices
Note: Please see comments for a safer method of doing this!

Have you ever been annoyed by those ugly capital letters in your USB drive's names? Well I was and here's how I fixed it:
  1. Locate your device: Open up Disk Utility and select the drive. Click on Info, and copy the device name, e.g.: disk2s1.
  2. Deactivate the disk (Do not Eject it).
  3. Open up a Terminal window, do a hexdump on the device name you just found, and grep for the current volume name:
    $ hexdump -C /dev/disk2s1 | grep "Pablo"
    00000040  80 00 29 08 ac 67 54 50  61 62 6c 6f 27 73 20 4b  |..).?gTPABLO'S K|
    010000e0  50 61 62 6c 6f 27 73 20  4b 65 79 08 00 00 18 bc  |PABLO'S KEY....?|
  4. Create a text file containing the new label: echo "Pablo's Key" > input
  5. Replace the old label with the new one using dd:
    $ dd if=input bs=1 count=11 seek=0x47 conv=notrunc of=/dev/disk2s1
    $ dd if=input bs=1 count=11 seek=0x10000e0 conv=notrunc of=/dev/disk2s1
    Note: Set the count value to the label's length. Remember that a FAT drive label cannot be longer than 11 characters.
  6. Run a new hexdump to verify:
    $ hexdump -C /dev/disk2s1 | grep "Pablo"
    00000040  80 00 29 08 ac 67 54 50  61 62 6c 6f 27 73 20 4b  |..).?gTPablo's K|
    010000e0  50 61 62 6c 6f 27 73 20  4b 65 79 08 00 00 18 bc  |Pablo's Key....?|
And as always, proceed at your own risk and back up any data on the drive before proceeding. You can find more detail on this, including some screenshots, in this MacRumors forum thread.
  Post a comment  •  Comments (11)  
  • Currently 1.33 / 5
  You rated: 1 / 5 (12 votes cast)
 
[10,183 views] Email Article To a Friend View Printable Version