Home > Articles

This chapter is from the book

Disk Utility

In Panther, Apple has combined its two disk-related utilities—Disk Copy and Disk Utility—into a single application (still named Disk Utility). Disk Utility (path: /Applications/Utilities/Disk Utility) can still be used to create disk images and repair volumes, and has gained a few additional features as well. To discuss Disk Utility, we'll approach it from two sides: the disk imaging aspect and disk repair features.

Disk Operations

Disk Utility combines disk repair with disk formatting and partitioning. As with Mac OS 9, you cannot use either of these functions on your startup partition. If you only intend to work with a secondary disk or partition, launch Disk Utility from the Finder. To use Disk Utility to work on your primary disk, follow these steps:

  1. Insert your Mac OS X Install CD into your computer.

  2. Start (or restart) your Macintosh while holding down the C key.

  3. Wait for the Installer to boot.

  4. Choose Open Disk Utility from the Installer application menu.

After launching Disk Utility, the application opens to display a list of your disk resources in a pane on the left side of the window, as shown in Figure 3.56. To the right of the disk list is the content pane, which displays controls for operating on the selected disk item.

Disks are listed with each of their partitions displayed. Grayed out partitions are system partitions that do not contain files that you can verify or repair.

When a disk is selected, up to five button bar selections appear in the content area: First Aid, Erase, Partition, RAID, and Restore. Each button opens a pane that performs a different function within the application, as you might guess from their names.

At the bottom of the Disk Utility window is a display of the details of the selected disk object. Although most of this information is self-explanatory, of interest is the S.M.A.R.T. (Self-Monitoring Analysis and Reporting Technology) status. A disk that supports S.M.A.R.T. can report potential problems before they occur, warning you of imminent drive failure.

Figure 3.56Figure 3.56 The left pane contains your disk resources; the right pane displays the operation you are performing on your disk.

TIP

To get more information about a disk or partition, select it in the list and then click the Info icon in the Disk Utility toolbar.

Choose the disk or partition that you want to work with and then click the tab to move to the appropriate pane. We'll start with the First Aid.

NOTE

The button bar changes depending on the object you've selected. If you choose a disk, for example, you see all the control areas. If you choose a partition, you do not see the partition controls because you can't very well partition a partition—nor can you apply RAID settings to a partition and so on.

First Aid

The First Aid pane, shown in Figure 3.57, can perform basic repair operations on a drive. It functions on UFS, HFS+, and HFS volumes—meaning that you can repair both types of Mac OS X partitions and both types of Mac OS 8/9 partitions. Unfortunately, Disk First Aid is not capable of repairing extensive disk damage, so third-party utilities such as Micromat's Drive 10 and TechTool Pro (http://www.micromat.com/) are still important parts of every software library. In addition to basic disk repair, the First Aid tools can also fix any file permissions that may accidentally have been changed while using your computer.

Figure 3.57Figure 3.57 Use Disk First Aid to repair damaged volumes.

To check or verify a disk, select the disk and partition from the volume list at the left of the window. Next, click the appropriate action button:

  • Verify Disk—Displays any errors found in your disk but does not attempt to repair them.

  • Repair Disk—Performs the same tests as Verify but automatically fixes any errors it might find. You can only repair volumes other than your boot disk.

  • Verify Disk Permissions—Check to make sure that your Mac OS X volume has the proper permissions set. If you're having trouble installing applications or deleting files, you may have a permissions problem.

  • Repair Disk Permissions—Repair any incorrectly assigned permissions. Permissions can only be repaired on your current boot disk.

  • Stop—Halts the current action (Verify or Repair).

If errors are found, they will be reported. Several things are checked during this process:

  • Extents overflow file—The Extents file keeps track of file information that could not be placed contiguously on a disk. As files become fragmented, the locations of the fragments are stored here.

  • Multilinked files—Files incorrectly linked to the same allocation blocks on the disk.

  • Catalog—Contains the information that forms the structure (files, folders) of the disk.

  • Bitmap—A binary picture of the disk, which records which blocks are allocated to files and which are free space.

If errors cannot be repaired, Disk Utility warns you that it is incapable of fixing your system. If this happens, try rerunning the repair—Disk First Aid often requires two passes to work correctly. If the repair does not work, Apple's suggested course of action is to back up the drive, erase it, and then restore your files. I'd recommend trying another disk repair tool before resorting to such desperate measures.

TIP

You can batch-repair multiple volumes by selecting several disks from the volume list. Just press Command and click the disks/partitions to add to the selection list.

NOTE

Volumes are repaired from the command line by using the fsck tool in single-user mode, as discussed in Chapter 32, "System Maintenance."

Apple also offers a command-line utility for mounting, unmounting, ejecting, and renaming disks: disktool. Learn more about the command line starting in Chapter 12, "Introducing the BSD Subsystem."

Erase

