Skip to content
Artwork for My Weird Prompts
My Weird Prompts · Wednesday · 20 min

A Virtual Disk Inside Your Linux Filesystem

Daniel wants a pocket of storage inside his ext4 home server — a virtual disk that lives as a single file, mounts from fstab, and behaves like a real partition. No VM required. The kernel already knows how to pretend a file is a disk, and that trick is called a loop device. This episode walks through building image files with truncate versus fallocate, why sparse files can fail at 3am, how LUKS encryption and Squashfs read-only images ride on top of the loop, and why swap files take a completely different path through the kernel. Plus: project quotas as the boring alternative, fscrypt for per-directory encryption, and what happens when you try to hand a laptop swap space over the network. Episode 6186 — myweirdprompts.com/n/6186 (permanent short link: myweirdprompts.com/363722)

0:00 · Intro-20:03

transcript

No transcript — this publisher did not publish one.

show notes

Daniel wants a pocket of storage inside his ext4 home server — a virtual disk that lives as a single file, mounts from fstab, and behaves like a real partition. No VM required. The kernel already knows how to pretend a file is a disk, and that trick is called a loop device. This episode walks through building image files with truncate versus fallocate, why sparse files can fail at 3am, how LUKS encryption and Squashfs read-only images ride on top of the loop, and why swap files take a completely different path through the kernel. Plus: project quotas as the boring alternative, fscrypt for per-directory encryption, and what happens when you try to hand a laptop swap space over the network.

Episode 6186 — myweirdprompts.com/n/6186 (permanent short link: myweirdprompts.com/363722)

chapters

6 chapters