An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#14053 - 02/04/11 11:07 AM Scripting Diskutil Repairvolume to run on it's own
ph8tel Offline


Registered: 02/03/11
Does anyone have an idea on how to do this? I would like to write a script that will reboot the computer after hours, run Repairvolume on the OS drive, copy the results onto a public folder and then reboot the system normally.

Is this even possible?

Normally I would do all this with a Linux usb thumb or the OS install disks, but this time it needs to be done through scripting.

Any ideas would be helpful, including: "That's just not possible mate."

Cheers,
ph8

Top
#14056 - 02/04/11 02:13 PM Re: Scripting Diskutil Repairvolume to run on it's own [Re: ph8tel]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
In most cases a volume has to be unmounted to repair it. I believe disk utility can do most repairs now live, but I still don't think I trust that completely. It still worries me seeing boot camp assistant live-repartition the boot drive. (which uses diskutility, which is the heavy lifter for Disk Utility)

Look up your options with diskutility in terminal.
_________________________
I work for the Department of Redundancy Department

Top
#14057 - 02/04/11 03:30 PM Re: Scripting Diskutil Repairvolume to run on it's own [Re: Virtual1]
dkmarsh Offline
Moderator

Registered: 08/04/09

Just to be picky, it's actually diskutil, which, judging by the title of the thread, ph8tel is already aware of: diskutil repairVolume device is the relevant command.

As long as you're not attempting to repair the boot volume, and assuming the volume in question can be unmounted, diskutil repairVolume unmounts it automatically, just like Disk Utility.
_________________________

dkmarsh • member, FineTunedMac Co-op Board of Directors

Top

Moderator:  alternaut, dianne, MacManiac