0

System: macOS 10.14.6

Overview:

One of the HDD in the system was giving issues and I suspected the old disk was dying. I wanted to check for bad sectors on it. It uses the Mac OS Extended (Journaled) filesystem. So I started a scan of the disk with fsck_hfs:

bash-3.2# fsck_hfs -S -E /dev/disk0

But even after more than 12-13 hours overnight it had only scanned around 66% of the 1TB drive:

** /dev/rdisk0 (NO WRITE)  
Scanning entire disk for bad blocks  
Scanning offset 6615812001408 of 1000204886016 (66%)

and I had to interrupt it as the system was needed.

Doubts:

  1. Does FSCK mark the bad sectors as it scans for it (or does it do it only do this after the scan is complete?)

  2. If the first case is true, is there any option to resume scanning from the offset specified in the status message (i.e from block 6615812001408)?

  3. Is there any better system tools to scan disks for bad sectors which supports resume if the operation has to be interrupted?

1 Answer 1

0
  1. Does FSCK mark the bad sectors as it scans for it (or does it only do this after the scan is complete?)

---> No, bad sector on a drive is a sign of permanent damage to the drive. Unless you have reason to believe that your drive marked these sectors as bad incorrectly, you cannot "fix" them. It means that a part of your drive is damaged to the extent that it can no longer reliably be read from and/or written to.

  1. If the first case is true, is there any option to resume scanning from the offset specified in the status message (i.e from block 6615812001408)?

---->There is no way to resume as the program needs to know the complete state of the filesystem in order to be able to work. You could have typed ^Z to stop the program and later run fg to resume it or just leave it alone.

  1. Is there any better system tools to scan disks for bad sectors which support resumes if the operation has to be interrupted?

---->To check the physical condition of your disk it's best to install smartmontools

Sudo yum install smartmontools

Use the smartctl command to read out this status. For example to read all attributes from the first disk call

sudo smartctl --all /dev/sda

Hope this helps.

2
  • I know bad sectors cannot be fixed (unless they are logical and not physical). It doesn't make sense to me that fsck doesn't "mark" the physically bad sectors so that it can't be used. Are you sure about that?
    – sfxedit
    Apr 21, 2020 at 9:35
  • The operating system tracking bad disk blocks is so 1980s. That job has long since been assigned to the disk hardware/firmware. If the CPU sees a bad block on a HDD/SSD, and it does not fix itself on simply rewriting that block, then it means the disk's internal spare capacity for replacement of bad blocks is already used up, and that means the disk is already quite severely damaged. (I'm uncertain on my first PC HDD I got in 1992 or so, but I'm sure that the second PC I built in early 1996 already had the bad block management built into the HDD itself.)
    – telcoM
    Nov 22, 2021 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .