Skip to main content

Docker Storage Setup

Docker should enforce a per-container storage limit; without it a renter can write past the slice they paid for. GPU splitting stays locked until the host passes the check below. The recommended setup is the overlay2 driver on an xfs filesystem mounted with pquota and ftype=1. The lium CLI builds it for you.

Check the host first​

Run the platform's check:

sudo docker run --rm --storage-opt size=1g --gpus all daturaai/compute-subnet-executor:latest nvidia-smi

Then check the driver:

sudo docker info --format '{{.Driver}}'

Turn off the containerd image store​

With this store, image layers live under /var/lib/containerd on the root disk, whatever Docker's data directory is. Docker 29 and later turn it on for fresh installs unless /etc/docker/daemon.json sets "storage-driver".

Keep ctr on the host while the store is on

The checks ask Docker's containerd where it keeps containers with containerd's ctr CLI (Docker's containerd.io package ships it). Check that it answers on Docker's own containerd address:

sudo ctr --address "$(sudo docker info --format '{{with .Containerd}}{{.Address}}{{end}}')" plugins ls -d

Drain the node

Before changing Docker's configuration, click Pause New Rentals and wait until every rental on the node has ended. Switching image stores hides the existing images and containers.

Disable it

Add this to /etc/docker/daemon.json, then restart Docker:

"features": { "containerd-snapshotter": false }
sudo systemctl restart docker

Re-check

sudo docker info --format '{{.Driver}}'
df -h "$(sudo docker info --format '{{.DockerRootDir}}')"

Expect overlay2. If Docker's root is still on the small disk or the check still fails, complete Pick a device and the storage setup below before recreating the node software.

Recreate the node software

Once the check passes, recreate it; its images pull again:

cd ~/compute-subnet/neurons/executor && docker compose up -d --force-recreate

Resume rentals

Once the node software is running, click Resume New Rentals. The pause stays on until you do, and a paused node gets no new rentals or idle pay.

Docker data on a loop image​

Check whether Docker's data is on a loop device, and whether direct I/O is on:

df "$(sudo docker info --format '{{.DockerRootDir}}')"
losetup -l -O NAME,BACK-FILE,DIO

A /dev/loopN with DIO 1 is fine. With DIO 0, one pod writing heavily can stall Docker, and the node is delisted. The installer reports this as a FIX.

Turn on direct I/O

With no rental running:

sudo losetup --direct-io=on /dev/loopN

It resets on reboot. To keep it, follow the executor guide.

Or move to a real disk

If Docker's data is at /var/lib/docker, use Pick a device, then Run the storage setup.

Pick a device​

Use a fresh extra SSD or NVMe disk, unused and unmounted. Do not pre-format it; the CLI does that.

The CLI refuses the root disk, the disk behind /var/lib/docker, a mounted device, a disk with other data and a loop or device-mapper target. A single-disk host needs no extra disk: see Single-disk hosts.

Find it

lsblk -o NAME,PATH,TYPE,FSTYPE,SIZE,MOUNTPOINTS
findmnt /
findmnt /var/lib/docker

Run the storage setup​

Destructive

setup stops Docker, formats the device as XFS and remounts /var/lib/docker. It backs up Docker data first, but keep your own backup on a host with live containers.

lium gpu-splitting check --device /dev/<device>
sudo lium gpu-splitting setup --device /dev/<device>
lium gpu-splitting verify
  • check prints the plan and changes nothing.
  • setup migrates Docker storage.
  • verify confirms the result.

lium mine runs the same check on every install. An interactive install as root offers this setup when the host fails it; --auto, --register and non-interactive installs print the command to run separately.

Single-disk hosts​

With no spare disk, the CLI keeps Docker storage in an XFS image file on the filesystem with the most free space, mounted at /var/lib/docker through a loop device with pquota. The limit works the same way.

Install Ubuntu with one root partition (ext4 or XFS) over the whole disk: no separate Docker partition and no unallocated space. The CLI never repartitions or formats the system disk: it does not format another partition on it, mounted or blank, and does not use unallocated space. With a separate /var/lib/docker partition and without --file or --size, it stops with an error; otherwise it puts the image file at the --file path or on the filesystem with the most free space, which must be large enough for it.

The filesystem that stores the file must be ext2, ext3, ext4, XFS or f2fs. The CLI refuses this setup on btrfs or ZFS.

A udev rule turns on direct I/O for the loop device where the kernel allows it (it refuses on disks with 4K logical sectors; the file still works, a bit slower), which keeps the loop's overhead small: in our tests pod creation and disk speed matched a plain partition.

sudo lium gpu-splitting check
sudo lium gpu-splitting setup
sudo lium gpu-splitting verify
  • The file takes the free space minus a reserve for the system: 10% of the filesystem, at least 20 GiB. Allow extra for XFS metadata. The CLI verifies the two rules below and refuses with the numbers when either fails; --size must pass both checks too.
  • Free space: the node reports the filesystem inside the file as its disk, so the setup requires at least 100 GiB free in it after the existing Docker data moves in, plus about 40 GiB for the node images while they are not on the host yet (the CLI reads them from the lium mine checkout, compute-subnet in the current directory or --mine-dir). The marketplace lists a node only with 100 GiB free. The CLI verifies this after restoring the data.
  • VRAM: the usable capacity must reach 1.5x the total VRAM of the host's GPUs; under that, the validator pays no idle incentive. The CLI checks this when it can read GPU memory.
  • --file <path> and --size <GiB> pick the file's location and size. Every directory on the path must be owned by root, writable by root only and not a symlink (for example /var/lib), or the setup refuses. The file is preallocated and the loop device refuses discard, so neither other files on the host nor a scheduled fstrim can take the pool's space back. The file cannot shrink later.
  • When /var/lib/docker is already its own mount, the CLI does not offer the file by itself, because that would leave Docker's disk unused: format a spare disk with --device, or pass --file with a path on another filesystem to use an image file anyway.
  • check prints the file, its size and the reserve; setup asks you to type the file path before it changes anything.
  • Docker must run with no running containers; setup stops it for the move. Run it on a node with no rentals.
  • Setup masks docker.service from the moment it stops Docker until the data is restored and verified, so a reboot in the middle does not start Docker on an empty data root. If that happens, put the host back by hand before unmasking:
    1. Unmount /var/lib/docker if the image or the new partition is mounted there.
    2. In /etc/fstab, remove the /var/lib/docker line the setup wrote. If /var/lib/docker was its own mount, the setup replaced that disk's line: put it back (blkid shows the disk's UUID), or the old disk stays unmounted after the next reboot.
    3. Remove the docker.service drop-in and the udev rule the setup named in its output.
    4. If /var/lib/docker was its own mount, remount the original Docker filesystem there. Otherwise, if the data is still in /var/lib/docker, the backup directory the setup printed is a copy you can delete; if /var/lib/docker is empty, remove it with rmdir (stop if that fails); then, or if it does not exist, move the backup directory back to /var/lib/docker. A mv onto an existing directory puts the backup inside it.
    5. For an image file: once losetup -j <file> prints nothing, delete the file. It still holds its space, and the setup refuses to create a file where one exists.
    6. Run systemctl unmask docker && systemctl start docker, and start the setup again when the node is idle.
  • Docker 29 hosts on the containerd image store are switched to overlay2. Images and containers in the old store become unavailable, and the setup refuses to run while any container exists there.
  • Before removing those containers, copy out what you need: docker save keeps images only, not a container's own files. Save images you cannot pull again.
  • Afterwards load or pull the images and recreate the containers, or run lium mine again to bring the node's own containers back.

