| ||||||||
General Mac OS X Discussion General Apple and Mac OS X Discussion
|
| | LinkBack | Thread Tools | Display Modes |
(#1)
|
| Expert Member Posts: 692 Join Date: Mar 2009 | I'm about to install one of those PCI-e to SDHC reader cards in my mini. Since the mini turns off any USB device when it sleeps that means my internal SDHC 'disk' will be unmounted without the proper OS X 'drag it to the trash' unmount operation. I'm sure there's at least 1 place to add a script to dismount any SDHC discs before sleep actually occurs. Just not enough of a hacker to know where I want to look. Help anyone, please? Brian Mini2: Mini9, Black, 2G, 0.3 Webcam, Bluetooth, 32G RunCore, OS X/Win 7, internal PCI-e SHDC Reader Mini3: Mini10v. Black, 2G, Webcam, 640G HD, OS X 10.5.8/Win 7/Ubuntu [Hibernate w/NBI 0.8.3 RC4] Dropbox Referral |
| | |
(#2)
|
| Super Moderator Posts: 1,356 Join Date: Jan 2009 Location: Idaho | Um... what? Why on earth are you doing this again? My SDHC card in the SD slot doesn't unmount during sleep. It is exactly where I left it when I open the lid or press the power button. No errors or anything. So I'm having a very hard time figuring out what you are trying to accomplish. http://osx.mechdrew.com - News and Guides for Installing Mac OS X via NetbookInstaller - Now on Twitter |
| | |
(#3)
|
| Expert Member Posts: 692 Join Date: Mar 2009 | http://mydellmini.com/forum/viewtopic.php?f=11&t=4845 This thread is about a mini PCI-e adapter that takes a SDHC card. This would give an additional SDHC card for use to suppliment the storage on my mini. *BUT* it shows up as a USB device, ie. a card reader. When sleep happens power turns off card is dismounted but not gracefully. Same as what happens with a USB reader stuck in one of the USB ports. I'm just asking where to stick my script, what location for this sort of thing. Brian Mini2: Mini9, Black, 2G, 0.3 Webcam, Bluetooth, 32G RunCore, OS X/Win 7, internal PCI-e SHDC Reader Mini3: Mini10v. Black, 2G, Webcam, 640G HD, OS X 10.5.8/Win 7/Ubuntu [Hibernate w/NBI 0.8.3 RC4] Dropbox Referral |
| | |
(#4)
|
| Super Moderator Posts: 1,356 Join Date: Jan 2009 Location: Idaho | Well, I found this old app that may or may not work for you. I know it is PPC based, but it may still work. I'll keep looking around for a better solution. http://osx.mechdrew.com - News and Guides for Installing Mac OS X via NetbookInstaller - Now on Twitter |
| | |
(#5)
|
| Expert Member Posts: 692 Join Date: Mar 2009 | That's sort of the idea but that will quit any applications running an app that was on the USB card, nice idea, but I'm looking to dismount the drive. For example, on my eee 701 I have scripts that get run from /etc/acpi/powerbtn.sh and /etc/acpi/suspend2ram.sh I'm betting there are similar places for OS X given its *nix roots. That's what I'm lookin' fer ![]() Mini2: Mini9, Black, 2G, 0.3 Webcam, Bluetooth, 32G RunCore, OS X/Win 7, internal PCI-e SHDC Reader Mini3: Mini10v. Black, 2G, Webcam, 640G HD, OS X 10.5.8/Win 7/Ubuntu [Hibernate w/NBI 0.8.3 RC4] Dropbox Referral |
| | |
(#6)
|
| Senior Member Posts: 187 Join Date: Mar 2009 Location: Kanata, Ontario, Canada | Does this give any hint on how it could be done? http://ipis-osx.wikidot.com/forum/t-...-card-at-sleep How to automatically unmount usb drive/sd card at sleep TravHavlicek 7 Dec 2008, 04:15 -0-500 I have an SD card that is always in my 1000h. Whenever I would resume from sleep I would receive an error that the card was not correctly unmounted. Heres an article I found that will fix this problem. http://www.windley.com/archives/2008/03 ... ives.shtml If you followed every step from the install wiki, then you would have already installed Sleepwatcher. After you type 'sudo visudo' in the terminal, and add the correct line, you have to press 'Esc' and then type 'w:' (without the apostrophes) then press enter to save your changes. It doesn't tell you that in the guide, and just closing the terminal window will not save your changes. Also if you just want to unmount a normal drive, not a backup drive linked to time machine, you would change the line: sudo /sbin/umount -f /Volumes/Phil\ Backup to sudo /sbin/umount -f /Volumes/Phil You would obviously change the word Phil to name of your external drive. If the name of your drive has a space in it, then you have to add quotation marks around the name of your drive. So if your drive was called 'SD Card' then it would look like this: sudo /sbin/umount -f /Volumes/"SD Card" Now my sd card unmounts correctly when I put it to sleep. Hope this helps someone. EXCERPT: Download and install SleepWatcher. There are two installs that have to be done in the right order (StartupItem last). Now whenever you restart SleepWatcher will start as well. Modifiy your sudoers list. This allows umount to run as the superuser without a password (otherwise you have to type the superuser password everytime you put your Mac to sleep). Use the command sudo visudo to edit the sudoers file. If you don’t know vi, get someone to help with this step. You want to add the following line to the end of the sudoers file: %admin ALL= NOPASSWD: /sbin/umount This tells the sudo program to allow everyone in the %admin group to execute the umount command as the superuser without a password. Create a .sleep file. This is where you actually unmount the drive. Put the following in a .sleep account in your home directory (you’ll have to create this file) #/bin/bash # always unmount the drive before sleep sudo /sbin/umount -f /Volumes/Phil\ Backup You’ll want to change /Volumes/Phil\ Backup to whatever the name of your backup drive is (look in /Volumes to find it). Make sure you make the .sleep file executable: chmod u+x $HOME/.sleep You can test it by executing the .sleep file from the command line. Your disk should unmount without asking for a password if you’ve done these steps correctly. That’s it. Now when you sleep your machine the Time Machine drive will unmount automatically. You can add other things to the .sleep file if you like to accomplish anything else you’d like done before the machine sleeps. SleepWatcher will also execute a .wakeup file for things you want done when the machine wakes up. http://www.bernhard-baehr.de/ SleepWatcher 2.0.5 (now compatible with Mac OS X 10.5 “Leopard”) is a command line tool (daemon) for Mac OS X that monitors sleep, wakeup and idleness of a Mac. It can be used to execute a Unix command when the Mac or the display of the Mac goes to sleep mode or wakes up or after a given time without user interaction. It also can send the Mac to sleep mode or retrieve the time since last user activity. A StartupItem, sample start and sleep scripts and the source code for sleepwatcher are included in the download. A little bit knowledge of the Unix command line is required to benefit from this software. You can also download a standalone source code archive for SleepWatcher 2.0.5. SleepWatcher 2.0.5 runs with Mac OS X 10.3 to 10.5. For Mac OS X 10.1 to 10.3, there is still SleepWatcher 1.0.1 available. SleepWatcher is published under the GNU General Public License. Awhile ago, it was a Pick of the Week at Mac OS X Hints. Dell Vostro A90 (96Gb) | SL 10.6.5 | 2G HyperX | 0.3Webcam | BIOS A04 | 64G Runcore SSD | 32G SDHC (ext) | and other stock features | CLICK HERE TO ADD AN INTERNAL SDHC CARD | | CLICK HERE TO TAKE THE HACKINTOSH POLL | |
| | |
(#7)
|
| Expert Member Posts: 692 Join Date: Mar 2009 | Didn't have time right now to read through everything but that sure looks just like what I nee. Thanks! Mini2: Mini9, Black, 2G, 0.3 Webcam, Bluetooth, 32G RunCore, OS X/Win 7, internal PCI-e SHDC Reader Mini3: Mini10v. Black, 2G, Webcam, 640G HD, OS X 10.5.8/Win 7/Ubuntu [Hibernate w/NBI 0.8.3 RC4] Dropbox Referral |
| | |
(#8)
|
| Senior Member Posts: 187 Join Date: Mar 2009 Location: Kanata, Ontario, Canada | Quote:
ops: Just follow the directions and the SDHC card (installed in the MR-04 PCIe mini card) will unmount when the Mini goes to sleep (obviously in OSX**). When waking up, a few seconds will pass and the SDHC card will be automatically re-mounted. No more USB "failure to eject properly" error messages. (**BTW: Win7 auto unmounts and no errors are noted with the MR-04. I've not tested other OSs) Dell Vostro A90 (96Gb) | SL 10.6.5 | 2G HyperX | 0.3Webcam | BIOS A04 | 64G Runcore SSD | 32G SDHC (ext) | and other stock features | CLICK HERE TO ADD AN INTERNAL SDHC CARD | | CLICK HERE TO TAKE THE HACKINTOSH POLL | | |
| | |
(#9)
|
| Expert Member Posts: 692 Join Date: Mar 2009 | I'm fighting an illness right now so other than laying here and using my mini to read the forum I really haven't gotten around to doing too much with my mini like installing the PCI-e -> SDHC adapter. Just out of curiosity, did you just unmount the drive or did you use lsof to close down apps that might be hold files open on the SDHC card preventing it being unmounted? Mini2: Mini9, Black, 2G, 0.3 Webcam, Bluetooth, 32G RunCore, OS X/Win 7, internal PCI-e SHDC Reader Mini3: Mini10v. Black, 2G, Webcam, 640G HD, OS X 10.5.8/Win 7/Ubuntu [Hibernate w/NBI 0.8.3 RC4] Dropbox Referral |
| | |
(#10)
|
| Senior Member Posts: 187 Join Date: Mar 2009 Location: Kanata, Ontario, Canada | Quote:
... but it did not work for me. I'll send you a PM to see if you can hint me to the differences between your machine and mine. The standard SleepWatcher code, which simply unmounts, works fine -> sudo /sbin/umount -f /Volumes/XXX where XXX is the name of my SDHC volume. EDIT: Ok, the new code (w/ error checking) works. Just have to pick the correct volume (diskXsY). Much thanks for the enhanced code, I especially like the logging feature.Dell Vostro A90 (96Gb) | SL 10.6.5 | 2G HyperX | 0.3Webcam | BIOS A04 | 64G Runcore SSD | 32G SDHC (ext) | and other stock features | CLICK HERE TO ADD AN INTERNAL SDHC CARD | | CLICK HERE TO TAKE THE HACKINTOSH POLL | | |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Copyright © 2008-2011 MyDellMini.com.









ops:
Linear Mode