1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Formatting vs zero-filling

Discussion in 'Storage' started by Dreieck, Feb 17, 2017.

  1. Dreieck

    Dreieck

    Joined:
    Jan 5, 2014
    Messages:
    8 (0.01/day)
    Thanks Received:
    0
    Hello

    I'd like to have a question to a hdd whizz. I can often read that zero-filling is good for slow and bad sectors (not physical bad sectors that can not be repaired). I can't understand why zero-filling is better than just formatting when it comes to dealing with bad sectors.

    My chain of thoughts:
    After formatting OS sees a disk/partition as free space, free to use. If there were some bad sectors before, logical problems, new data will be written to that space/disk/partition because that space is blank for OS. So why zero-filling would be better when it comes to dealing with bad sectors? Why is this better than just formatting?

    Thx
     
  2. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    20,381 (6.30/day)
    Thanks Received:
    9,509
    Location:
    IA, USA
    Bad sectors are unusable so they can't be written to. Whatever data is there is what remains when the sectors were marked bad.

    I think you're actually talking about three things here:
    -Quick Format: writes a new file system to the drive. All data that isn't overwritten still exists but can't easily be accessed.
    -Full Format: Writes a new file system to the drive and also attempts to access all sectors on the drive to verify they're good. Data generally doesn't survive this process but could.
    -Erase: ignores the file system and writes data to all sectors for the purpose of destroying existing data. If the drive is to be used again, it needs to be formatted.

    If you want to destroy data and mark bad sectors, do an erase then full format.

    In relation to bad sectors, quick and full format "deal with" them the same. The difference is in whether all bad sectors are found before the drive is put in service or if they are found while the drive is in service.
     
    phanbuey says thanks.
    Crunching for Team TPU
  3. r9

    r9

    Joined:
    Jul 28, 2008
    Messages:
    2,494 (0.75/day)
    Thanks Received:
    496
    Bad sector is just part of the disk that lost the magnetic properties to store data.
    Every platter drive has spare dedicated space for relocating bad sectors.
    Every time hdd S.M.A.R.T detects bad sector, marks the sector and relocates it to the spare.
    As long there is free spare space this bad sectors not gonna be an issue and they can't be detected with application.
    Real bad sectors appear after the spare space is used up.
    What apps like hdd regenerator do is re-check the marked sectors for the sectors that might be still used, that are still usable or were falsely marked.
    Also they try multiple to wright 0/1 multiple times and check if it can store it.
    What I've done in the past is if the bad sectors are on the beginning of the disk I would partition the disk in a way that I leave that space as unpartitioned.
    I would not use that drive for storing important data.
    My advice to you is once they start appearing its time to back up and move on.

     
  4. Dreieck

    Dreieck

    Joined:
    Jan 5, 2014
    Messages:
    8 (0.01/day)
    Thanks Received:
    0
    Thanks for additional info. But what I am curious about is:
    1. Does it make sense to do zerofilling when there are bad sectors or slow sectors (>500ms) on disk?

    OK; but it is possible that there are bad sectors not yet detected by SMART system.
    2. What does software like mhdd or hdd regenerator do when they find a bad sector during scanning. What is the procedure?
     
  5. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    20,381 (6.30/day)
    Thanks Received:
    9,509
    Location:
    IA, USA
    1. Yes if the purpose is erasing it. No otherwise. Erasing software will find bad sectors in the process of erasing and notify the user. The user can ignore those sectors or, the best solution, is to stop the erase and physically shred the drive.

    2. They mark the file system (e.g. NTFS) to not use those sectors.
     
    Crunching for Team TPU
  6. Dreieck

    Dreieck

    Joined:
    Jan 5, 2014
    Messages:
    8 (0.01/day)
    Thanks Received:
    0
    Ad2. but scanning for bad sectors is also possible when there is no file system (parition not formated / no partition tabe etc.).
     
  7. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    20,381 (6.30/day)
    Thanks Received:
    9,509
    Location:
    IA, USA
    In which case, it is doing what @r9 said and marking the sectors bad in the device itself.
     
    Crunching for Team TPU
  8. r9

    r9

    Joined:
    Jul 28, 2008
    Messages:
    2,494 (0.75/day)
    Thanks Received:
    496
    I would assume there is error correction when reading data once it goes above set threshold it get marked as bad and relocated.

    Apps like hdd regenerator do what smart does but trying to recover some of the sectors that are not as bad, and its not depended on the hdd have file system or not.
    Apps like check disk mark the bad sectors in the partition table. So if you scan and "repair" and then format the drive the bad sectors will became available again.
    To prolong the life
    1. scan and repair with hdd regenerator.
    2. leave the affected area as unpartitioned space.
     
  9. Dreieck

    Dreieck

    Joined:
    Jan 5, 2014
    Messages:
    8 (0.01/day)
    Thanks Received:
    0
    Sorry for keeping asking, but formatting does not affect partition table. So if the information about bad sectors chkdsk keeps in partition table formatting will not affect them (will not affect info on where bad sectors are). Right?
     
  10. r9

    r9

    Joined:
    Jul 28, 2008
    Messages:
    2,494 (0.75/day)
    Thanks Received:
    496
    Formatting re-wrights the partition table so the bad sectors will not be marked as bad.
    So the data that gets saved on that space will get corrupt.
     
  11. Static~Charge

    Static~Charge

    Joined:
    Nov 2, 2008
    Messages:
    723 (0.22/day)
    Thanks Received:
    384
    Uh, no. If a bad sector has already been locked-out by the drive, then formatting the drive will not put that sector back into use. The drive will not let the file system access known bad sectors.

    If a bad sector has not been locked out by the drive, then formatting the drive may not detect it. That would leave it in use and could result in corrupted data.

    The idea behind zero-filling the sectors is two fold. First, it overwrites any data in the sectors. Second, if a sector is bad but not already locked out, then attempting to write zeros to it should bring the bad sector to the drive's attention, and it will be locked out then.
     
  12. xorbe

    Joined:
    Feb 14, 2012
    Messages:
    1,571 (0.78/day)
    Thanks Received:
    533
    If the HDD knows about a bad sector, when it is written again, it is remapped. Quick formatting doesn't write all the sectors. The sectors are not "locked out", they are remapped, until the remap table is full, then the drive "fails".
     
  13. r9

    r9

    Joined:
    Jul 28, 2008
    Messages:
    2,494 (0.75/day)
    Thanks Received:
    496
    I was referring to sectors that being mapped as bad by the apps like chkdsk not the drive it self.
    I already said that drive mapped bad sectors can't be detected by diagnostic app.
    You can read the SMART status but thats different.
     
  14. r9

    r9

    Joined:
    Jul 28, 2008
    Messages:
    2,494 (0.75/day)
    Thanks Received:
    496
    I will quite myself on this one.
     
  15. xorbe

    Joined:
    Feb 14, 2012
    Messages:
    1,571 (0.78/day)
    Thanks Received:
    533
    That relocation happens when the sector is written, afaik.
     
  16. NviGate Systems New Member

    Joined:
    Oct 24, 2015
    Messages:
    7 (0.01/day)
    Thanks Received:
    4
    The SATA specification only allows a sector to be re-mapped once the drive is told to write data to a sector. The reason for this is that if valuable information is held in that sector, there is still a chance ECC can recover the data.

    There are utilities which read the data, then write it to a different sector, then force writing data to the bad sector, making the controller disable that bad spot.

    If you have a drive that is slow with weak sectors (bad sectors that are pending re-map) then a full format (not quick format) will force the drive to remap those sectors because by writing to the drive, you in essence telling the drive: "I am writing to this area so I obviously no longer need whatever data is there", in which case the drive marks the area(s) as bad and never uses them again.

    I've seen drives with pending sectors (anywhere from 6 to 32) after a full format to have thousands of pending sectors. So my best advice is to backup all data, do a full format of the disk then look at the SMART values again. If it remapped those sectors and no further sectors were found bad, then it likely was just an area that went bad. If suddenly more sectors start going pending, that tells you the drive is on it's way out.
     
    xorbe says thanks.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)