encyclopegia.org

Block (data storage)

In computing (specifically data transmission and data storage), a block, sometimes called a physical record, is a sequence of bytes or bits, usually containing some whole number of records, having a fixed length; a block size. Data thus structured are said to be blocked. The process of putting data into blocks is called blocking, while deblocking is the process of extracting data from blocks. Blocked data is normally stored in a data buffer, and read or written a whole block at a time. Blocking reduces the overhead and speeds up the handling of the data stream. For some devices, such as magnetic tape and CKD disk devices, blocking reduces the amount of external storage required for the data. Blocking is almost universally employed when storing data to 9-track magnetic tape, NAND flash memory, and rotating media such as floppy disks, hard disks, and optical discs. Most file systems are based on a block device, which is a level of abstraction for the hardware responsible for storing and retrieving specified blocks of data, though the block size in file systems may be a multiple of the physical block size. This leads to space inefficiency due to internal fragmentation, since file lengths are often not integer multiples of block size, and thus the last block of a file may remain partially empty. This will create slack space.…

In computing (specifically data transmission and data storage), a block, sometimes called a physical record, is a sequence of bytes or bits, usually containing some whole number of records, having a fixed length; a block size. Data thus structured are said to be blocked. The process of putting data into blocks is called blocking, while deblocking is the process of extracting data from blocks. Blocked data is normally stored in a data buffer, and read or written a whole block at a time. Blocking reduces the overhead and speeds up the handling of the data stream. For some devices, such as magnetic tape and CKD disk devices, blocking reduces the amount of external storage required for the data. Blocking is almost universally employed when storing data to 9-track magnetic tape, NAND flash memory, and rotating media such as floppy disks, hard disks, and optical discs. Most file systems are based on a block device, which is a level of abstraction for the hardware responsible for storing and retrieving specified blocks of data, though the block size in file systems may be a multiple of the physical block size. This leads to space inefficiency due to internal fragmentation, since file lengths are often not integer multiples of block size, and thus the last block of a file may remain partially empty. This will create slack space. Some newer file systems, such as Btrfs and FreeBSD UFS2, attempt to solve this through techniques called block suballocation and tail merging. Other file systems such as ZFS support variable block sizes. Block storage is normally abstracted by a file system or database management system (DBMS) for use by applications and end users. The physical or logical volumes accessed via block I/O may be devices internal to a server, directly attached via SCSI or Fibre Channel, or distant devices accessed via a storage area network (SAN) using a protocol such as iSCSI, or AoE. DBMSes often use their own block I/O for improved performance and recoverability as compared to layering the DBMS on top of a file system. On Linux the default block size for most file systems is 4096 bytes. The command part of GNU Core Utilities can be used to check the block size. ==In languages== ===C++=== In C++, a block can be read using std::ifstream (input file stream). import std; using std::array; using std::byte; using std::ifstream; using std::ios; constexpr size_t BLOCK_SIZE = 4096; try { ifstream file("example.bin", ios::binary); file.exceptions(ios::failbit | ios::badbit); array buf; file.read(reinterpret_cast (buf.data()), BLOCK_SIZE); } catch (const ios::failure& e) { std::println(stderr, "I/O error: {}", e.what()); } ===C#=== In C#, a block can be read with the class. using System.IO; static const int BLOCK_SIZE = 4096; using (FileStream stream = File.Open("example.bin", FileMode.Open)) { byte[] block = new byte[BLOCK_SIZE]; await stream.ReadAsync(block, 0, BLOCK_SIZE); } ===Java=== In Java, a block can be read using java.io.FileInputStream . import java.io.FileInputStream; import java.io.IOException; static final int BLOCK_SIZE = 4096; try (FileInputStream file = new FileInputStream("example.bin")) { byte[] buf = new byte[BLOCK_SIZE]; file.read(buf); } catch (IOException e) { e.printStackTrace(); } ===Python=== In Python, a block can be read with the method of whatever is implementing io.IOBase . BLOCK_SIZE: int = 4096 with open("example.bin", "rb") as file: # file is of type io.BufferedReader block: bytes = file.read(BLOCK_SIZE) ===Rust=== In Rust, a block can be read with the method of std::fs::File . use std::fs::File; const BLOCK_SIZE: usize = 4096; if let Ok(mut file) = File::open("example.bin") { let mut buf = [0u8; BLOCK_SIZE]; file.read_exact(&mut buf); }

