Virtualization and Storage
From sectors, filesystems and journals to storage engines, object stores, Ceph and OpenStack clouds, storage and virtualization as told through the free samples of Leanpub books.
Created from the free samples of 8 Leanpub books and the descriptions and tables of contents of 2 more, with every source cited.
Storage is the part of a computer system that keeps data after the power goes off, and most of the engineering in it is the building of useful abstractions over a device that offers none. What a disk exposes is a long sequence of fixed-size blocks with no structure of its own; a filesystem organises that sequence into files and directories and hides the management of space underneath.[1] Virtualization applies the same idea to whole machines: a hypervisor runs virtual machines on shared hardware, and a cloud platform hands out virtual machines, virtual networks and virtual disks on request.[6]
The two subjects meet in the data centre. A virtual machine boots from a disk image, keeps its data on a volume carved from a storage cluster, and may store its backups as objects; the platform that provides all three depends on a distributed storage system underneath.[6] Above the filesystem there are further layers: the storage engines inside databases, which decide how records are laid out and rewritten, and object stores, which give up in-place modification and directories in exchange for scale and durability.[4][5]
This article covers the kinds of storage, three filesystems and how they survive a crash, storage engines, object storage, pooled and distributed storage, private clouds built on virtual machines, and the reading of storage formats from raw bytes. Its sources are the free samples of eight Leanpub books and the descriptions and tables of contents of two more, published between 2022 and 2026. The pool is small and it is mostly about storage: virtualization appears only through two books on one open-source cloud platform, and no source is about a hypervisor as such. The page follows the sources in that.
Where to start
A reader who knows C and wants to understand what a filesystem does has a clear first book. FAT12 (2026) builds the simplest filesystem still in everyday use, step by step, and assumes only pointers, structs and bitwise operations.[1] The two references on larger filesystems assume more. The NTFS File System (2026) asks for C, binary data structures and basic operating system concepts and explains the rest from the beginning.[3] The Linux ext4 Filesystem (2026) assumes the reader already knows what inodes and block devices are, and is a reference to the on-disk format, not a guide to using Linux.[2] Reverse Engineering Databases and Storage Formats (2026) needs programming and no knowledge of database internals, and teaches the reading of any storage format from its bytes.[7]
Engineers who build on storage have two books. High-Performance Storage with RocksDB (2026) is for those who embed a storage engine in their own software and uses C++.[4] Object Storage as Infrastructure (2026) addresses experienced engineers who have shipped production code and dealt with partial failures, and says it does not explain the basics of networking or concurrency.[5]
Administrators who run storage and clouds have four. The OpenStack Handbook (2026) is written for system administrators and cloud architects with Linux, networking and basic storage and virtualization knowledge.[6] OpenStack Cookbook (2026) teaches the same platform as recipes, one chapter to a service.[8] Hands-On Ceph (2025) covers a distributed storage system from architecture to operation, and ZFS on Ubuntu 20.04 LTS (2022) covers one pooled filesystem on one Linux release, hardware included.[9][10]
Blocks, files and objects
Storage is offered to software in three forms, and one source sets them side by side. Block storage divides data into fixed-size blocks with addresses and nothing else; the operating system or a database decides what the blocks mean. It gives fast random access and modification in place, which suits databases and virtual machines. File storage arranges data as files in directories and supports modification in place, permissions, links and locking. Object storage keeps whole objects under keys in a flat namespace: an object is replaced, never edited, and there are no real directories.[5]
At the bottom, a device transfers data in sectors, whose size is a power of two and has usually been 512 bytes, and each sector has a number counted from zero, its logical block address.[1] Filesystems then allocate in larger units. NTFS calls its unit a cluster, never allocates part of one, and uses a 4 KB cluster on almost every modern volume.[3] The ext family calls it a block, most commonly of 4 KiB.[2]
Filesystem code is kept away from hardware by an interface. FAT12 defines a block device with five operations (read sectors, write sectors, report the sector size, report the sector count, close) and runs the same filesystem code over a disk image file, a RAM disk and a real disk driver without changing a line.[1] The same book marks the limit of that interface: a write that returns success has been handed over, not necessarily made durable, because the C library, the operating system's cache and the drive's own cache each buffer writes and flush them later.[1]
Filesystems
Three filesystems are described from the disk upward in the sources, and they span the range from the simplest design in use to two of the most widely deployed.
FAT
FAT is the filesystem a computer meets first: firmware that follows the UEFI specification loads its bootloader from a partition that the specification requires to be FAT, and memory cards and USB sticks use it too.[1] FAT12, the variant that DOS started with, reduces a filesystem to essentials. One table links the clusters of every file into a chain, a linked list with no extents, groups or trees, and the root directory sits at a fixed position with a fixed size.[1] Understanding it carries over to FAT16 and FAT32, which differ in detail.[1]
The book's method is verification. Each structure is decoded from a volume made by the standard formatting tool, the result is compared with a hexdump of the image, and files the reader's code writes are handed to the Linux kernel's own FAT driver to read.[1] Its author gives a reason that belongs to 2026: an AI assistant will produce a FAT12 implementation that compiles and may list a directory, but an error in packing the table's 12-bit entries does not crash; it overwrites four bits of a neighbouring entry and corrupts some other file, to be discovered much later. Knowing where the bits belong turns generated code from something to be trusted into something that can be reviewed.[1]
The ext family
The Linux line began in 1992 with ext, written to replace a filesystem limited to 64 MiB. It introduced inodes that hold a file's metadata apart from its directory entries and filenames of up to 255 bytes, and its two-byte signature, 0xEF53, has identified the family ever since.[2] ext2, from 1993, was a rewrite. It divided the disk into block groups, each with its own bitmaps of free blocks and inodes and its own inode table, kept backup copies of the superblock in several groups, and preferred to allocate a file's data near its inode.[2] Its most lasting idea was a system of feature flags in three classes: features an older kernel may ignore, features that make it refuse to mount the volume, and features that restrict it to reading. That let the format evolve for three decades without breaking existing volumes.[2]
ext3 added a journal in 2001, and ext4, stable from the end of 2008, replaced the old scheme of block pointers with extents. An extent describes a contiguous run of blocks by where it starts and how long it is, and one 12-byte record can cover 128 MiB, where the earlier scheme needed four bytes for every block.[2] ext4 also delays the choice of physical blocks until data is actually written out, so that the allocator sees the whole request and can place it contiguously.[2] On disk, the superblock is 1,024 bytes long and begins 1,024 bytes into the device, leaving room for a boot sector, and at the usual block size each block group spans 128 MiB.[2] ext4 remains the default filesystem of most Linux distributions.[2]
NTFS
NTFS shipped in 1993 with the first release of Windows NT and is still the default filesystem of current Windows versions.[3] Its central idea is that everything is a file. The allocation bitmap, the journal, the security database and the Master File Table that describes every file, itself included, are all files recorded in that table, so one set of mechanisms serves both user data and the filesystem's own bookkeeping.[3] Metadata is held as attributes, which the book describes as more flexible than an inode with fixed fields, and a small file's data can be stored inside its record in the table without occupying a cluster at all.[3]
A volume begins with a boot sector that carries both bootstrap code and the volume's geometry: the sector size, the sectors per cluster, the total size, and the cluster at which the Master File Table starts. A parser checks for the identifier NTFS followed by four spaces near the start and the signature 0xAA55 in the last two bytes.[3] The book's practical lesson is to read positions from the boot sector and never assume them: Windows and the open-source formatter place the table and its small backup copy in different parts of the volume.[3] A table record is normally 1,024 bytes, and with 4 KB clusters a volume can reach 16 TB.[3]
Surviving a crash
A change to a filesystem usually touches more than one place on the disk, and a crash between two writes leaves them disagreeing. Without a journal the remedy is care about order. FAT12 shows that deleting a file in the wrong order can leave a directory entry pointing at clusters the table already calls free, so that the next file to claim them is silently cross-linked with it, while the right order costs at worst a little leaked space.[1]
A journal removes the dependence on order. ext3 reserves part of the volume as a circular log, records the blocks of each change there before writing them to their final place, and marks the end of each transaction with a commit record; after a crash the committed transactions are replayed at the next mount. Before journaling, a crash could mean a consistency check lasting hours on a large volume, and the journal reduced recovery to seconds.[2] It offers three modes: journaling data as well as metadata, the safest and slowest; journaling metadata only after the data it refers to has been flushed, the default; and journaling metadata with no ordering of data, the fastest, after which a file may contain stale contents although the structures are consistent.[2] NTFS has kept a log of the same write-ahead kind since its first release.[3]
Storage engines
A database does not usually leave the layout of its data to the filesystem. Its storage engine decides how records are arranged in a file, and two designs dominate. A B-tree keeps data sorted in a balanced tree of pages and modifies pages in place; finding a key takes few reads, but each write is a random one. A log-structured merge-tree never updates in place. New data goes into a sorted buffer in memory, the memtable, which is written out when full as an immutable sorted file; a background process called compaction merges those files and discards overwritten and deleted entries.[4]
The trade is explicit. Writes become sequential appends, which flash storage handles well and which spread wear evenly; reads may have to consult the memtable and several files; and some space is always held by versions not yet compacted away. A deletion is itself a write, of a marker that hides the key until compaction removes both.[4] The book does not claim the design is better everywhere: for workloads that mostly read single keys from data that seldom changes, a well-tuned B-tree can be faster and simpler.[4]
RocksDB, the subject of High-Performance Storage with RocksDB, is an embedded engine of this kind: a library linked into an application, with no server process, storing sorted keys and values as byte strings. It was begun in 2012 as a fork of the open-source LevelDB, to make full use of flash storage on servers, and was itself released as open source the following year.[4] Being embedded, it supplies no replication, no query language and no distribution, which is why distributed databases, stream processors and storage systems build on top of it; the Ceph storage system, for one, keeps its metadata in it.[4] The price of its many settings is that a wrong choice of compaction strategy, memory limits or filters shows up as worn drives, exhausted memory or slow reads.[4]
Reverse Engineering Databases and Storage Formats approaches the same structures from the outside. Its chapters run from fixed-size pages and the packing of records into them, through B-trees and log-structured trees, to write-ahead logs and crash recovery, with open-source databases as case studies; the sample covers the method and the reading of bytes, and not those chapters.[7]
Object storage
An object store holds objects in buckets. Each object is a body of bytes, some metadata and a key, and the key is a flat string: a slash in it is a convention, and what looks like a directory listing is a request for all keys that begin with a given prefix.[5] The interface that has become the common standard, the S3 API, is a small set of operations over HTTP. A put creates or replaces a whole object atomically; a get retrieves it, or a byte range of it; a head returns the metadata alone; a list returns keys by prefix, a thousand at a time, and is comparatively expensive; and a multipart upload assembles a large object from parts sent in parallel.[5] Every object has an entity tag that identifies its current version.[5]
Two properties changed what can be built on this. For its first years the best-known service guaranteed only that an overwrite or deletion would become visible eventually, and systems built on it carried workarounds: unique key suffixes in place of overwrites, outside services to track state, retries with delays. Since December 2020 it has given strong read-after-write consistency for all operations.[5] Conditional writes followed: a request can ask to create an object only if the key is unused, or to replace it only if its entity tag is the one expected. Together these amount to compare-and-swap on a single key, enough for optimistic concurrency control and leader election without a separate coordination service.[5] Object Storage as Infrastructure builds key-value stores, logs, queues and a version-control back end on those primitives, and notes their limit: the guarantees cover one object in one region, with no transaction across keys.[5]
Durability and availability are different promises. The service is designed for eleven nines of durability, which the book reaches by explaining erasure coding: an object is split into data shards and parity shards spread over storage nodes, and any sufficient subset rebuilds it. Ten data shards with four parity shards occupy 1.4 times the original size, against three times for triple replication, and tolerate more simultaneous failures.[5] Background processes verify checksums and regenerate damaged shards.[5] Availability is lower, a target of 99.99 per cent, so software that treats the store as its source of truth can rely on written data surviving and must still expect a read to fail now and then and be retried.[5]
Pooled and distributed storage
Between a single filesystem and a cloud service lie systems that pool many drives. Ceph is the one the sources return to most. Hands-On Ceph treats it as software-defined storage and follows it from hardware planning and architecture to deployment with the Cephadm tool, the management of pools, the CRUSH maps that govern where data is placed, and the storage daemons, one to a drive, that hold it. It covers the three ways the same cluster is consumed: as a filesystem, as block devices and through an object gateway.[9] The object gateway is one of the compatible implementations of the S3 API that the object storage book names.[5] The book has no sample, so these are its stated contents.
ZFS combines the filesystem and the management of the drives under it. ZFS on Ubuntu 20.04 LTS is an administrator's account of running it on one long-term Linux release: choosing servers, controllers and drives of different kinds, with the expected speed of each; the commands for pools and filesystems; replacing a failed drive and rebuilding its contents, which ZFS calls resilvering; and troubleshooting at the level of Linux, the kernel and the pool.[10] It dates from 2022, covers ZFS versions 0.7 and 0.8.3, and leaves out installing the operating system itself on ZFS, which its author judged too risky at the time.[10]
Virtual machines and private clouds
OpenStack is an open-source platform for infrastructure as a service: self-service virtual machines, software-defined networks, block and object storage, orchestration and load balancing, on hardware the operator owns. The OpenStack Handbook places it beside the public clouds, not against them. Its users are organisations for which a public cloud does not fit: because data must stay on their premises or within national borders, because an application cannot tolerate the delay of a distant region, because predictable capital spending is cheaper at their scale, or because regulation requires control of the whole stack.[6] It is modular, a set of services that communicate through defined interfaces and can be deployed selectively, and the book calls this both its greatest strength and the main source of its complexity. It is not a turnkey product, and running it takes real expertise in Linux, networking, storage and virtualization.[6]
A deployment assigns servers to roles. Controller nodes run the interfaces, the database and the message queue; compute nodes run the virtual machines; network nodes handle routing and address translation; storage nodes provide volumes and objects. Separate networks carry management traffic, user access, storage traffic and the virtual machines' connections to the outside, and the book recommends a dedicated fast network for storage.[6]
The compute service, Nova, does not run a hypervisor itself. It directs hypervisors through drivers, with KVM the most common choice in production and commercial hypervisors supported alongside it.[6] A request for a new virtual machine is checked against quotas, a scheduler filters out the compute nodes that cannot host it and ranks the rest, and the chosen node fetches the disk image, attaches network ports and any requested volumes, and starts the machine.[6] OpenStack Cookbook has recipes on that service's use of KVM and QEMU, among chapters on identity, images, networking, block storage, load balancing and orchestration, all set in one fictional company moving off its own servers; its sample is the prologue and the table of contents.[8]
Storage for virtual machines
A virtual machine uses storage in several forms, and the platform has a service for each. The image service is the catalogue of bootable disk images. It stores them in more than one format: raw, an uncompressed copy of a disk, and QCOW2, a copy-on-write format that supports snapshots, compression and thin provisioning.[6] The disk a virtual machine is created with is ephemeral and disappears with the machine. The block storage service, Cinder, provides volumes that persist independently, can be attached to a running machine or used to boot from, and can be snapshotted and cloned; volume types let one cloud offer, for instance, a fast class on solid-state drives and a cheaper standard class.[6]
The object storage service, Swift, stores unstructured data such as backups and logs. It spreads objects over nodes by consistent hashing, keeps three replicas of each in a typical production setup, and has no central metadata database that could become a bottleneck.[6] In practice many deployments put Ceph under all three. Its block devices are the most common production back end for volumes, and when images are kept there as well, a new machine's disk is a copy-on-write clone of the image and not a copy, so that even a large image starts almost at once.[6] The handbook gives Ceph integration a chapter of its own, and the cookbook has recipes for using it behind the image service.[6][8]
Reading storage from the bytes
All of these formats can be inspected directly, and the sources give reasons to learn how. Reverse Engineering Databases and Storage Formats lists them: recovering data when the software that wrote it is gone or refuses to open a damaged file; forensics, since free pages not yet overwritten and write-ahead logs hold the history of a database and not only its current state; escaping dependence on a vendor's opaque format; checking that data said to be encrypted or deleted really is; and diagnosing performance from the physical layout.[7] The filesystem references are written with the same readers in mind, people building a forensic parser, a recovery tool or a driver for another operating system.[2][3]
The technique starts with signatures. Most binary formats open with a magic number at a fixed position, followed by a header of fixed size that gives the version and the parameters needed to read the rest.[7] The filesystems above follow the pattern: the ext family's two-byte signature in the superblock, and the identifier at the start of an NTFS boot sector with a second signature at its end.[2][3] Byte order has to be known as well. ext4 stores its metadata little-endian and its journal big-endian, which makes journal blocks recognisable at a glance in a raw dump.[2] The working rule in each of these books is the same: decode a structure, then check the result against the real bytes with a hexdump before building on it.[1][7]
Questions about Virtualization and Storage
Which book should I start with to learn how filesystems work?
FAT12 (2026) builds the simplest filesystem in everyday use step by step in C and assumes only pointers, structs and bitwise operations.[1] The NTFS File System (2026) and The Linux ext4 Filesystem (2026) are references on two much larger designs, and the second assumes operating system fundamentals.[3][2]
What is the difference between block, file and object storage?
Block storage offers numbered fixed-size blocks that can be read and rewritten in place, and suits databases and virtual machines.[5] File storage arranges data as files in directories, with in-place modification, permissions and locking.[5] Object storage keeps whole objects under flat keys, replaces them instead of editing them, and trades those capabilities for scale and durability.[5]
What does journaling do in a filesystem?
When is an LSM-tree better than a B-tree?
A log-structured merge-tree turns every write into a sequential append, so it suits write-heavy workloads on flash storage such as event logs and continuous ingestion.[4] For workloads that mostly read single keys from data that seldom changes, a well-tuned B-tree can be faster and simpler, because a read does not have to check several files.[4]
Is object storage strongly consistent?
Why would an organisation run OpenStack instead of using a public cloud?
The reasons one source gives are data that must stay on the premises or within national borders, applications sensitive to network delay, cost structures in which predictable capital spending wins at scale, and regulation that requires control of the whole infrastructure.[6] The same source says the platform complements public clouds and is not a turnkey product: it takes real expertise to run.[6]
Sources
Every source is a Leanpub book or course. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 2.The Linux ext4 Filesystem, Steve Publications: An Implementation Guide for Systems Programmers Free sample: the introduction, chapter 1 on the history from ext to ext4, and part of chapter 2 on the superblock and block groups. 2026. Free sample: PDF · EPUB
- 3.The NTFS File System, Steve Publications: Architecture, Internals, and Implementation of the New Technology File System Free sample: the introduction and chapter 1 on sectors, clusters and the boot sector, with its parser walkthrough. 2026. Free sample: PDF · EPUB
- 4.High-Performance Storage with RocksDB, Steve Publications: The Definitive Guide to Building High-Performance Embedded Storage Systems Free sample: the introduction, chapter 1 on the engine's history and on LSM-trees against B-trees, and chapter 2 on building and first use. 2026. Free sample: PDF · EPUB
- 5.Object Storage as Infrastructure, Steve Publications: Building Databases, Queues, Git Systems, and Distributed Applications on S3-Compatible Storage Free sample: the introduction and most of chapter 1 on the object model, the API operations, consistency, durability and availability. 2026. Free sample: PDF · EPUB
- 6.The OpenStack Handbook, Steve Publications: From First Deployment to Production-Scale Cloud Operations Free sample: the introduction and chapter 1 on node roles and the identity, compute, networking, image, block storage and object storage services. 2026. Free sample: PDF · EPUB
- 7.Reverse Engineering Databases and Storage Formats, Steve Publications: From Binary Bytes to Complete Understanding Free sample: chapter 1 on why storage formats are reverse engineered, chapter 2 on hex dumps, byte order and file anatomy, and the opening of chapter 3. 2026. Free sample: PDF · EPUB
- 8.OpenStack Cookbook, GitforGits | Asian Publishing House: Manage Compute, Storage and Networking through Single Interface Free sample: the prologue and the table of contents, recipe by recipe. 2026. Free sample: PDF
- 9.Hands-On Ceph, BEKROUNDJO Akoley Aristide: Deploy, Manage, and Optimize Modern Ceph Clusters – Practical Labs and Real-World Scenarios No sample: from the description and table of contents. 2025.
- 10.ZFS on Ubuntu 20.04 LTS, Carles Mateo: Working with ZFS 0.7 and 0.8.3 on Ubuntu Linux No sample: from the description and table of contents. 2022.
Further reading
Other books in the library on the same ground, not cited above.
- Operating Petabyte-Scale ClickHouse Clusters, Steve Publications: A Production Engineering Guide from Architecture to Operations Running an analytical database at large scale, with chapters on its on-disk layout, tiered disks and object storage. 2026. Free sample: PDF · EPUB
- Code a database in 45 steps (Go), Lowram Eepson: a series of test-driven small coding puzzles Building a database from scratch in Go as forty-five small coding puzzles, storage engine included. 2025.
- Troubleshooting Linux Storage, Erwin van Londen: a systems administrator guide A guide for systems administrators to troubleshooting storage on Linux. 2022.