Skip to content

Archive

File Systems

12 articles
Cybersecurity 18 Sep 2026 5 min read

openat2 Resolution Flags Constrain Path Traversal at the Kernel Boundary

A service can validate a pathname and still open a different object if the namespace changes between validation and use. Symbolic links, mount topology, rename operations, and special procfs links make pathname resolution a kernel operation with state that can change concurrently. Linux openat2() addresses part of this boundary by attaching resolution constraints to the lookup that produces the file descriptor. The security property is narrower than generic path sanitization. openat2() does not declare a pathname safe. It lets a caller ask the kernel to reject specific resolution behavior while the kernel performs the walk.

Software Engineering 18 Sep 2026 5 min read

openat2 Constrains Path Resolution Inside a Directory Boundary

A pathname is not a stable object reference. Between its starting directory and final component, Linux path resolution may follow symbolic links, cross mount points, process .., or encounter special links exposed by pseudo-filesystems. openat2() lets a caller attach constraints to that resolution operation so the kernel can reject a lookup that leaves the intended boundary. The distinction is stronger than checking a normalized string before open(). String validation examines syntax. openat2() can constrain the kernel’s actual traversal while filesystem objects and mount topology participate in the lookup.

Software Engineering 18 Sep 2026 5 min read

Linux O_PATH Separates Object Reference From I/O Authority

open() usually combines two effects: pathname resolution selects a filesystem object, then the returned file descriptor carries an access mode for data I/O. Linux O_PATH splits those effects. A successful open(path, O_PATH) returns a descriptor that refers to the selected object while ordinary read() and write() through that descriptor are not permitted. That split is useful anywhere a process needs a durable kernel reference for later metadata or pathname-relative operations without opening the object for data transfer. It also changes race analysis: later operations can start from the descriptor rather than resolving the original pathname again.

Tech 13 Sep 2026 6 min read

External Drive Write Caching and Safe Removal

A file copy to a USB drive can appear finished before every related change has reached the storage medium. The progress window may close, the file may appear in a folder, and the drive can still have pending writes. This gap between an application finishing its work and storage completing every write is central to safe removal. Operating systems use several layers of caching and buffering around storage. These layers can reduce repeated work and let applications continue without waiting for each individual write to finish. They also mean that “the copy dialog disappeared” and “all data is durable on the removable device” are not necessarily the same event.

Tech 11 Sep 2026 7 min read

Why File Size and Space Used on Disk Can Differ

A file manager may show two different numbers for the same file: its size and the space it uses on disk. A folder containing thousands of tiny files can make the difference even more noticeable. The files may add up to one amount while the storage consumed is larger. Those numbers are measuring different things. File size describes how much data belongs to the file. Space used on disk describes how much storage the file system has allocated to hold it. They often end up close, but they don’t have to match.

Tech 10 Sep 2026 8 min read

Why Moving a Large File Can Be Instant or Take Minutes

Move a 20 GB video from one folder to another and it may finish almost immediately. Move the same file to an external drive and suddenly there is a progress bar, sustained disk activity, and a long wait. The difference is not mainly the file’s size. It is whether the move can be handled as a change to the file system’s records or whether the file’s actual contents must travel to another storage location.

Tech 08 Sep 2026 8 min read

Why File Size and Size on Disk Can Be Different

A file’s properties can sometimes show two numbers that seem as though they should match: its size and the space it occupies on storage. Depending on the operating system, the second value may be labelled something like “size on disk” or may appear only in storage tools. The difference is usually not a mistake. A file has a logical length—how much data belongs to the file—but a storage device and its file system also need a practical way to assign physical or logical storage space to that data. Those two measurements answer different questions.

Tech 07 Sep 2026 8 min read

What Formatting a USB Drive Does and Why File Systems Matter

A USB drive can have plenty of free space and still refuse a file, work on one device but not another, or suddenly ask to be formatted before you can use it. These problems often come down to the drive’s file system. Formatting is the process of preparing storage so a device can organize files on it. It is not simply a way to make a drive empty. Formatting creates or resets the structures that an operating system uses to keep track of filenames, folders, free space, and where file data belongs.

Linux 07 Sep 2026 12 min read

Understand Sparse Files on Linux Without Wasting Disk Space

A file can report a size of 100 GiB without consuming 100 GiB of disk blocks. That sounds contradictory until you separate two ideas that ordinary file APIs often present together: a file’s logical size and the storage that the filesystem has actually allocated for it. Linux filesystems can represent long ranges of unwritten bytes as holes. Reading a hole returns zero bytes, but the filesystem does not need to store one physical zero byte for every logical byte in that range. A regular file that contains holes is called a sparse file.

Linux 06 Sep 2026 13 min read

Choose the Right Advisory File Lock on Linux

Two processes can open the same file and both write to it successfully. That is often exactly what Unix applications need, but sometimes the programs are supposed to coordinate: only one worker should update a state file, several readers may share a resource, or a process must avoid changing a byte range while another process is using it. Linux offers several advisory file-locking mechanisms. The confusing part is not how to request a lock. The confusing part is what owns the lock and when that lock disappears.

Tech 05 Sep 2026 9 min read

Why Moving a File Can Be Much Faster Than Copying It

Move a large video from one folder to another and it may appear to finish almost instantly. Move the same video to an external drive and you may have to wait while a progress bar slowly advances. The file is the same size, so why can the two operations take such different amounts of time? The answer is that moving a file does not always mean moving all of its data. When the source and destination are on the same file system, a move can often be completed mostly by changing the file system’s records about where the file belongs. When the destination is on a different file system, the data generally has to be copied to the new location before the old file can be removed.

Tech 04 Sep 2026 7 min read

Why a File Can Be Too Large for an Empty USB Drive

A USB drive can show tens or hundreds of gigabytes of free space and still refuse to accept a single large video, archive, or backup file. The error may say that the file is too large for the destination even though the drive clearly has enough room. The apparent contradiction comes from confusing two different limits: how much data the drive can hold in total and how large one individual file is allowed to be. The second limit is controlled largely by the drive’s file system, not by its remaining capacity.