PDA

View Full Version : Automount source volume


Jack Mac
11-22-2009, 10:30 PM
I just created a scheduled backup from one unmounted external drive to a 2nd unmounted ext drive, but it failed: "The automatic copy failed because SuperDuper! could not locate the source volume"

I've used SD for years to automount the target volume, but this is the first time I ever tried to automount the source volume - is there a way to do this?

I'm using 2.6.2.

Thanks.

dnanian
11-23-2009, 07:47 AM
The source volume cannot be automounted -- only the destination.

Jack Mac
11-23-2009, 01:12 PM
The source volume cannot be automounted -- only the destination.

Wow - thanks for the quick reply!

I assume I can get the job done by using the Advanced Options "Run shell script before copy starts", but I can't write a script and I haven't had much luck searching for a script I can use. Can you point me in the right direction?

Thanks

dnanian
11-23-2009, 01:30 PM
No, actually, you can't: those scripts run after the volume is mounted. You'll really want to keep the source volume mounted.

Jack Mac
11-25-2009, 12:50 AM
OK, so I'm getting closer, but I need more help.

I found a unix script that will automount and I created an AppleScript, and then set up an iCal alarm to run it just before the SD backups are scheduled. It works. This is the AppleScript:

do shell script "BDISK=`/usr/sbin/diskutil list | awk '$3==\"ARCHIVES\" {print $6}'`;/usr/sbin/diskutil mount $BDISK"

The thing I'm still struggling with is getting SD to unmount the volume after the copy. I used the unmount version of the same script in the "Run shell script after copy completes" but I got an error message. Here are the last three lines from the log:

| 12:19:21 AM | Info | ...ACTION: Running shell script Un-Mount ARCHIVES.scpt
| 12:19:21 AM | Info | ......COMMAND => Invoking After Copy shell script: /Users/~/Library/Scripts/Un-Mount ARCHIVES.scpt
| 12:19:21 AM | Error | sh: /Users/~/Library/Scripts/Un-Mount ARCHIVES.scpt: Permission denied

Any idea what I'm doing wrong? I thought the problem might be that the script I'm using has an AppleScript wrapper. If that's the case, I'm not sure how to create a standalone shell script. My limited scripting experience is all with AppleScript.

Thanks

dnanian
11-25-2009, 08:32 AM
Right. It's a shell script, not an apple script.

Since you can't eject a drive you're working with while you're working with it, perhaps it would be better to worst-case-estimate when this is done and eject with iCal?

Jack Mac
11-25-2009, 02:27 PM
I see what you mean about the problem with unmounting the source volume - SD will execute the shell script and unmount the source, but then it won't "finish" the backup (ie, unmount the destination, quit SD and sleep iMac).

Jack Mac
11-25-2009, 02:55 PM
OK, so I finally got this to work.

The final piece was to attach that unmount shell script to my other SD backup (clone of Mac HD) and to have that backup run last.

Thanks for all your help, and patience. It was fun learning more about SD and scripting.

Jack Mac
11-25-2009, 03:25 PM
This might help someone in the future, so for the record here is how I have my backup routine setup:

I have two external FW drives with several volumes each. I like to keep these volumes unmounted so that they don't interfere. SD will auto-mount and then auto-unmount destination drives [but not source drives].

I run two backups every night:
- a smart update clone of my Mac HD
- a smart update of a volume named ARCHIVES which contains files that I don't have room for on my Mac HD (mostly media, photos, keynotes, etc)

5:00a Energy Saver set to wake up iMac
5:01a iCal alarm set to mount the volume ARCHIVES using an AppleScript (this is necessary because ARCHIVES will be a source volume)
5:02a SD scheduled to start ARCHIVES backup
5:04a SD scheduled to start Mac HD clone

When the Mac HD clone is finished, it runs a shell script to unmount the ARCHIVES volume and then it sleeps the iMac.


Scripts used:

iCal alarm AppleScript:
do shell script "BDISK=`/usr/sbin/diskutil list | awk '$3==\"ARCHIVES\" {print $6}'`;/usr/sbin/diskutil mount $BDISK"

SD shell script:
#!/bin/bash

BDISK=`/usr/sbin/diskutil list | awk '$3=="ARCHIVES" {print $6}'`
/usr/sbin/diskutil unmount $BDISK > /dev/null

Here is where I got the scripts: http://www.leancrew.com/all-this/2009/10/superduper-scripts-redux/

sidewinder
12-11-2009, 06:25 PM
Jack Mac,

I do this a little bit differently than you do but my setup is different too.

I use SuperDuper! to backup my boot disk to another disk of the same size. I don't want this disk mounted until the backup process starts and I wanted it unmounted when the backup process is finished.

First, I had to figure out how I was going to make sure the drive was unmounted until the backup took place. How does one do this easily? I decided I would use launchd to unmount the drive at start up.

I also decided to use a simple one line command to do this using "diskutil" and the backup disks UUID. The disk UUID does not change like the disk name can or the disk identifier does from boot to boot. Once I retrieved the UUID for my backup disk from Disk Utility, this simple command will unmount the backup disk:

/usr/sbin/diskutil eject 'EC408ECE-39F2-3A39-B628-E6575F2C422E'

I used Lingon (http://sourceforge.net/projects/lingon/files/) to make a "Users Daemon" to unmount the backup disk using that command.

First part of the problem solved.

SuperDuper! takes care of mounting the disk when the scheduled copy starts so that was easy.

The last issue was unmounting the disk when the backup was done. Again, SuperDuper! makes that easy too. I just have it run a script file with the command above in it.

That's all I needed.

For you, instead of using iCal and AppleScript, I would use Lingon to create a "Users Daemon" to mount the drive at a particular time each day just before the time you kick off the scheduled backup. Here is the mount command using the UUID:

/usr/sbin/diskutil mount 'EC408ECE-39F2-3A39-B628-E6575F2C422E'

Obviously the UUID would be different in your case.

S-