| TT(8) | System Manager's Manual | TT(8) |
NAME
tt — byol's time
travel with no daemon
SYNOPSIS
tt |
status | on |
off | take |
delete | copy |
tt |
mount | umount
hour |
tt |
back hour |
undo |
tt |
place dir |
DESCRIPTION
tt does the time travel commands of
ttd(8) in its own process, with no daemon
and no VM. Each run does its command and the jobs that the command starts,
to their end, then exits. tt runs as root, on a byol
whose root is the store's image,
/swmdata/images/root.img.
One writer at a time: tt refuses while
ttd(8) answers on
/run/ttd.sock, and while another
tt or ttd(8) holds
/run/tt.lock. While
ttd(8) runs, swmtool
tt is the way in; see
swmtool(8).
A run takes no point and makes no copy that its command does not
ask for. Only copy and place
take the hourly point and make a copy.
An hour is
YYYYMMDDTHHZ,
in UTC. Each command answers in lines on the standard output. A refusal's
last line starts refused:.
Commands
status- Show time travel on or off, the store's size and free space, and each point's hour and size. Then show the place: its kind, its disk or address, its newest copy and its age, its state, its last job's end, and its free space. With no place, show the USB disks the box admits.
on|off- Turn time travel on or off. On takes no point; the next
copy, or ttd(8), takes it. Off deletes every point, when no point is mounted and no job runs. take- Take a point of this hour now. When no point of this hour is there at the
end,
ttwritesfailed: no point of this hourand exits 1. delete- Delete every point. With no points, the command is refused.
copy- Do the hourly pass of ttd(8): take this hour's point, then make a copy to the place, then show the status. A place gets one copy an hour. The byol installs no cron(8); a cron that the user adds can run it each hour.
mounthour- Mount the point of hour read-only at
/points/hour. The point
stays mounted after
ttexits. umounthour- Unmount /points/hour, which an earlier run mounted, and remove its directory.
backhour- Make the point of hour the root that the next boot
boots. The root now is kept as root.prev.img. Then
ttrunsswmtool store kernels, which puts the staged root's kernels on the ESP. When that fails,ttexits 1. back undo- Make the root before the last rollback, root.prev.img, the root that the next boot boots, and put its kernels on the ESP.
placedir- Make the directory dir the root's backup place, then
make its first copy, then show the status. dir is an
absolute path to a directory that the user mounted: XFS, ext4, btrfs, FAT
or exFAT on a disk, an NFS export, or an SMB share. FUSE is refused.
ttdoes not mount it. The directory must be the root of the mount, as the user mounted it. A directory that is not a mount's root is not mounted: the place is absent, no copy is made, and the points go on.A place is refused when:
- a directory on its path is not owned by root, or is writable by its group or by others;
- others can read its session's directory: a file system that shows its
mount's modes, as cifs does, must be mounted with
dir_mode=0700,file_mode=0600; - its session's directory is not root's: an NFS export must be
no_root_squash; - a symbolic link, or a name that is not a directory, is on its path;
- its file system is not XFS, ext4, btrfs, FAT, exFAT, NFS or SMB;
- it is on the disk that holds the root and its store, or its disk is not found.
The copies are ciphertext: the root's image is LUKS2.
Secrets
place reads its secrets from the standard
input, one line each:
- the place's password, the one that a restore asks for;
- on a terminal, the same password again.
On a terminal, tt shows a prompt and turns
the echo off. A signal at a prompt turns the echo on, and
tt exits 1. The place's password is 1 to 128
printable ASCII characters, which a restore's console can type. An empty
line, a line longer than 128 bytes, a NUL, or two passwords that are not the
same are refused.
FILES
- /run/tt.lock
- the one writer's lock
- /run/ttd.sock
- ttd(8)'s socket; when it answers,
ttrefuses - /swmdata/images/root.img
- the root's image
- /swmdata/images/root.next.img
- a rollback that the next boot takes
- /swmdata/images/root.prev.img
- the root before the last rollback
- /swmdata/images/tt/
- the points and the record
- /points/hour
- a point mounted read-only
- /usr/local/bin/swmtool
- what
backruns
SIGNALS
SIGINT,SIGTERM- Start no new point or copy. Give a running job 10 seconds to end, stop it, then exit.
EXIT STATUS
- 0
- The command and its jobs are done.
- 1
- The command is refused or failed:
ttis not root, the root is not a store's image, a place job failed,takemade no point, orbackput no kernels on the ESP. - 2
- A usage error.
- 3
- ttd(8) runs, or another
ttholds /run/tt.lock.
EXAMPLES
Mount an NFS export, make it the place, and make its first copy:
# mount -t nfs 192.0.2.10:/tt /mnt/tt # tt place /mnt/tt
Take the hourly point and a copy each hour, from root's crontab in a cron that the user adds:
0 * * * * /usr/local/bin/tt copy
Mount a point, read it, and unmount it:
# tt mount 20261120T09Z # ls /points/20261120T09Z # tt umount 20261120T09Z
SEE ALSO
AUTHORS
Marco Peereboom <marco@peereboom.us>
SECURITY CONSIDERATIONS
The place is a directory that the user mounted, read on the box.
The kernel that holds the root's key parses the place's file system, and a
root child process of tt serves the place. A bad
place that finds a bug in that parse can read the key. Mount only a file
system that you trust. The child mounts its own copy of the directory
nosuid, nodev and noexec.
Each child process starts before tt reads
the key, so it has no key in its memory. The child is root: a child that a
bad place takes over can read the memory of tt. It
runs in a mount namespace of its own. Its memory is locked, and it is not
dumpable. The kernel kills it when tt ends. A run
has two of them: one for the place's make and one for its first copy. A
third job is refused with run tt again.
| November 20, 2026 | Void Linux |