Important structures of a HFS Plus volume:
BOOT BLOCKS Sectors 0 and 1 of the volume are found here.
VOLUME HEADER is founder at sector 2, . The Volume Header stores the size of allocation blocks, a timestamp for volume creation , the location of other volume structures such as the Catalog File or Extent Overflow File.
ALLOCATION FILE which keeps track of which allocation blocks are free and which are in use. It is similar to the Volume Bitmap in HFS, in which each allocation block is represented by one bit. A zero means the block is free and a one means the block is in use. The Allocation File is stored as a regular file and can change size and and is stored contiguously within a volume.
CATALOG FILE is a B-tree that contains records for all the files and directories stored in the volume.
EXTENTS OVERFLOW FILE is another B-tree that records the allocation blocks that are allocated to each file as extents.
ATTRIBUTES FILE is a new B-tree in HFS Plus . The Attributes File can store three different types of 4 KB records: Inline Data Attribute records, Fork Data Attribute records and Extension Attribute records. Inline Data Attribute records store small attributes that can fit within the record itself. Fork Data Attribute records contain references to a maximum of eight extents that can hold larger attributes.
STARTUP FILE is designed for non-Mac OS systems that lack HFS or HFS Plus support.
ALTERNATIVE VOLUME HEADER,
Use Disk Utility
Disk utility comes with the MAC OS and is the first tool we use to fix drive problems.
- To start with, click the disk utility.
- Then click “Continue”.
- Next select the disk which you would like to repair from the sidebar.
- Subsequently, click “First Aid”.
- After that, if the utility detect out that the selected disk is to die, you’ll recieve a message that you will not be able to repair it. Also, you will be suggested to back up your data and replace the disk.
- But if not receive any message, hit “Run” to finish the repair process.
Use “diskutil” Command on Terminal
Provided that the disk utility fails, you can use this way – use “diskutil” command, trying to fix the disk issues from terminal. Follow the steps below:
- In the first place, open Applications folder > Utilities folder.
- Then launch the Terminal application.
- Next type “diskutil verifyVolume/[drive identifier]” and press “Return”.
- Subsequently, there will be two kinds of messages:
- No errors: It means the disk has no issues, so repair is unnecessary.
- Your Mac drive is corrupt and needs to be repaired: It means you should continue to repair the disk.
- If you receive the second message, you should input “diskutil repairvolume /[drive identifier]” to start repairing the disk.
3. Use FSCK (file system consistency check)
This is the tool used with Unix at the command line. FSCK means (file system consistency check).
- Boot in Single User Mode using “Command + S” key buttons
- Next, after the single user boot sequence complete successfully, you will see a small command prompt.
- At that point, you need to input the “fsck – fy”.
- After it finishes, if you see a message – “File system was modified”, re-run the “fsck – fy”.
- Another message will show up – “The volume (name) appears to be OK”
- After that, you need to type “reboot” to leave the single user mode.
- Later boot your Mac into Mac OS.
- Recheck in Disk Utility
Use Disk Warrior
DiskWarrior is one of my goto tools when performing data recovery on mac computers .Disk Warrior prevents data loss by creating an error-free version of the damaged data and comparing it with the original data to verify its integrity.
DiskWarrior has a 9 stage process rebuilding the file system . Unlike other utilities that attempt to repair problems in the existing directory, DiskWarrior creates a completely new directory