Formatting BIG drives in a few minutes, NOT HOURS

Wondered how you can doe a “quick format” on huge drives?

I have 16x 8TB drives, formatting each one takes ± 13 Hours.
Ths is when using the standard command.

If you look into the SG_FORMAT options, you’ll be surprised.

#: sdo sg_format --format --quick --ffmt=1 --size=512 /dev/sdh

–quick = disables the 15sec wait before a format.
–ffmt = Fast Format.

Fast Format Options:
0 = Default
1 = After Format, unwritten data read without error.

Example of the print out:
truenas_admin@truenas[~]$ sudo sg_format --format --quick --ffmt=1 --size=512 /dev/sdh

  • HGST H7280A520SUN8.0T PD51 peripheral_type: disk [0x0]*
  •  << supports protection information>>*
    
  •  Unit serial number: 001xxxxxANGV        R5xxxxxNGV*
    
  •  LU name: 500xxxx62xxx94c*
    

Mode Sense (block descriptor) data, prior to changes:

  • <<< longlba flag set (64 bit lba) >>>*
  • Number of blocks=15362376264 [0x393ab4248]*
  • Block size=512 [0x200]*

Format unit has started
FORMAT UNIT Complete

I hope this is the correct way of doing things. If not. I’ll have to buy myself a power stattion for the amount of juice this monster is pulling.

Nothing is crossing through RAM. Nothing leaves the drive’s internal firmware. A fast format just “prepares” the disk.

What does formatting a drive do? Creating a vdev/pool is instantaneous.

1 Like

Looks like that fast format option simply invalidates all the data. Any block not written to first, returns:

“unspecified logical block data” and complete without error

However, if the intent is to wipe the data, drives with secure erase might use that instead. Maybe not as fast, but more “secure”.

Of course, there are 2 main reasons to low level format a drive:

  1. Change the block size from something other than 512 or 4096, to 512 or 4096. Most commonly used to make hardware RAID drives work as standard drives, like with ZFS. This MUST take forever, (well, a really long time).
  2. “Fix” a drive that has too many failed blocks.

In the bad old days, I routinely formatted a SCSI drive that had read errors to refresh the low level format. If that did not work, then replace the drive.

I guess today it would be possible to “fix” a SATA or SAS drive with too many bad blocks, by low level formatting. And, if it still had too many bad blocks, perhaps reducing the size by 1GB. That would both restore spares and cover existing bad blocks. But, I don’t know if this is possible.

Thanks, @Arwen

haven’t done that in decades :wink:

Patrick

It occurs to me that most people don’t know about HDD sector headers and trailers, and those could be the ones to fail during a bad block incident. And why a low level format could “fix” the problem.

The way HDDs work, is to have this for each sector:

  • Sector header, written once during low level format
  • Tiny buffer space, (for head to switch from read to write, if writing)
  • Sector data
  • Sector ECC data
  • Tiny buffer space, (for head to switch off writing, if writing)
  • Sector trailer, written once during low level format

What happens during an actual write, is the HDD controller reads the appropriate disk head, awaiting until the sector header comes around. Then immediately after, writes the sector data and associated ECC data.

Over time, the sector header or trailer can become demagnetized due to being read all the time. And not being refreshed ever. Thus, on a read, the HDD controller may not be able to find the sector header, causing the data to be lost.

It is possible that current HDDs have changed the low level format, to write the sector header as part of the sector. Thus, writing any sector after the trailer of the prior sector. That would make more sense today, and reduce the overhead slightly.


Looking at the list of items for each sector, you can see why a 4KB sector is more efficient than a 512 byte sector. There is reduced overhead for sector headers, buffer spaces, trailer, and combined ECC data.
3 Likes

Curiously, this reminds me of making a D-1541 floppy drive “sing” songs by virtue of how you abused the stepper motors therein.

Welcome to the Old Farts Club :beers:

2 Likes

Before you know it, we’ll get into how Bomb The Bass used tapes to mix Beat Dis.

I like the start…

I’m partial to Phantom of the Floppera myself:

3 Likes
1 Like

Can’t think of a much better use for that many floppy drives

I can.

Gee, responses went into the Twilight Zone real fast…

I guess old farts can go off on a tangent real quick, (which I guess includes me, since I remember where I was during the first moon landing. Don’t get me started on but “NASA fakes the moon landings!”)

1 Like
Agreed. That's just silly.

They only faked one moon landing. :smirk:

ozzy

1 Like

“But Kubrick was such a genius!” :laughing: