Connect the external hard drive to your Mac, Right-click the external hard drive's icon shown on your Mac and select 'Get Info.' Click on the arrow beside 'Sharing & Permissions' to expand the section, then click on the lock to authenticate. Check the box beside 'Ignore ownership on. Most users use Disk Utility to erase a disk or hard drive. But some Mac users might need to erase them from the command line on Mac OS. To do that, the only thing you need is a bit of precise syntax to make sure that you are erasing the proper disk. Here I'll show you how you can erase and format a disk using the command line. Working with Terminal.
A script to eject and spin down external drives | 15 comments | Create New Account
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I tried to get this to work, but all it generates is a error that says it doesn't recognize the name of the drive ('LaCie HD').
Since you have a space in the name of your external volume, you'll either have to quote the name or escape the space character by preceding it with a backslash character.
--- -Bob --------------------- I tend to think of [Mac] OS X as Linux with QA and Taste. -James Gosling, Java Architect
:) this little script (re)mounts any unmounted volumes ! My external FW drives always spin down when unmounted. I can quickly and easily mount them again using the freeware 'Mount Me!' script. (See: http://www.versiontracker.com/dyn/moreinfo/macosx/15077.
(auto detected - so you dont have to set any volume name) 1. copy/paste the script (starting with #!/usr/bin/perl) to bbedit 2. save it as '/bin/mountall' (may need admin password) 3. type 'sudo chmod +x /bin/mountall' in the terminal 4. type 'rehash' in the terminal now you can use it with 'mountall' in the terminal for us who like to type instead of clicking ;) zeorge 040406 [code] #!/usr/bin/perl # mountall [zeorge 04-2004] @line_in = `disktool -l | grep volName`; foreach $line (@line_in) { $dev = extract($line,'Appeared (',''); $mp = extract($line,'Mountpoint = ',''); $vn = extract($line,'volName = ',''); if($mp eq ' && $vn ne ') { print 'mounting volume $vn ($dev) ... '; print `diskutil mount $dev`; } } sub extract { my $string = shift; my $start = shift; my $end = shift; my $pos = index($string,$start) + length($start); $string = substr($string,$pos); $pos = index($string,$end); return substr($string,0,$pos); } [/code]
---
simsamsep
This is a great little script! I had been using Disk Utility to mount / unmount my FW hard drive, but this method (like you said) does not keep the drive from spinning, sometimes for days between backups. I had resigned myself to the irritating plug/unplug method until now.. Thanks a lot!
I use this command to remount my external FireWire hard drive:
diskutil mount /dev/disk1
I have it aliased to 'fwmount'. I suspect that it would not work if you have multiple external drives, though.
-Mark
![]()
Is there a way to make the remount script work with an iPod?
Here's a perl script to mount and unmount by volume name
Mac Terminal Eject External Hard Drives
This script combines a couple of the great ideas above into one perl script that will mount and unmount a drive based on the that name that it appears as on the desktop (i.e. no /dev stuff). It also uses touch to write a file before unmounting.
Like the others, I use it to mount my firewire drive before doing a backup, and then I unmount it so it'll spin down. ---------- Usage: Mount a drive: hd -m driveName Unmount a drive: hd -u driveName ------------- To use this on your machine (just like the other perl example above) 1. Copy the text into a new text file called 'hd' 2. >chmod +x hd 3. Copy the file somewhere into your path 4. >rehash --------------------------------- Perl script starts at next line:<code> #!/usr/bin/perl use warnings; use strict; use Getopt::Std; our $OPTIONS = {}; getopts('mu',$OPTIONS); our $vol_name = $ARGV[0] || 'zbackup'; our $vol_regex = 'volNames*=s*'$vol_name'; our @entries = grep(/$vol_regex/o, `disktool -l`); if (! @entries) { die 'No such volume '$vol_name'; } elsif ($#entries > 0) { warn('More than one mountable partition matching $vol_name, mounting the first one.'); } if ($entries[0] =~ m|('([a-zA-Z0-9]+)'s*,s*Mountpoints*=s*'(.*?)'s*,s*fsTypes*=s*'(S*?)'|) { my $disk = $1; my $mount = $2; my $fs = $3; if ($OPTIONS->{u}) { if ($mount) { `touch $mount/.dummy`; `disktool -u $disk`; } } elsif (! $mount) { #if you pass no flags it'll also mount `disktool -m $disk`; } } else { die('Entry did not match expectations: $entries[0]'); } exit; __END__ </code> Apple External Hard Drive
This script apparently does not work if the external drive is partitioned.
Best External Hard Drive For Macbook Air
Need help to eject and mount partitioned firewire drives
I have an external firewire drive with two partitions. Normally I can eject or mount them from terminal like this:
-disktool -l ( this lists all their device numbers) -disktool -m disk2s10 disk2s9 (mounts both partitions) I want to use this shell script except for both devices but can't figure out the syntax to insert the space between the device numbers: do shell script 'disktool -m `disktool -l | grep 'Partition 1' | awk '{ print substr($0,20,7) }'` ' I need to stick this part after a space for the second device: `disktool -l | grep 'Partition 2' | awk '{ print substr($0,20,8) }'` Notice that I change the number of characters in the substring to 8 because I know the device number is disk2s10. (8 characters) I know that's poor form and would like to look for the ' in the string to know when I'm at the end of the device name but I'm not that good a programmer. Can someone who is help me out, or at least point me to a good UNIX reference place. Thanks --- When I die, I want to go peacefully in my sleep, like my Grandfather, not screaming in terror like his passengers.
A script to eject and spin down external drives: Modified
Macbook External Hard Drive
I modified the AppleScript to only grep for volName The result is that it now works for both volumes that have user defined mountpoints and Volumes that have spaces in there names.
Also there is only one thing you have to edit . And there are now error messages. ########################################### ########################################### ![]()
A script to eject and spin down external drives: Modified
External Drive For Macbook
Is there any way to spin down external firewire drives that are partitioned? The scripts I see all require single volume names...
Any way to make this work with partitioned drives? I usually unplug the thing to make it shut-up, but it'd be nicer if it just spun-down.
Same problem here...
I just copy pasted the string and that way I can make it un and remount both volumes, but it won't actually spin down. Seagate External Hard Drive Mac
For anyone referring back to this Hint, disktool is deprecated in Tiger.
--- Mark Moorcroft ELORET Corp. - NASA/Ames RC Sys. Admin. Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |