Flash Drive Icons

Flash Drive Icons

I’ve had a thing for custom drive icons since I started burning my first CDs with Windows95. I can’t really explain the why of it, I just do. And as byzantine as Windows can occasionally be, you have to admit that its method of assigning the custom icons is sheer elegance in its simplicity:

  1. Create a file named autorun.inf in the drive root.

  2. Edit the file to include this text:

  3. Drop your custom.ico file in the drive root.

If you wanted to be super-sneaky like I did, you’d drop to a console and do this, too:

attrib +r +s +h autorun.inf
attrib +r +s +h custom.ico

This would ensure that, for most people, those files wouldn’t be visible in the drive listing. Magic!

When I started using Linux, I found that it was both simpler and less powerful. You can set an icon, but not in a way that gets transferred if you attach the drive to another computer.

  1. In Nautilus, right-click the drive icon and choose Properties.

  2. Click the drive icon, and browse to the new icon.

Easy, right? Maybe a little non-intuitive, as there’s nothing about the drive icon in the Properties window that attracts clicking. But once you know it’s there, you can’t beat it for simplicity.

Drive icons on the Mac, however … woof. The theory is simple, but there are a few hoops. There’s a GUI drag-n-drop method involving the Info pages of the drive and the icon … but in Leopard I can never get it to work. When I paste the icon, it turns into the generic JPEG or PNG icon used for photos.

So instead, we have the long way:

  1. Download and install both Img2icns and IconDroplet.

  2. Drop your drive icon file into Img2icns, and save it as an ICNS file.

  3. Drop your ICNS file into IconDroplet, which will compile it into a .app file on your desktop.

  4. Open a Terminal window, and type the following:

    cp ~/Desktop/myfile.app/Contents/Resources/applet.icns /Volumes/mydrive/.VolumeIcon.icns
    SetFile -a C /Volumes/mydrive
  5. If it doesn’t show up immediately, you may need to eject and remount the drive.

Hey, you, smarty-pants Rick, you might ask, why do I need IconDroplet? Why isn’t the ICNS file from Img2icns good enough?

I have no earthly idea. You would think that it would be, right? I have to assume that there’s something subtly wrong with the file produced by Img2icns that IconDroplet then fixes. Point being, that series of steps, cargo cult as it may be, works for me every time.

Unfortunately, that SetFile step is a bit of black box juju magic. There’s probably an equivalent command that you could run on Linux or Windows that would twiddle the same bits, but I don’t know what they are. I’d love to have a script/app that I could run that would set all 3 icons at once, but whatever.