fsck_hfs and diskutil discrepancies

On my macbook pro (9,2) running 10.11.6, I've been diagnosing what I suspect is a large memory allocation leak. This has led me to booting into single-user and recovery modes, where (among other things) I've tried repairing the internal volume. The results appear contradictory when running either

fsck
fsck_hfs
diskutil

and I'd like help better understanding them. From both single-user and recovery, the results are the same.

`fsck -fy` has a clean exit. It's output is:

** /dev/rdisk1s1

** Root file system

Executing fsck_hfs (version hfs-305.10.1).

** Checking non-journaled HFS Plus Volume.

The volume name is OS X Base System

** Checking extents overflow file.

** Checking catalog file.

** Checking multi-linked files.

** Checking catalog hierarchy.

** Checking extended attributes file.

** Checking volume bitmap.

** Checking volume information.

** The volume OS X Base System appears to be OK.

But running

/sbin/fsck_hfs -y -Rc -d /dev/disk0s2

yields:

journal_replay(/dev/disk0s2) returned 16

** /dev/rdisk0s2 (NO WRITE)

Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.

Executing fsck_hfs (version hfs-305.10.1).

Block 467182910 is not an MDB or Volume Header

Non-empty journal: start = 20846592, end = 21187584

Journal replay simulation succeeded

** Checking Journaled HFS Plus volume.

The volume name is Untitled

** Checking extents overflow file.

** Checking catalog file.

** The volume Untitled was found corrupt and needs to be repaired.

volume type is pure HFS+

primary MDB is at block 0 0x00

alternate MDB is at block 0 0x00

primary VHB is at block 2 0x02

alternate VHB is at block 467182910 0x1bd8a53e

sector size = 512 0x200

VolumeObject flags = 0x03

total sectors for volume = 467182912 0x1bd8a540

total sectors for embedded volume = 0 0x00

CheckHFS returned 7, fsmodified = 0

And running

diskutil repairVolume /dev/disk0s2

yeilds:

Started file system repair on disk0s2

Verifying storage system

Checking volume

disk0s2: Scan for Volume Headers

disk0s2: Scan for Disk Labels

Logical Volume Group A6D225B7-51AE-4394-9B9E-677E30373A8E on 1 device

disk0s2: Scan for Metadata Volume

Logical Volume Group has a 24 MB Metadata Volume with double redundancy

Start scanning metadata for a valid checkpoint

Load and verify Segment Headers

Load and verify Checkpoint Payload

Load and verify Transaction Segment

Incorporate 0 newer non-checkpoint transactions

Load and verify Virtual Address Table

Load and verify Segment Usage Table

Load and verify Metadata Superblock

Load and verify Logical Volumes B-Trees

Logical Volume Group contains 1 Logical Volume

Load and verify 32FCE6EB-9E5B-4585-9A29-CC67E8E0022E

Load and verify FA2EC60C-F57C-458A-BA9B-537D1393DD14

Load and verify Freespace Summary

Load and verify Block Accounting

Load and verify Live Virtual Addresses

Newest transaction commit checkpoint is valid

Load and verify Segment Cleaning

The volume A6D225B7-51AE-4394-9B9E-677E30373A8E appears to be OK

Storage system check exit code is 0

Finished file system repair on disk0s2

And finally, running first-aid from the Disk Utility application (from both recovery mode and regular login) shows no errors with one exception. If I first do first-aid on the physical disk, and then first-aid on the logical volume, both check out OK. However, if I do first-aid on the logical volume first before the physical disk, it sometimes (not always!) returns "Unable to unmount volume for repair. Operation failed."


Can someone please explain the discrepancies to me here?


Message was edited by: ayiti2015 better formating

MacBook Pro (13-inch Mid 2012), OS X El Capitan (10.11.6), OWC Mercury Electra 6G 240gb SSD

Posted on Feb 16, 2018 11:14 AM

Reply

Similar questions

7 replies

Feb 16, 2018 11:57 AM in response to ayiti2015

look carefully at the Names of the Volumes you are checking, and the methods you are using to scan them.

you are showing checks of:

dev/rdisk1s1 -- MacOS base system -- this is a downloaded Installer volume. You are using fsck_hfs do do this, which ONLY scans HFS Volumes, not partition data structures.

dev/disk0s2 -- Untitled -- not really sure what that is, but unlikely to be what you wish to be scanning. perhaps a blank drive you just added? you are using fsck_hfs to do this, which ONLY scans HFS Volumes.

disk0s2 -- appears to be scanning the entire disk0 drive, not any Volume in particular, using diskutil repairdisk function.


