disk3, its /dev entry) as well as to mount said now-unlocked disk. Last, it again uses diskutil both to determine the disk’s device name (e.g. The -w flag sends the password to STDOUT, which is chained with diskutil and the -stdinpassphrase flag to unlock the encrypted volume. Next, it looks for an associated disk password by using /usr/bin/security, which is OS X’s way of interacting with the keychain (among other things). It only proceeds if this UUID is found, meaning Elrond is attached and powered up. Sed -n 1p | awk '' ` diskutil mount $DISKįirst, it uses /usr/sbin/diskutil to get some info about Elrond in the form of its Core Storage UUID.
UUID = `diskutil coreStorage info Elrond | grep UUID: | \ You can grab it on the linked page, or, since it’s no longer the Stone Age, install it with Homebrew. SleepWatcher is a handy utility that runs as a daemon on your Mac, executing commands in ~/.sleep and ~/.wakeup scripts as appropriate, helping you automate these tasks.
But if I try to do this with a script, how could I safely access the password? I store this password in my OS X keychain, so that when I’m logged in and authenticated and the disk is plugged in, it mounts automatically. There seem to be more than a couple recommended ways to combat this, but the one suggesting using SleepWatcher seemed the simplest and most UNIX-y, and therefore, up my alley.Īnother problem, though: I want to remount the disk on wake when relevant, but my backup disk is encrypted with FileVault, so mounting it requires use of a password. However, now with the USB drive attached, this would cause an unsafe volume unmount, which probably was fairly harmless, but would still scold me once I’d wake the computer and was ready to work again. Then, I’d put the laptop in my bag and be off!
Previously, when I would head out of the house, I’d just unplug the three cables (power to cause sleep, then USB and display) from the side of the laptop. The only problem is, I work on a laptop that usually has its lid closed by way of using said external display along with a Bluetooth keyboard and trackpad. I’ve happily been using them on three machines for over a year now.) (By the way, I also use CrashPlan for offsite backup of all our data. This is probably a stopgap until I decide to redo my Time Capsule backup, but I wanted to get a bit of backup history under my belt before I wipe the old one. Owing to a recent corruption of my usual Time Capsule-based local network backup (which seems to be fairly common), a month or two ago I started backing things up to a local USB 3 drive attached to my Cinema Display. Safe handling of FileVault volumes with SleepWatcher Thu, Feb 5, 2015