To edit comparisons on Mac vs. Windows wiki, you must be a contributor. Sign up today!

For help with editing comparisons on the Mac vs. Windows wiki, refer to our online help guides.

Disk Management

From Mac vs. Windows

Jump to: navigation, search

Contents

Overview

Both Mac OS X and Windows Vista provide utility software that performs Disk Management tasks. In OS X, disk management in OS X is done primarily through the "Disk Utility" program.

Disk Formatting/Initialization

Mac OS X

Formating and initializing disks is primarily done using the "Disk Utility" program. This program is capable of formatting partitions in HFS Plus, UFS, or FAT (MS-DOS) file systems, and can also be used to create, destroy, and repair RAID sets. Formating and initializing may also be performed from the Mac OS X command line with the diskutil and hdiutil commands.

Disk Utility can create disk images in the Mac OS X disk image format .dmg and the .cdr format (equivalent to .iso). Disk Utility also burns disk images, restores from them and can convert one format of disk image to another. Additional disk image commands include: Verify, Checksum, Resize, Change Password.

Formating of a disk is done via the "Erase" tab. In the Erase tab, for any selected volume. the user can choose the file system and name for the volume once it's erased. The "Security Options" button provides access to the "Secure Erase" feature in Disk Utility. This feature prevents recovery of erase data on by writing over the disk's data one or more times with ones or zeros. User's can select how many times to overwrite a drive's data based on how securely they wish to erase the data though higher levels of secure erasure can a long time to complete. The "Erase Free Space" button allows the user to only securely erase the free space on the disk leaving other data alone.

Erase tab in Disk Utility.
Erase tab in Disk Utility.

Windows Vista

Formatting in Windows Vista is taken care of by the Microsoft Management Console. MMC only supports NTFS, FAT and FAT32 for hard disks.

There is no support for disk image mounting or creation.

Disk Partitioning

Mac OS X

In Disk Utility, the "Partition" tab is where partitioning of disk is done. Here, users can select the number of partitions to create and then manual drag the boundaries of the partitions in map to whatever sizes they prefer. Users also will need to enter a volume name and select file system types for each partition before the partitioning can be completed.

Partion tab in Disk Utility.
Partion tab in Disk Utility.

Disk Utility in OS X 10.5 also includes the ability to create, resize, and delete disk partitions without erasing them, a feature known as live partitioning. Users can reduce the size of one partition while increasing the size of another and create new partitions from free space taken from an existing partition, all without the need to delete partitions or erase volumes.

Windows Vista

Disk Error Repair

Mac OS X

Disk Utility includes a basic disk repair function. The "First Aid" tab allows users to verify the file structure of the attached hard drive volumes. You can also verify the current boot drive, however, as Apple notes in their public knowledge base [2], doing so can sometimes yield false error messages. In addition to file system repair, users can repair disk permissions from this tab.

First Aid tab in Disk Utility.
First Aid tab in Disk Utility.

Mac Hard Drive Recovery - the Undelete tool suitable for most known file types.

Windows Vista

Vista includes the Check Disk utility for finding and resolving disk errors. It's can be accessed by accessing the properties for the drive you want to fix, then choosing the tools tab. You have the option of automatically fixing errors with the file system and an option to fix physical errors with the disk by trying to copy any bad cluster contents to known good cluster and marking the cluster as bad so vista will no longer use that cluster. If the file system cannot be changed due to files being locked, check disk will schedule so that it runs during the next system reboot to fix

Check Disk in Vista

There's also a command line version called chkdsk. It offers more options like only performing certain specific tests, display more information while fixing the hard drive, etc. For more information type chkdsk /? at a command prompt

Disk Defragmenting

To understand why defragmenting disks is important, one must understand why disks become fragmented in the first place. Hard drives are comprised of several different circular disks (platters), whereupon data is "written" using a magnetic head on a small actuator arm (there are actually several platters and heads, but that is beside the point). In order to seek out and read specific bits of data, the disk must spin (much like an old vinyl record, though at much greater speeds), and the actuator arm must move into the correct position over the surface of the platter. When a disk is initially formatted, data may be written in nice, neat contiguous blocks of data, and it is relatively trivial for the head to be moved into the correct position. However, when the data is deleted from the disks, certain blocks of data are made writable, and thus usable by the system for storing other kinds of data. As a result, data will often be broken into "non-contiguous" blocks, which are spread out all over the surface of the disk. Since hard drives rely on mechanical movement of the actuator arm, this increases the time taken to read the data by quite a bit, since the arm must move all across the disk platter in order to retrieve the data. Because of this effect, software needed to be written which would straight out this non-contiguous mess, and rearrange all of the blocks of data into nice contiguous sections, which can improve performance. Each platform, though, takes a different approach to the management of fragmentation and defragmentation.

Mac OS X

OS X takes a preventative approach to the management of fragmentation. A number of technologies built-in to OS X dramatically reduce the amount of fragmentation that will occur. To summarize Apple's own documentation (About disk optimization with Mac OS X):

  • OS X will avoid reusing space from deleted files as much as possible, to avoid prematurely filling small areas of recently-freed space.
  • Mac OS X 10.2 and later includes "delayed allocation" for Mac OS X Extended-formatted volumes. This allows a number of small allocations to be combined into a single large allocation in one area of the disk, thereby reducing the amount of fragmentation that can occur.
  • Fragmentation was often caused by continually appending data to existing files, especially with resource forks. With faster hard drives and better caching, as well as the new application packaging format, many applications simply rewrite the entire file each time. Mac OS X 10.3 Panther can also automatically defragment such slow-growing files. This process is sometimes known as "Hot-File-Adaptive-Clustering." (this method only works with files under 20 MB in size)
  • Aggressive read-ahead and write-behind caching means that minor fragmentation has less effect on perceived system performance.


In the event that a file (or files) are still fragmented, users can copy the file to a new location, delete the original, then copy the new version back to the original location. Certainly not the most user-friendly solution, but it works. The most common file that users may see this solution benefitting them is Microsoft Entourage's email database. Since this file is virtually always over 20MB OS X's, built-in defragmentation solutions will not defragment this file; and since Entourage writes to the file dozens or even hundreds of times in a day, it is not uncommon for this file to have hundreds or even thousands of fragments.

Windows Vista

Microsoft has traditionally included a defragmentation utility with their operating system. This bit of software will actually rearrange the blocks on the disk, so as to actually "defragment" the fragmented disk. This utility is called "Disk Defragmenter". By default, it is configured to automatically run behind the scenes on weekly basis. User's can adjust this schedule to be run daily or even monthly according to their own needs. Users can also run Disk Defragmenter manually by pressing "Defragment Now".

Disk Defragmenter in Windows Vista
Disk Defragmenter in Windows Vista

Disk Defragmenter defragments all the supported volumes connected to a computer. There is no way defragment a specific volume from the GUI. It will also skip file fragments that are larger than 64MB on NTFS formatted volumes.

For additional functionality and reporting, users will need to run the defrag.exe utility from the command line.

Types of options for defrag.exe:

1. Analyze volume fragmentation...

defrag c: -a -v
Running defrag.exe from Windows Vista's Command Prompt
Running defrag.exe from Windows Vista's Command Prompt

2. Defragment volume (skip 64MB fragments)...

defrag c: -v -r

3. Defragment volume (don't skip 64MB fragments)...

defrag c: -v -w

Replace "c:" with the specific drive letter to run Disk Defragmenter against.

Discuss | Show All Comparisons | Download PDF

Personal tools