These completely disparate results are caused by using different tools on a disparate assortment of Drives, Volumes, and partitions. I see no fundamental discrepancies here -- you asked for different answers from tools with different capabilities, and you got what you asked for.


I am reminded of the description of unix terminal tools as a box packed with VERY sharp special-purpose tools. Reaching in and picking some up without careful study will likely cut your fingers off.


What exactly are you trying to accomplish?

Feb 16, 2018 2:08 PM in response to Grant Bennet-Alder

The most thorough check of your boot drive can only be completed when you are not using the drive. But in the running system, you are always using it. There are two cases where you can do this. The simplest is to restart in Safe Mode. the kernel boots up, then checks the drive before finishing starting up the rest of MacOS.


The second is Recovery. In regular Recovery, the Recovery partition IS technically speaking in use, but Disk Utility will go ahead and check it anyway. In Internet Recovery, the disk is Not being used -- it does not even have to be present. The software creates a dozen RAM disks to use for its temporary files, and can check absolutely everything about the boot drive.


--------

As to your concern that a problem was reported, but when you re-booted to fix it, it was not detected:


Occasionally, a Minor problem with a Partition or Directory will get fixed the next time the drive is Mounted after a Restart. So a transitory report of a minor problem is not really remarkable. It seems to fix these minor problems automatically, without any additional intervention. The problem is not detected later because it has already been fixed.

Feb 16, 2018 5:47 PM in response to ayiti2015

"Unable to unmount volume for repair. Operation failed."

That message just says the disk is in use, so it cannot be repaired right now. It is not alarming in the slightest.


But in your initial posting, the third report it says it was fixed, doesn't it?


Disk Utility calls those exact lower level routines. If Disk Utility says the drive is OK, it is not because it is not checking, its because the problem did not show itself.


We worry when Disk Utility says, "Problems found, but Disk Utility cannot repair them. ERASE your drive and re-Install MacOS"


^--- Now THAT is something to worry about.


Do you have a Trusted backup? if you do, none of this should cause you to lose any sleep.

Mar 7, 2018 10:34 AM in response to ayiti2015

I don't have an answer, but a couple things that should help:


  1. The error "Unable to unmount volume for repair. Operation failed." should be easy to avoid. Just unmount the volume before trying to run first aid on the volume. ( To understand why you got it, do a little reading on why volumes won't unmount, and it should become clear. )
  2. Why would you expect similar results from running a command on rdisk1s1 that you get from running ones on disk0s2? That's what you've shown you've done. Do they refer to the same drive when booted in different modes?


(PS: I didn't notice the other answers when I posted mine.)

Feb 16, 2018 12:19 PM in response to Grant Bennet-Alder

"Untitled" is the name of my internal SSD, like /Volumes/Untitled/Users... or /Volumes/Untitled/Library... Here is the output of diskutil list:

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *240.1 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage Untitled 239.2 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

/dev/disk1 (internal, virtual):

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Untitled +238.8 GB disk1

Logical Volume on disk0s2

FA2EC60C-F57C-458A-BA9B-537D1393DD14

Unencrypted

I was trying to first-aid and repair the volumes, like I said. What has thrown me is the fact that `fsck_hfs` on /dev/disk0s2 said it was corrupt and needs repairs, yet I cannot seem to execute these repairs even though Disk Utility says everything checks out OK.

Feb 16, 2018 1:54 PM in response to ayiti2015

"Untitled" is a terrible name for the drive you use daily, because that is the default name that is created when Disk Utility does not know what else to call something. You should rename it to something more meaningful to you, or use the factory-default "Macintosh HD".


If you lose your drive entirely, Disk Utility might try to create something called Untitled out of the debris remaining. You will want to know when something like that is happening, and be able to use "Untitled" as a sign of deep trouble.

Feb 16, 2018 4:25 PM in response to Grant Bennet-Alder

I wish it were the case... When I run these commands and operations in both single-user and recovery, it returns the same as I originally posted. When I log back in to my user space, Disk Utility checks out OK. When I return to single-user and recovery, same behavior again. It's as though Disk Utility is like, "ok yeah whatever close enough for government work," but running the terminal commands is like, "woah wait a second, are you sure you want to issue the nuclear missile not-a-drill warning???" Hyperbole, but the point is that either Disk Utility is super lax, or that it's not catching what the term commands catch.


Also, is it true that the the warning of a "corrupt" header is as trifling a matter as you suggest?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

fsck_hfs and diskutil discrepancies

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.