Storage

Experimental. Try it in the demo. The source code is not public yet: file paths below refer to it.

Using it

The saved disk is a convenience, not a backup. There is no export yet. Closing the tab and “Power off” are like pulling the plug: press Save now first. A browser may delete stored data (Safari can after seven days without a visit), private windows usually forget it, and a crash or power cut can lose recent saves.

How it works

PieceWhat it doesSource
virtio-blk deviceAsynchronous: requests may finish late and in any order; guest-supplied addresses are checkedsrc/virtio.src
Two layersRead-only SquashFS system disk plus ext4 saved disk, joined with overlayfslinux/init, tools/mkrootfs.py
Block cache64 KiB chunks, read on demand; a save commits all unsaved chunks as they are at one instantweb/disk.js
IndexedDBOne transaction per save; a guest flush completes only after it doesweb/disk-idb.js
Save nowConsole SysRq sync (nothing is typed into your program), then 500 ms of disk quiet, then a saveweb/disk-save.js
Kept copiesEach new saved disk stores its own system disk and blank disk (about 3 MiB), all or nothingweb/disk-pin.js
One user at a timeA Web Lock refuses a second tab on the same saved diskweb/linux-worker.js

Updates

A saved disk keeps running on the system it was made with, even if the site ships a newer one or loses its own. The page says when a newer one exists. There is no upgrade in place: moving to it means deleting the saved disk. For maintainers: every later kernel and initramfs must still boot old system disks (see the top of linux/rootfs-init); only a disk update has been tested, not a kernel or initramfs update.

Limits you should know