References

  1. FileStream.ReadAsync Method (System.IO) · retrieved 2026-11-17 · rev 1374163855
    Cite this reference

    MLA "FileStream.ReadAsync Method (System.IO)." "FileStream. 2026-11-17. https://web.archive.org/web/20251226171806/https://learn.microsoft.com/en-us/dotnet/api/system.io.filestream.readasync?view=net-9.0. Accessed 25 November 2026.

    Chicago "FileStream.ReadAsync Method (System.IO)." "FileStream. 2026-11-17. https://web.archive.org/web/20251226171806/https://learn.microsoft.com/en-us/dotnet/api/system.io.filestream.readasync?view=net-9.0.

    APA "FileStream. (2026). FileStream.ReadAsync Method (System.IO). Retrieved November 25, 2026, from https://web.archive.org/web/20251226171806/https://learn.microsoft.com/en-us/dotnet/api/system.io.filestream.readasync?view=net-9.0

  2. Read in std::io - Rust · retrieved 2026-11-17 · rev 1374163855
    Cite this reference

    MLA "Read in std::io - Rust." 2026-11-17. https://web.archive.org/web/20260128103441/https://doc.rust-lang.org/std/io/trait.Read.html. Accessed 25 November 2026.

    Chicago "Read in std::io - Rust." 2026-11-17. https://web.archive.org/web/20260128103441/https://doc.rust-lang.org/std/io/trait.Read.html.

    APA encyclopegia.org. (2026). Read in std::io - Rust. Retrieved November 25, 2026, from https://web.archive.org/web/20260128103441/https://doc.rust-lang.org/std/io/trait.Read.html

  3. 4: Natural Data Units · retrieved 2026-11-17 · rev 1374163855
    Cite this reference

    MLA "4: Natural Data Units." Blaauw, Gerrit Anne ; Brooks, Jr. 2026-11-17. https://en.wikipedia.org/wiki/Gerrit_Anne_Blaauw. Accessed 25 November 2026.

    Chicago "4: Natural Data Units." Blaauw, Gerrit Anne ; Brooks, Jr. 2026-11-17. https://en.wikipedia.org/wiki/Gerrit_Anne_Blaauw.

    APA Blaauw, Gerrit Anne ; Brooks, Jr. (2026). 4: Natural Data Units. Retrieved November 25, 2026, from https://en.wikipedia.org/wiki/Gerrit_Anne_Blaauw

  4. Available hard drive space, block sizes, and size terminology · retrieved 2026-11-17 · rev 1374163855
    Cite this reference

    MLA "Available hard drive space, block sizes, and size terminology." 2026-11-17. http://www.cnet.com/news/available-hard-drive-space-block-sizes-and-size-terminology/. Accessed 25 November 2026.

    Chicago "Available hard drive space, block sizes, and size terminology." 2026-11-17. http://www.cnet.com/news/available-hard-drive-space-block-sizes-and-size-terminology/.

    APA encyclopegia.org. (2026). Available hard drive space, block sizes, and size terminology. Retrieved November 25, 2026, from http://www.cnet.com/news/available-hard-drive-space-block-sizes-and-size-terminology/

  5. Physical Structures · retrieved 2026-11-17 · rev 1374163855
    Cite this reference

    MLA "Physical Structures." Chang, S. 2026-11-17. http://people.cs.pitt.edu/~chang/156/08struct.html. Accessed 25 November 2026.

    Chicago "Physical Structures." Chang, S. 2026-11-17. http://people.cs.pitt.edu/~chang/156/08struct.html.

    APA Chang, S. (2026). Physical Structures. Retrieved November 25, 2026, from http://people.cs.pitt.edu/~chang/156/08struct.html

  6. Bruning Questions: ZFS Record Size · retrieved 2026-11-17 · rev 1374163855
    Cite this reference

    MLA "Bruning Questions: ZFS Record Size." Balik, Rachel (29 March 2013). 2026-11-17. https://www.joyent.com/blog/bruning-questions-zfs-record-size/. Accessed 25 November 2026.

    Chicago "Bruning Questions: ZFS Record Size." Balik, Rachel (29 March 2013). 2026-11-17. https://www.joyent.com/blog/bruning-questions-zfs-record-size/.

    APA Balik, Rachel (29 March 2013). (2026). Bruning Questions: ZFS Record Size. Retrieved November 25, 2026, from https://www.joyent.com/blog/bruning-questions-zfs-record-size/

  7. Tuning ZFS recordsize · retrieved 2026-11-17 · rev 1374163855
    Cite this reference

    MLA "Tuning ZFS recordsize." Bourbonnais, Roch (7 June 2006). 2026-11-17. https://blogs.oracle.com/roch/tuning-zfs-recordsize. Accessed 25 November 2026.

    Chicago "Tuning ZFS recordsize." Bourbonnais, Roch (7 June 2006). 2026-11-17. https://blogs.oracle.com/roch/tuning-zfs-recordsize.

    APA Bourbonnais, Roch (7 June 2006). (2026). Tuning ZFS recordsize. Retrieved November 25, 2026, from https://blogs.oracle.com/roch/tuning-zfs-recordsize

Cite this article

MLA

"Block (data storage)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/block-data-storage. Accessed 25 November 2026.

Chicago

"Block (data storage)." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/block-data-storage.

APA

encyclopegia.org. (2026). Block (data storage). Retrieved November 25, 2026, from https://encyclopegia.org/wiki/block-data-storage

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Tohoku proportional representation block

stub · references available

digital data

stub · references available

Enhanced Data Rates for GSM Evolution

stub · references available

Data Becker

stub · references available

Polity data series

stub · references available

Vianden Pumped Storage Plant

stub · references available

ActiveX Data Objects

stub · references available

data space

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1374163855 · 0.5 · snapshot enwiki-001374163855

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.