Are all storage devices divided into sectors?

I have read that a hard disk is divided into regions called sectors (a sector can be for example 512 bytes in size).

And that a file system will arrange groups of sectors into blocks (a block can consist for example of 8 sectors) and when Linux writes a file to the hard disk, it actually writes to these blocks and not to the sectors.

Now my question is, are all storage devices (for example: USB drive, CD, DVD, etc.) divided into sectors, or is it just hard disks?


Solution 1:

No. There are numerous storage devices that dont use sectors, such as punch cards.

Punch card

As you can see there are no sectors here.

No real reason to add this answer, other than I wanted to put a picture of a punch card. :)

Solution 2:

Are all storage devices divided into sectors?

No.
One of the oldest storage media is tape (magnetic, paper, mylar), and data is not written to tape in sectors.

Sectors are an intrinsic and salient property of hard disks.
Since most modern storage peripherals emulate a HDD at the ATA interface level (in order to gain faster acceptance by users), you as a user might think that these other peripherals actually have sectors also.
At the ATA interface, there certainly is the concept of a sector.

But NAND flash memory, which is the underlying storage device in SSDs, USB flash drives, and SD cards, is organized in pages and blocks, and do not have sectors.
Users might refer to NAND flash pages as "sectors", but the various NAND chip datasheets I've looked at (e.g. Micron, Numonyx) did not even contain the word "sector".
Of course there could be another NAND flash chip out there that does use the "sector" terminology for familiarity (like wikipedia).

From a Micron datasheet:

• Organization
– Page size x8: 2112 bytes (2048 + 64 bytes)
– Page size x16: 1056 words (1024 + 32 words)
– Block size: 64 pages (128K + 4K bytes)
– Device size: 1Gb: 1024 blocks

The NAND Flash memory array is programmed and read using page-based operations and is erased using block-based operations.

Solution 3:

Virtually all storage devices are divided into sectors.

Most are 512 bytes Some new large drives are 4096 CD-ROM are 2048

A few manufacturers have custom storage for specialty storage needs, but most do not. Most of these devices only have a few KB or a couple MB of storage meant for internal usage.

Even then the amount of work it takes to "make your own filesystem" is high enough that most just use someone else's file system. If they want to block the user from messing with it they encrypt it.

The "sector" is simply a way to divide up an amount of storage so the people writing file systems and other infrastructure have a common base to work with. Also the entirety of storage can't be loaded into ram all at once so it has to be sub-divided.

If sectors were allowed to be any size the people writing file systems would have to handle all possible values making there job that much harder. The harder it is the more room for human error and the greater the chance something goes horribly wrong and you lose your data.

Also optimizing for performance would also be much harder as people who choose exceptionally low number like 2 bytes would always have terrible performance.