Your data disk
On this page
Everything people keep in , their files, photos, mail, apps' data, the Sols and the AI models, can live on a disk of its own. The system (Linux, Docker and ’s own files in /opt/solel) stays on the system disk. That keeps the two apart:
- Reinstalling or replacing the system leaves people’s data where it is.
- The data disk is formatted btrfs, which checks every block it reads, so a disk quietly corrupting files is caught rather than copied into your backups.
- It can be encrypted, so a data disk that’s removed, sent off for repair or thrown out gives nothing away.
- It can be mirrored onto a second disk, so your data survives either disk failing.
A data disk isn’t needed. Without one, keeps everything on the system disk, as it always has.
At install time# Link to: At install time
The installer looks for a spare disk: a whole disk of at least 32 GB with nothing on it, no partitions and no file system, that isn’t a USB drive. It never offers the disk the system is on.
If there is one, it asks, with no as the answer if you just press Enter:
- Erase it and keep your data on it? Everything on that disk is lost, which is why it only asks about empty ones.
- Mirror it onto a second disk as well? Only when there’s a second spare disk.
- Encrypt it? Yes if you just press Enter.
With --yes, or with nobody at the keyboard, it never erases a disk. Name the disk instead:
curl -fsSL https://solel.io/install | SOLEL_DATA_DISK=/dev/sdb sh -s -- --yes
curl -fsSL https://solel.io/install | SOLEL_DATA_DISK="/dev/sdb /dev/sdc" sh -s -- --yesThe second line mirrors the two disks. Named disks are encrypted unless you add SOLEL_ENCRYPT=0. A named disk that isn’t empty stops the install before anything changes.
How it’s set up# Link to: How it's set up
- The disk (or both, for a mirror) is formatted btrfs, labelled
solel-data, with light compression. - It’s mounted where Docker keeps its volumes,
/var/lib/docker/volumeson most systems, so every volume and its apps make lands on it. /etc/fstabmounts it at start-up, and Docker waits for it. If the disk is missing, Docker doesn’t start, rather than quietly making empty volumes on the system disk.- Anything already in Docker’s volumes is copied across. The old folder is kept beside it as
volumes.before-solel-disk; delete it once is running.
Encryption# Link to: Encryption
An encrypted data disk uses LUKS2. It unlocks at start-up with a key kept on the system disk, in /etc/solel/keys/data.key, readable only by root, so the server starts on its own after a power cut.
The installer also shows a recovery key, eight groups of five letters and digits, once, at the end. Write it down and keep it away from the server. If the system disk is lost, the recovery key is the only way to open the data disk.
This protects a data disk on its own. Someone who takes the whole server has the key on its system disk too. To protect against that, encrypt the system disk when you install Linux; Settings › Storage shows whether it is.
The secrets keeps, like API keys, passwords for other services and private keys, are encrypted in its database as well, whichever disk it’s on.
Adding a disk later# Link to: Adding a disk later
solel-disk does the same on a server that’s already running. The installer leaves it in /usr/local/sbin.
To see which disks it could use:
sudo solel-disk candidatesTo move ’s data onto one, encrypted:
sudo solel-disk prepare --encrypt /dev/sdbIt stops Docker while it copies, so is away for a few minutes, longer with a lot of photos. It prints the recovery key at the end. Leave out --encrypt for an unencrypted disk.
To mirror the data disk onto a second disk, use Add a mirror in Settings › Storage, or:
sudo solel-disk mirror /dev/sdckeeps running. The copy onto the new disk carries on by itself and can take hours on a big disk. If the data disk is encrypted, the new disk is too, and gets a recovery key of its own.
To see how it’s set up, as JSON:
sudo solel-disk statusA server installed before solel-disk came in doesn’t have it yet. Fetch it from the latest release:
curl -fsSL https://github.com/Solel-io/releases/releases/latest/download/solel-os-server.tar.gz | tar -xzO solel-os/solel-disk | sudo tee /usr/local/sbin/solel-disk >/dev/null
sudo chmod 755 /usr/local/sbin/solel-diskMoving to a new system# Link to: Moving to a new system
Install Linux on the new system disk, then with the installer, answering no to the data disk. Then stop Docker, mount the data disk where Docker keeps its volumes, and start Docker again. For an encrypted disk, unlock it with the recovery key first:
sudo systemctl stop docker.socket docker.service
sudo cryptsetup open /dev/sdb solel-data0
sudo mount -o subvol=@volumes,compress=zstd:1,noatime /dev/mapper/solel-data0 /var/lib/docker/volumes
sudo systemctl start dockerFor an unencrypted disk, leave out the cryptsetup line and mount /dev/sdb itself. Add the same mount to /etc/fstab so it’s there after a restart.