Verify the host​

docker info
findmnt /var/lib/docker

Look for Storage Driver: overlay2, Backing Filesystem: xfs, Supports d_type: true, and pquota or prjquota on the mount.

Manual setup​

Without the CLI: stop Docker, format the partition as XFS with ftype=1, mount it at /var/lib/docker with pquota, restore the data and start Docker.

To use several disks as one RAID0 (mdadm) or LVM volume (joining the disks wipes them):

  1. Pause New Rentals and wait until no rental runs: stopping Docker stops every pod. Then stop Docker and run the block's first rsync. /tmp/docker-backup/ must be on a disk outside the volume with room for all of /var/lib/docker (sudo du -sh /var/lib/docker). Go on only if the rsync ends without an error.
  2. If /var/lib/docker is its own mount, unmount it and remove its line from /etc/fstab.
  3. Create the volume, set new_partition to it (for example /dev/md0), and run the block from mkfs.xfs on. It stops at the first failed command and starts Docker only after the restore succeeds; if it stops, fix the cause and do not start Docker.
  4. Run Verify the host, then resume rentals.
sudo systemctl stop docker docker.socket

# /etc/docker/daemon.json must set "storage-driver": "overlay2"

new_partition=<your-new-partition-device-name>
sudo rsync -aHAXS /var/lib/docker/ /tmp/docker-backup/
sudo mkfs.xfs -n ftype=1 "$new_partition" -f \
&& sudo mount -t xfs -o defaults,inode64,pquota "$new_partition" /var/lib/docker \
&& mountpoint -q /var/lib/docker \
&& sudo rsync -aHAXS /tmp/docker-backup/ /var/lib/docker/ \
&& UUID=$(sudo blkid -s UUID -o value "$new_partition") \
&& echo "UUID=${UUID} /var/lib/docker xfs defaults,inode64,pquota 0 2" | sudo tee -a /etc/fstab \
&& sudo systemctl start docker

Next step (GPU splitting only)​

Set the minimum GPU count in the portal: Managing Nodes → Setting Minimum GPU Count for Rental.