1
Data
Felis edited this page 2026-09-24 13:51:28 +08:00
Table of Contents
include_toc
include_toc
true

DATA and persistent files

FDS keeps SYSTEM read-only. Store documents, source code and other persistent files on a DATA cartridge. With one healthy DATA cartridge inserted, FDS mounts it at /data and gives the fds user access to its files.

fds bays
fds bay 02
mkdir -p /data/projects
printf 'My first FDS file\n' >/data/projects/hello.txt
cat /data/projects/hello.txt

Confirm that the bay reports MOUNTED READ WRITE before writing. Only one DATA cartridge is active at a time. To select DATA explicitly:

fds data use 02

If another DATA is active, eject it first. In recovery, DATA starts read-only and requires this explicit activation before it can be used for ordinary writes.

Programs using DATA

Run a system command under the DATA bay's process tracking when it should stop as part of ejecting that DATA:

fds run 02 -- /usr/bin/tail -f /data/application.log

This background command uses /data as its working directory. Its output goes to the cartridge service log. A directly launched PROGRAM is tracked under its PROGRAM bay; close it if it keeps files open on a different DATA cartridge.

Finish a session

cd "$HOME"
fds eject 02

Wait for SAFE, then remove the cartridge. fds poweroff performs the storage shutdown sequence for all active bays. Unexpected power loss or pulling a drive during a write can damage files; recovery explains checking DATA.

In the emulator, writes go to a separate session overlay. Eject preserves that overlay, and reinserting the original image creates a new overlay. See exporting emulator DATA before moving or deleting a session.