The next pane, Erase, does exactly what you would think it should: It erases drives and partitions. This is essentially a quick-and-dirty partitioning and initialization tool; it creates a single empty partition on the selected device and erases anything that was previously there. Figure 3.58 shows the Erase pane.

Use the Volume Format pop-up menu to choose between Journaled and non-Journaled Mac OS Extended partition types. Enabling Journaling does add a minor speed hit to the drive but helps protect your machine from data corruption if the system crashes or is otherwise interrupted.

TIP

You can enable journaling for a partition at any time by selecting it in the Disk/partition list and clicking the Enable Journaling button in the toolbar, or by using File, Enable Journaling (Command-J).

Journaling can be disabled by choosing Window, Customize Toolbar to add a Disable Journaling button to the toolbar and then applying it to a disk/partition, or by choosing File, Disable Journaling (Command-J).

Figure 3.58Figure 3.58 The Erase pane is used to quickly erase volumes and create a single empty partition.

Next, enter a name for the new volume. This appears as your disk label on the desktop.

TIP

If you want to securely erase the volume, click the Options button to force Disk Utility to zero all data on the drive and write random data over the drive eight times.

See Chapter 2 for more information on why multiple writes are required for a secure erasure.

Finally, click Erase to remove all existing information from the device and install the selected filesystem.

Partition

To create a more complex drive layout, use the Partition pane. Shown in Figure 3.59, this is the control center for working with your drive. Be warned—changes here will erase any information on the target drive!

The Volume Scheme section of the Partition pane contains a visual representation of the partitions on the system. Each box is a partition. The highlighted box is the active partition.

You can change a partition's size by dragging the dividers between the partitions up and down to shrink or grow the available space. As you drag the bar, the size field on the right portion of the pane changes to show the current settings.

Figure 3.59Figure 3.59 Partitioning your drive erases any existing information.

In addition to working with the visual view of the partition, you can use the various pop-up menus, fields, and buttons to set other parameters:

  • Scheme—Quickly divides your drive into 1–8 equally sized partitions.

  • Name—Sets the name of the highlighted partition.

  • Format—Sets the highlighted partition to be either HFS, HFS+, HFS+ Journaled, UFS, or free space.

  • Size—Manually enter a new size for the selected partition.

  • Locked for Editing—When checked, the Locked for Editing setting freezes the current partition's settings. You can continue to work with other partitions but not one that is locked. Clicking the lock icon in the visual view of the partitions also toggles the lock.

  • Install Mac OS 9 Disk Drivers—If this option is unchecked, the device is not usable on Mac OS 9.

  • Split—Splits the current partition into two equally sized partitions.

  • Delete—Removes the active partition.

  • Revert—Returns the partition map to its original state.

  • Partition—Commits the partition table design to the drive. This destroys all current data on the device.

Clicking the Partition button is the final step to designing your volume's layout. After you click the Partition button, you are prompted with a final confirmation, and then the changes are written to the disk.

RAID

RAID, or Redundant Array of Independent Disks, is a collection of multiple drives that function together as a single drive. By using drives performing in parallel, the computer can write and read information from the RAID set at a much higher rate than a single drive. Four common types of RAID are available:

  • Level 0 – Disk striping—This increases I/O speed by reading and writing to multiple drives simultaneously. It offers no fault tolerance.

  • Level 1 – Disk mirroring—Creates a fault-tolerant system by creating an exact mirror of one drive on another drive.

  • Level 3 – Disk striping with error correction—This RAID type uses three drives: two operating identically to level 0, and a third containing error correction information for fault tolerance.

  • Level 5 – Striped data and error correction—RAID level 5 offers the best balance between performance and fault tolerance.

Unfortunately, Panther only supports Level 0 and Level 1 in software.

RAID capabilities are easy to configure if you have multiple drives within a machine.

To set up a RAID set, drag the icons of the drives to add to a set from the volume list to the RAID pane's disk listing. Using the RAID scheme, choose what type of RAID support is enabled for the disks and provide a name for the resulting virtual drive that represents the combination of devices.

Finally, choose a volume format for the RAID set—this is identical to choosing a format for any volume—and click the Create button to generate the RAID set.

The new volume will be mounted on the desktop.

NOTE

If a drive in a RAID set ever becomes corrupted, this is reported in Disk Utility, and you are given the option of rebuilding the drive set.

Restore

The Restore pane, shown in Figure 3.60, is a new feature in the Panther release of Disk Utility. Restore enables you to completely replace the contents of a disk with a disk image that you've created previously. The disk image can even be stored on a Web server for retrieving over the network. To use restore, you must first create a disk image (we're getting there, don't worry).

Figure 3.60Figure 3.60 Restore volumes from disk images.

After an image is created, click the Image button to select it, drag it to the Source field, or type in a URL that can be used to retrieve the image.

Next, drag a disk or partition to the Destination field. If you want to erase the destination before copying the image to the drive, click the Erase Destination check box.

Finally, click Restore to start the restoration process.

TIP

