Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

saldin

macrumors regular
Original poster
Jul 30, 2012
143
25
I have a couple USB spinning hard drives that I want to check to see if they're reliable, but I just cannot find any tools to perform this. I've searched the internet and the brew.sh list and came up completely empty.

I found a couple utilities that look like they'd do the job, but the sites seem to be either sketchy or completely abandoned, like Integrity (https://www.speedtools2.com/Integrity.html) or Scannerz (http://scsc-online.com/Scannerz.html) (yeah, that's http not https)

Does anyone know of a (preferably free) real and trusted tool to do a surface scan on Mac OS Sequoia? Thanks in advance.
 

saldin

macrumors regular
Original poster
Jul 30, 2012
143
25
Found an answer myself shortly after posting this.

The disks I have were formatted HFS+ because they were older, and thankfully the fsck_hfs command does include a "-S" parameter to perform a disk surface check, something that's apparently missing from the fsck, fsck_apfs, and fsck_msdos commands...

It did the job the way I expected. One disk took two hours to complete (500 GB in a USB3 enclosure):

admin@Mini ~ % sudo fsck_hfs -S -fn /dev/disk4s2
Password:
** /dev/rdisk4s2 (NO WRITE)
Scanning entire disk for bad blocks
Executing fsck_hfs (version hfs-672).
** Checking Journaled HFS Plus volume.
The volume name is ASMT 2015 Media
** Checking extents overflow file.
** Checking catalog file.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume ASMT 2015 Media appears to be OK.


The second disk will take longer as it's 2 TB over a USB2 connection.

After digging a bit more, the e2fsprogs package in Homebrew includes the badblocks command that will scan a disk's surface for problems. Haven't tried it yet, but I figure this one should work for disk with formats other than HFS (and even those) and cover the rest of the bases...

PS: The other disk took all night to finish (about 15 hours) and also reported no bad blocks, so I got just the answer I was looking for. I'll make a test later today with the badblocks command and report back.

PPS: I connected a USB hard drive, formatted it as APFS, FAT32, and HFS+, and had badblocks test each one. It worked perfectly. And it had the benefit of showing live progress bar, status report, and statistics, where fsck_hfs only shows a report in the end.
 
Last edited:

ChrisA

macrumors G5
Jan 5, 2006
12,917
2,169
Redondo Beach, California
I have a couple USB spinning hard drives that I want to check to see if they're reliable, but I just cannot find any tools to perform this. I've searched the internet and the brew.sh list and came up completely empty.

I found a couple utilities that look like they'd do the job, but the sites seem to be either sketchy or completely abandoned, like Integrity (https://www.speedtools2.com/Integrity.html) or Scannerz (http://scsc-online.com/Scannerz.html) (yeah, that's http not https)

Does anyone know of a (preferably free) real and trusted tool to do a surface scan on Mac OS Sequoia? Thanks in advance.
It looks like you found fsck_hfs. But your mac also has "disk utility" installed. This is a GUI front end for formatting and checking mounting and unmounting disks. If you select a disk and click "first aid" it will run fsck on that disk

I think the reason you can't find any app like this is because Apple already installs it on every Mac.
 

Nermal

Moderator
Staff member
Dec 7, 2002
21,005
4,582
New Zealand
As far as I'm aware - and I stand to be corrected - Disk Utility does not expose a surface-checking feature.
 

saldin

macrumors regular
Original poster
Jul 30, 2012
143
25
It looks like you found fsck_hfs. But your mac also has "disk utility" installed. This is a GUI front end for formatting and checking mounting and unmounting disks. If you select a disk and click "first aid" it will run fsck on that disk

I think the reason you can't find any app like this is because Apple already installs it on every Mac.
Disk Utility can run first aid to validate and repair filesystem problems, but it does not check the disk surface for bad blocks. I tried it.
 
Last edited:

ChrisA

macrumors G5
Jan 5, 2006
12,917
2,169
Redondo Beach, California
Disk Utility can run first aid to validate and repair filesystem problems, but it does not check the disk surface for bad blocks. I tried it.
To write over the entire drive, you would have to select "erase" and then have it write zeroes to the entire disk.

But even then, zero is a special pattern. Ideally, you want to write quite a lot of random data to the disk
 

bzgnyc2

macrumors 6502
Dec 8, 2023
383
408
Do modern drives, especially attached via USB, even allow for this?

As far as I know all disks since the IDE-era handle bad blocks internally. They will report bad blocks once they run out of capability to handle internally but that also means the disk is basically dead anyway. I wouldn't trust such a disk.

At this point I might use a surface scan or full write operation to force the disk to check every sector of the disk and consider it "not bad" if it doesn't report any bad blocks. Clicking, excessive seeking noise, lots of retries in the SMART counters, or extended read times even if they don't generate an error also signal to me a disk not long for this world.

The situation is similar with SSD except the details are different.
 

saldin

macrumors regular
Original poster
Jul 30, 2012
143
25
To write over the entire drive, you would have to select "erase" and then have it write zeroes to the entire disk.

But even then, zero is a special pattern. Ideally, you want to write quite a lot of random data to the disk
That's a completely different thing. I did say "surface check" not "erase"; and even if I did erase it, how am I going to find out about bad blocks unless I do a surface scan?
 

saldin

macrumors regular
Original poster
Jul 30, 2012
143
25
Do modern drives, especially attached via USB, even allow for this?
Why wouldn't they allow it? It's either sequential block reads, or (potentially destructive in case the disk is defective) read/rewrite/reread.
 

Basic75

macrumors 68020
May 17, 2011
2,095
2,446
Europe
Why wouldn't they allow it? It's either sequential block reads, or (potentially destructive in case the disk is defective) read/rewrite/reread.
Some older hard drive types allow e.g. for a "low level format" that would find bad sectors at a much lower level. I was thinking of something like that.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.