View Single Post
  #1  
Old 01-22-2007, 11:17 PM
zink zink is offline
Registered User
 
Join Date: Jan 2007
Location: Chicago
Posts: 3
Need help unmounting a single partition

Hello:

I'm a new user of SD!... purchased it last night, and already backed up my system (what more could you ask for out of an application like this!). As simple as it was to set up and perform scheduled backups, I have an issue that I know has been brought up in other threads, but I can't seem to find the answer to.

I have an external drive setup and broken down into 3 partitions. 2 of the partitions are used as backup destinations for my 2 internal drives (one drive is dedicated to one partition.) I've set up scheduled backups for these drives in SD!, and all is well... except one thing...scripting a single partition to unmount.

I've implemented the following script, which I snagged from a thread in this forum:

on beforeRunningCopy()
set targetDisk to "HD2Backup"
tell application "Finder"
if not (exists the disk targetDisk) then
try
do shell script "diskutil mount `disktool -l | grep '" & targetDisk & "' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`"
end try

repeat while not (exists the disk targetDisk)
delay 1
end repeat
end if
end tell
end beforeRunningCopy

on afterRunningCopy()
set targetDisk to "HD2Backup"
tell application "Finder"
if (exists the disk targetDisk) then
eject targetDisk
delay 2
end if
end tell
end afterRunningCopy


The script works in mounting the targetDisk with no problems.
But, as you can see, the script tells the mounted backup drive (HD2Backup) to "eject". Unfortunately, this doesn't just unmount the single partition. Rather, all partitions within the external drive are unmounted.

I'd like to set up a script to unmount an individual partition. I am extremely inexperienced with AppleScript, so I'm looking to you for help in achieving this function. I appreciate your attention to this...

Kind Regards,
BJ
Reply With Quote