Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I use a microSD card in my macbook air for additional storage, using a flush adapter (homemade, similar to the nifty minidrive).

To save battery when I'm not using it, I disabled auto-mount using /etc/fstab. But sometimes, I accidentally eject it instead of unmounting (because that's what the finder gui does).

After it's ejected, the only way I know to remount is to take the card adapter out and put it back in. Since it's flush, I need a paperclip to take it out.

So I need a way to re-enable the card reader without having to re-insert.

In Windows, this is possible using the devcon command-line tool from microsoft, or going to device manager, disabling and enabling the card reader.

There has to be a way to do this, so please don't answer just saying it's not possible.

Thanks

share|improve this question
1  
I appreciate this isn't what you want to hear, but unfortunately, I don't think there is a way to remount once you've ejected a disk (either through Finder, Disk Utility or using diskutil). As you say, if you unmount this disk (rather than eject) using diskutil unmountDisk, for example, then you can simply remount it again afterwards with diskutil mountDisk. That said, take a look at this question which suggests and alternative app and (in the comments) a way to do it using unloading kexts –  binarybob Aug 31 '12 at 9:13
1  
Thanks for the kernel module unload/reload idea, that makes perfect sense. I don't know why I didn't remember about that, it is equivalent to the Windows way. –  CoolkcaH Sep 1 '12 at 12:24

5 Answers 5

up vote 1 down vote accepted

Mountain has a feature called "Remount USB storages" to do what you want.

This blog article tells you how to use Mountain to solve common issues with the Nifty MiniDrive like battery drain in sleep mode or how reattach the SD card after it has been ejected.

Best thing is Mountain installs a priviliged helper tool, so you don't have to enter your administrator password every time you want to remount the drive. Also you can configure Mountain to do it's job automatically in the background.

share|improve this answer

On Mountain Lion with built-in SD readers:

sudo kextunload -b com.apple.driver.AppleSDXC
sudo kextload -b com.apple.driver.AppleSDXC
share|improve this answer

Type this in terminal:

sudo kextunload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCardReader.kext; sudo kextload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCardReader.kext

This will unload and load the card reader kernel drivers, and it will appear in diskutil again.

Thanks to binarybob for the pointers.

share|improve this answer

I have built an AppleScript out of Coolkah's solution:

display dialog "Your Administrator Password:" default answer "" with hidden answer
set PWD to text returned of the result
do shell script "sudo kextunload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCardReader.kext; sudo kextload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCardReader.kext" user name "your name" password PWD with administrator privileges
share|improve this answer
    
Great, thanks! I found this page to be very useful in setting up the script. Also, naturally, you much change the "your name" part of the code to your computer's name, otherwise your password will be rejected (I know, I was stupid enough to try). daiya.mvps.org/applescript.htm –  PatrickT Oct 11 at 7:33

Eject/Remount with a keyboard shortcut (prompts for password)

This is based on roadrunner, which was based on CoolkcaH, and based on the apple guide to using Automator.

How to Create a Workflow with Automator

  1. Launch Automator

  2. Select the "Service" template.

  3. Select "Utilities" from the Library and double-click "Run AppleScript".

  4. To create a service that is always available, select:

"Service receives [no input] in [any application]"

at the top of the Automator screen.

  1. Type the following AppleScript:

    on run {input, parameters}

    display dialog "Your Administrator Password:" default answer "" with hidden answer
    set PWD to text returned of the result
    do shell script "sudo kextunload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCardReader.kext; sudo kextload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCardReader.kext" user name "[UserName]" password PWD with administrator privileges
    
    return input
    

    end run

where the part [UserName] should be replaced by your machine's user name / login account.

  1. Save the service with a unique name. The service will be saved in:

~/Library/Services

  1. Add a keyboard shortcut. Open the Keyboard Shortcuts pane in the Keyboard panel in System Preferences. Click the + sign to add a new shortcut and find the name of the service. Add a shortcut by double-clicking on the right side of the service name. Example: command+option+F12 (you may want to avoid a key combination that could be accidentally pressed).
share|improve this answer
    
I'd like to add the following free advice, based on my 1-day experience of having an SD card: Go to Spotlight Preferences and add the SD card to the list of things NOT to be indexed: indexing with an SD card seems to be buggy: it goes on in an infinite loop, it copies a million invisible files with extension _. (or something like that), it causes freezes to the cursor every 2 minutes, it drains the battery and, in my experience, heats up so much that the SD card is force-dismounted and you need to reset SMC to get it back. –  PatrickT Oct 11 at 8:25
    
To prevent a mounted SD card from being indexed by Spotlight, I found the fourth method described in the comments at the bottom of this thread to "survive" unmounts (create a file named .metadata_never_index in the directory you want to exclude): tekrevue.com/tip/… –  PatrickT Oct 13 at 15:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.