I wrote this AppleScript last night. Basically, this thread keeps getting resurrected by people with the same problem over and over, so I thought I'd make a script that goes through the troubleshooting and repair process.
Any bug reports or feedback would be welcome.
Sample log:
Any bug reports or feedback would be welcome.
Code:
--
-- Repair Disk Permissions 0.1.3
-- By Mikkel Paulson ([email address in app])
--
-- THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND. USE AT YOUR OWN RISK.
--
-- You should always have an up-to-date backup of all of your important files before scratching your
-- nose, let alone mucking around with disk permissions and such.
--
-- This script implements most of the suggestions from the ongoing thread "How do I unlock my
-- external hard drive?" https://forums.macrumors.com/threads/417647/ Specifically, it:
--
-- Tests all volumes for writability by saving a 0-byte invisible file ".permissions_test_file" to each
-- volume's root directory, then deleting it again.
-- Reports which volumes are writable and which are not.
-- Asks the user for permission to attempt to fix writing issues.
-- Prompts to correct permissions (to drwxrwxr-x root:admin) for HFS+ and JHFS+ volumes.
-- Gives the option to install MacFUSE and NTFS-3G for NTFS volumes.
-- Gives the option to format NTFS volumes to JHFS+, FAT32, or a manually-entered format.
-- Produces a log, including before & after ls -l listings of /Volumes.
--
-- This script has been tested on Mac OS X 10.4 PowerPC and 10.5 Intel computers.
--
-- Please post any questions or bug reports to:
-- https://forums.macrumors.com/threads/871557/
-- If the script is unable to solve your problem, the best place to go is back in the original thread:
-- https://forums.macrumors.com/threads/417647/
--
-- This script is hereby released into the public domain. Feel free to use it or its code for any purpose,
-- with or without attribution.
--
-- Changelog:
-- 0.1.0 - original release
-- 0.1.1 - fixed bug preventing the format process from working
-- 0.1.2 - now works with volumes with spaces in their names
-- 0.1.3 - now a universal binary
--
Sample log:
Code:
Original permissions:
total 24
drwxrwxr-x 8 mikkel staff 340 Feb 28 17:03 Kohlberg
drwxrwxrwx@ 1 root admin 8192 Feb 28 17:03 Miniluv
d--------- 15 root admin 578 Feb 28 17:03 Minipax
lrwxr-xr-x 1 root admin 1 Feb 27 07:39 Minitrue -> /
Kohlberg: writable
Miniluv: writable
Minipax: permission denied
Minitrue: writable
Minipax: currently formatted as Journaled HFS +
Minipax: permission repair attempted
Minipax: works now!
New permissions:
total 24
drwxrwxr-x 8 mikkel staff 340 Feb 28 17:04 Kohlberg
drwxrwxrwx@ 1 root admin 8192 Feb 28 17:04 Miniluv
drwxrwxr-x@ 15 root admin 578 Feb 28 17:04 Minipax
lrwxr-xr-x 1 root admin 1 Feb 27 07:39 Minitrue -> /
Code:
Original permissions:
total 8
drwxr-xr-x 1 mikkel mikkel 0 Apr 22 2009 Kohlberg
lrwxr-xr-x 1 root admin 1 Feb 3 01:36 The Creature -> /
drwxr-xr-x 38 mikkel mikkel 1248 Feb 28 17:33 mikkel
Kohlberg: permission denied
The Creature: writable
mikkel: writable
Kohlberg: currently formatted as NTFS
Kohlberg: reformatted to JHFS+
Kohlberg: works now!
New permissions:
total 8
drwxr-xr-x 4 mikkel mikkel 238 Feb 28 17:36 Kohlberg
lrwxr-xr-x 1 root admin 1 Feb 3 01:36 The Creature -> /
drwxr-xr-x 38 mikkel mikkel 1248 Feb 28 17:34 mikkel