X

Using the -n option to prevent disk corruption in Mac OS X

Using the -n option to prevent disk corruption in Mac OS X

CNET staff

After using the "fsck" Terminal command in single-user mode to repair system damage, restarting the computer causes Mac OS X's memory buffers to refresh by default, modifying the changes made by "fsck" and potentially causing disk corruption.

Although Apple makes no mention of it in their documentation, you can avoid the memory buffer flush by invoking the "n option," which bypasses the normal synchronization process that occurs along with normal system shutdown or resets. Type the following the Terminal after running "fsck."

shutdown -n now

in the terminal after running fsck. Alternatively, you can type

reboot -n

to restart the system.

One MacFixIt reader points to an UNIX SysAdmin book, referring to BSD filesystems:

"The -n option is very important. It prevents the sync command from being run, which flushes the output buffers and might very well re-corrupt the filesystem. This is the only time rebooting should occur without syncing the disks."

In knowledge base article #10621, Apple says that using Disk Utility while started up from CD or DVD eliminates the need to use fsck, but there are situations in which fsck may be necessary; such as when your Mac OS X CD or DVD is not immediately available or your CD-ROM drive is not immediately available.

Feedback? Drop us a line at late-breakers@macfixit.com.

Resources

  • #10621
  • late-breakers@macfixit.com
  • More from Late-Breakers