istro

Infrastructure

Storage

Disks, health, pools, snapshots, encryption, cold-file tiering, trash and USB drives.

The Storage page shows your disks, how full they are and what fills them. It also holds the tools that protect and move your data. Backups have their own page: see Backups.

#Disks and Health

Open Storage. The tabs are Disks, Files, Backups and Advanced. Disks lists each disk with its use and health.

bistro storage                  # disks, usage, biggest folders on /srv/data
bistro hwlife report            # age, power-on hours, wear and a score per disk

A weekly timer starts a SMART self-test on each disk. On the first Saturday of the month it runs a long test. A failed result goes to the inbox as urgent. Sleeping disks and SD cards are skipped.

The hwlife score runs from 0 to 100, and higher is worse. At 70 or more, plan a replacement. At 90 or more, replace the disk now. It never removes or formats anything.

bistro hwlife scrub run         # scrub Btrfs and ZFS, repair from the good copy
bistro hwlife ramtest           # test some free RAM with memtester

#Add a New Disk

Format a blank disk to use as the data disk. Bistro refuses a disk that is mounted, in use or holds the root filesystem.

bistro disk format /dev/sdb     # prints the UUID

Put the UUID in DATA_UUID on the Settings page. See Settings.

#Find What Fills a Disk

The Files tab has Biggest Files and Files Stored Twice. Both only read. Nothing is deleted.

bistro big /srv/data            # the 20 biggest files, 100 MB and up
bistro dupes /srv/data          # files of 1 MB and up stored more than once

#Trash

Deletes from the dashboard and the CLI go to the trash first. Items stay for TRASH_DAYS (default 30). A daily timer then removes them.

bistro trash put /srv/data/old
bistro trash list
bistro trash restore ID         # never overwrites an existing file
bistro trash empty --older 7    # asks first, then deletes for good

#Pools and RAID

Pools join disks into one place. There are three kinds.

KindWhat it does
mirrorTwo disks hold the same data (RAID1). One can die.
mergeFolders on several disks show as one folder. A dead disk loses only its files.
paritySnapRAID. A parity disk can rebuild one dead data disk.
bistro pool                     # list pools and health
bistro pool mirror create media /dev/sdb /dev/sdc
bistro pool merge create all /srv/pools/all /mnt/a /mnt/b
bistro pool parity setup tank /mnt/parity /mnt/d1 /mnt/d2

A degraded mirror or a missing merge mount goes to the inbox. Parity syncs and scrubs every week. It skips the sync when more than 50 files were deleted, so a wiped disk cannot wipe the parity.

#Snapshots

On a Btrfs root, Bistro takes read-only snapshots of / and can roll back. An apt hook takes one before packages change.

bistro snap status
bistro snap snapshot "before upgrade"
bistro snap list
bistro snap diff 4              # files changed since snapshot 4
bistro snap rollback 4          # boots into snapshot 4 at the next restart

For ZFS, the same page handles snapshots, scrubs and replication.

bistro snap zfs snapshot tank/data
bistro snap zfs replicate tank/data backup-host --dry-run

#Disk Encryption

Bistro shows which LUKS disks are open and how they unlock. It adds or removes automatic unlock with the TPM chip or a Tang server. It never formats a disk, and it keeps at least one passphrase.

bistro luks status
bistro luks tpm enroll /dev/sdb1
bistro luks tang add /dev/sdb1 http://tang.lan

#Hot and Cold Tiers

Tiering moves old files from the fast disk to a slow disk and leaves a symlink. It is off by default.

bistro tier slow /mnt/slow      # set the slow tier
bistro tier add /srv/data/downloads
bistro tier age 90              # days untouched before a file may move
bistro tier on                  # weekly sweep
bistro tier restore /srv/data/downloads/big.iso

Files under 50 MB, open files and hard-linked files stay. A moved file is copied, compared byte for byte, then replaced by a link.

#USB Drives

A plugged-in USB drive mounts at /media/bistro/LABEL with nosuid, nodev and noexec. A backup drive also copies chosen folders when you plug it in, then unmounts.

bistro usb list
bistro usb detach sdb1          # safe to unplug
bistro usb backup-drive add UUID /srv/data

#Archives

An archive packs a folder into one file on a schedule and keeps the newest few. Formats are tar.gz, tar.zst, zip and 7z.

bistro archive add photos /srv/data/photos /srv/data/archives tar.zst weekly 4
bistro archive run photos
bistro archive once /srv/data/docs /srv/data/archives zip