The Restore feature of Disk Utility uses a command-line tool called asr. Apple has provided excellent step-by-step instructions for using asr and disk images to clone computers for classroom/workplace environments.

Rather than repeat those here, use man asr from the command line and read the section entitled "HOW TO USE ASR." Read more about the command line starting in Chapter 12.

Additional Disk Operations

The toolbar contains options for unmounting/mounting volumes. After selecting a disk or partition from the list, you can choose to Mount (Option-Command-M), Unmount (Option-Command-U), or Eject (Command-E) the volume.

Disk Imaging

Disk images have become a common and convenient way to distribute software for Mac OS X. Rather than create an archived folder, developers write their applications to a virtual disk that is loaded into memory when used. This disk appears to the computer as a real disk and can be manipulated like any other disk. For the end user it is a simple way to work with new applications. A single disk image file can contain applications, support files, and any other data a program might need—and it never needs to be decompressed. In fact, many applications can actually run directly from disk images, without needing to be copied to your hard drive at all. Disk Utility even has built-in CD burning capabilities to make turning a disk image into a real CD a matter of a few clicks.

Adding Disk Images to the Interface

To work with an existing disk image, drag the image file into the disk list pane of Disk Utility or use Image, Open (Option-Command-O). It is added to an area below your standard hard disks and remains there until you drag it back out (even between executions of Disk Utility).

To mount an image you've added to Disk Utility, either double-click its name in the disk list pane, or select it and choose Open from the toolbar.

From this point, you can work with the disk image much like you would with any other disk in Disk Utility. You can verify it, repair it, repartition it, and so on.

Creating Disk Images

Disk Utility can create images as well as mount them. This is useful for creating an exact duplicate of software you don't want to lose, or for making a master image for distributing software over a network with asr.

There are three ways to generate an image: Copy an existing volume/partition; copy an existing folder; or create an empty image file, mount it, and then copy files to it.

To create an empty image file, choose Images, New, Blank Image. Figure 3.61 shows the disk image creation dialog box.

Figure 3.61Figure 3.61 Generate a new blank image; then copy files to it.

Fill in the Save As field as you normally would—this is the name of the image file, not the volume that is going to be created. Choose a size for the image from the Size pop-up menu. There are a variety of preset sizes for common media, such as Zip disks, CDs, and DVDs, and a Custom setting for arbitrary sizes.

Next, choose a volume format with the Format pop-up menu. You can choose between a read/write disk image, which occupies the exact amount of space you've set for the image, or a sparse image that grows to accommodate the files you add.

Finally, if you want to encrypt the disk image, choose AES-128 from the Encryption pop-up menu and then click Create. The new disk image is created and added to the Disk Utility disk pane immediately.

Creating an image from an existing drive is even easier. Highlight the partition you want to use; then choose Images, New, Image From Device where Device is the name of your selected partition.

You are prompted for the location to save the image. Using the Image Format pop-up menu, choose the type of image to create: read-only, read-write, compressed, or CD/DVD master. Apply encryption to the image file by choosing AES-128 from the Encryption pop-up menu. Click Save to copy an image of the device onto your hard drive.

TIP

Read-only images are a good way to distribute software because they do not allow any changes to be made to the image. This results in an image that cannot be modified or tainted and can always be assumed to be a working master copy.

The third way to create an image is to copy the contents of a folder or volume. This is the easiest means of building a disk image if you have all the files in a subfolder of your volume, or want to create an image of a mounted network share. It also results in a disk image that is unfragmented because it isn't based off a direct device copy.

Choose Images, New, Image from Folder; then use the Mac OS X file browser to pick the folder or volume that you want to use. As with the other two imaging methods, choose the image file and format when prompted, and click Save to create the disk image file.

Burning CDs

To burn a CD from within Disk Utility, you must have your CD writer connected and powered on. Select the Image you want to burn; then choose Images, Burn or click the Burn toolbar icon. If the image is suitable for CD burning, Disk Utility displays the dialog shown in Figure 3.62.

Click the disclosure pushbutton to choose the maximum speed you want to use during the burn process, along with whether you want to burn additional copies of the image, verify the burn, and eject or mount the disk after it has finished.

When you're satisfied with your settings, click the Burn button, and Disk Utility begins writing the CD.

Figure 3.62Figure 3.62 Insert a CD and click Burn.

Other Disk Image Operations

Using the Images menu, you can Verify disk images, Convert them to other formats (such as read/write to read-only), calculate checksums, and scan the image for restore. Scan the Image for Restore is a step required before using the image with the Restore feature of Disk Utility.

Disk Utility Menus

Although most options for Disk Utility are found in the toolbar or via controls in the various panes, two additional features are located in the File menu.

The first, File, Log, displays a log of the Disk Utility operation, including repairs, partitioning, and so on. The second—File, Fix OS 9 Permissions—can be used to solve permission problems that may cause OS 9 not to boot or function correctly. Choosing Fix OS 9 Permissions automatically fixes the permissions on the appropriate volume; you do not need to select a volume or partition first.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020