|
|
Command to unmount iPod
|
|
|
|
Mac Enthusiast
Join Date: Mar 2004
Status:
Offline
|
|
No matter what I do, my iPod seems to say "do not disconnect" about 40% of the time when I wake up in the morning. I'd rather not make a whole lot of noise and disturb my roommates by sitting down at the computer, turning on the monitor, logging in, and then ejecting the iPod. I don't have it set to sync automatically or anything.
so, I figured the best way to solve this would be to set up cron jobs to eject the iPod 10-15 minutes before I leave every morning. I have no problem setting cron jobs, but I don't know what command I should be using. I read the man pages for both umount and hdiutil but I'm too unfamiliar with the terminology to know what I should be doing.
Oh, also a command to determine if the iPod is mounted would be nice, too. That way I could just run a shell script a bit before I leave in the morning that would check first before trying to unmount a volume that doesn't exist.
Thanks!
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status:
Offline
|
|
If you know the name of the iPod (I'm assuming you do) then you can grep the output of `df -l' (or 'ls /Volumes', if you like) for it to check if it is mounted.
To unmount it use `hdiutil detach /Volumes/iPod' (assuming it's name is actually 'iPod') or it's device name (e.g. /dev/disk2)
I'll let you work out the script
|
Just who are Britain? What do they? Who is them? And why?
Formerly Black Book
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Mar 2004
Status:
Offline
|
|
sweet, thanks a lot!
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Mar 2004
Status:
Offline
|
|
okay, so this doesn't work...
Code:
hdiutil: detach failed - No such file or directory
when I
my iPod shows up just fine (it's name is Apollo). I find it interesting that using the tab key to auto complete will work just fine when typing in the command...
perhaps I have to use the device name. How would I go about finding this?
EDIT: Nevermind, found it with df -l
using hdiutil detach with /dev/disk2s3 (as it is in this case) works great. Thanks again!
Guess this post has turned into most a "for future people referencing this thread, using /Volumes/iPodName doesn't work" post
(
Last edited by Turnpike; Feb 11, 2005 at 06:35 PM.
)
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status:
Offline
|
|
Well I must say I'm surprised that using /Volumes/name didn't work. However, after reading the man page, it was most definitely an error on my part.
Sorry. I'll look into things more thoroughly in the future
|
Just who are Britain? What do they? Who is them? And why?
Formerly Black Book
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Mar 2004
Status:
Offline
|
|
hah, no worries, you told me exactly what I needed to hear
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status:
Offline
|
|
Originally posted by Turnpike:
okay, so this doesn't work...
Code:
hdiutil: detach failed - No such file or directory
when I
my iPod shows up just fine (it's name is Apollo). I find it interesting that using the tab key to auto complete will work just fine when typing in the command...
perhaps I have to use the device name. How would I go about finding this?
EDIT: Nevermind, found it with df -l
using hdiutil detach with /dev/disk2s3 (as it is in this case) works great. Thanks again!
Guess this post has turned into most a "for future people referencing this thread, using /Volumes/iPodName doesn't work" post
Keep in mind that the disk number is not static. You may want to do something like
hdiutil detach `df | awk '/\/Volumes\/iPod/ {print $1}'`
(I've been reading up on sed and awk... spiffy stuff. )
|
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Mar 2004
Status:
Offline
|
|
I actually do that in my script, but thanks! (actually, I'm using cut instead of awk... but I should be using awk, probably. looks cooler that way, at least)
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: May 2004
Status:
Offline
|
|
i like 'diskutil eject' better. you can use the mount point rather than the device name.
Code:
diskutil eject /Volumes/ipod
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|