How to verify and repair the hard disk in OS X

 DiskUtilityIconX     


       Disk maintenance ard is one of several routine maintenance routine which I recommend people do to their Mac. Format your hard drive is the structure used by the system to store and retrieve any file that is saved to the drive. On most systems, Mac boot drive will use Apple Mac OS Extended (HFS +) Format filesystem, which is a collection of quick-access "B-tree" databases which store where the files located on your drive, logical hierarchical organization, and attributes such as file ownership and access permissions.

      If the damage occurred on the structure of your filesystem, then data access problems may occur, causing slowdowns, hang, or crash. In more severe cases, the filesystem corruption can lead to data corruption that constantly, which means that data written to the drive could be irrecoverably damaged.

       In many cases, the filesystem corruption can begin as a small problem, but then grow as additional damage occurs or perpetuate corruption of the original. Therefore, it is best to regularly ensure the filesystem on your Mac is healthy, especially if you ever lose power or be forced to restart your Mac.

      For the routines below, keep in mind that you can only verify the boot volume, and will not be able to fix it. To do this, you must boot into Recovery Mode () or another partition besides your boot volume.

Disk Utility 

The first option is to check the hard drive Apple's Disk Utility Program, whichis located in the applications folder > Utility. To use it, follow these steps:

  1. Open Disk Utility
  2. Select the drives that you want in the sidebar
  3. Go to the "first aid" tab (should be default)
  4. Click Verify Disk
Note that in step 2 above, you can select multiple drive (or all of them) to verify or correct all at once. To do this, hold down Command to add or remove additional drives for selection by clicking on them, or pressCommand-A to select all drives in the list.


Terminal 

While Disk Utility is the most intuitive approach to examine your drive, you can also do it in the OS X Terminal using the command "diskutil" well, in the following manner: 

1 Open Terminal and run the following command: 

diskutil list 

At the output, the volume name in the name field, and then to be identified in the column identifiers (this will be something like "disk0" or "disk1" -Don't worry about the component identifier "s1" or "s2"). 

2 now run the following command using the appropriate identifier to check the drive partitioning scheme, replacing "DRIVEID" with which you specify on the command above: 

diskutil verifyDisk DRIVEID 

3 further, run the following command using the appropriate volume name specified above in the "VOLUMENAME" 

diskutil verifyVolume VOLUMENAME 

Note that if the volume name has a space in it, then you will need to wrap the name in quotes, or use the back-slash character to escape spaces, such as the following: 

diskutil verify volume "Macintosh HD" 
diskutil verify volume "Macintosh HD"

If the name of the volume you have strange characters in it (like emoji) which causes problems when typing in Terminal, then you can specify the volume by using the full identifier (using the "s1" or "s2" omitted above), or if you are trying to target the boot drive only, then you can use a slash to determine the root device: 
verifyVolume disk0s2 diskutil 
diskutil verifyVolume /

Single-User Mode 

In addition to the diskutil, OS X includes "fsck" command, which can check and repair your drive. This command is available if you boot into Singe-User OS X mode by pressing Command-S at startup. Difference when running this command is that you will need to specify the full path to the disk file (in the / dev directory), as the following example. 

sudo fsck_hfs-f / dev / disk0s2 
sudo sck_hfs fy-f / dev / disk0s2 

Prevent corruption 

Although with additional features such as journals, Apple HFS + filesystem is quite stable, can still be damaged in the event you experience a power outage, or be forced to restart your system (especially at boot-up, or when the disc is being read and written to the Active ). Therefore, to help prevent filesystem corruption, avoid holding the power button to force a restart of your system as much as possible. 


Category Article

2 Responses to “Data Recovery”

What's on Your Mind...

Powered by Blogger.