Speed up Disk Utility First Aid by running “fsck_hfs” with the “-c” option

disk-utilityfsckfsck-hfs

I ran Disk Utility’s First Aid on a portable hard disk I use for Time Machine, which took around 13 hours (with no repairs being needed). I was wondering whether there’s a way to speed that up. Disk Utility’s output shows that it ran fsck_hfs -fy -x /dev/rdisk3, and so it doesn’t use the -c option, which according to the command’s man page “can result in better performance”:

-c size Specify the size of the cache used by fsck_hfs internally.
       Bigger size can result in better performance but can result
       in deadlock when used with -l option.  Size can be speci-
       fied as a decimal, octal, or hexadecimal number.  If the
       number ends with a ``k'', ``m'', or ``g'', the number is
       multiplied by 1024 (1K), 1048576 (1M), or 1073741824 (1G),
       respectively.

I was wondering whether anyone has experience using the -c option. Does fsck_hfs not use a cache at all when the option is not used, or does it use a default size? How large would I need to set the cache size to see significant, or even just any, performance improvement? I assume this depends on the size of the disk; mine is 1TB with Disk Utility showing it contains around 15.500.000 files.

Best Answer

There are some sources saying you should set the cache size to maybe 1/2 of your installed memory.

This source says, that fsck_hfs is running a lot faster if you assign it 2200m cache (in this example for a 1TB drive):

http://hints.macworld.com/article.php?story=20110829063745320

I'm now going to experiment with that setting because my external 6TB time machine backup disk has fsck_hfs running since about 18 hours.