Skip to content

feat(volumectl): move app volumes to another disk - #1399

Merged
DavidePrincipi merged 1 commit into
mainfrom
feat-8259
Nov 12, 2026
Merged

DavidePrincipi merged 1 commit into
mainfrom
feat-8259

Conversation

@DavidePrincipi

@DavidePrincipi DavidePrincipi commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

When an installed application fills the main disk, today the only way to move its data to an additional disk is to clone the application and remove the original: it is slow, needs twice the space and changes the application name. This PR adds a command that moves one data volume of an installed application in place. NethServer/dev#8259

The new volumectl move-volume command works in two steps. The first step (--sync) copies the data while the application keeps running, and can be repeated: each run copies only what changed. The second step (without --sync) stops the application, copies the last changes, switches the volume to the new location and starts the application again, so the downtime is short. Nothing changes for existing installations until the command is used, and the new command supports only rootless applications.

  • If a step fails, or the admin interrupts it with Ctrl-C, the original volume is put back and the application is started again.
  • The second step refuses to run while the application is busy with a task, unless --force is given.
  • After a successful move, the old copy of the data is deleted in the background, so it does not add to the downtime.
  • Bash completion and the developer manual (docs/modules/volumes.md) are updated.

How to test

  1. On a node with an additional disk (see volumectl list-base-paths), install a rootless application that has a data volume, for example Mail.
  2. Copy the volume while the application runs: volumectl move-volume dovecot-data --for mail1 --target /mnt/disk00 --sync.
  3. Finalize the move: volumectl move-volume dovecot-data --for mail1 --target /mnt/disk00. The application restarts, its data is on the additional disk and the old copy is removed.
  4. Move the volume back to the main disk with the same two commands and --target /, and check that the application still works.

Generated by Claude Code:claude-haiku-5-5 with nethserver-pr

@DavidePrincipi DavidePrincipi self-assigned this Nov 10, 2026
@DavidePrincipi DavidePrincipi changed the title feat(volumectl): move an app volume to another disk feat(volumectl): move app volumes to another disk Nov 10, 2026
Move the data of an installed rootless application volume to another
base path, or back to the default disk, without cloning the
application.

The --sync step copies the data while the application is running, and
can be repeated. The finalize step stops the module user session (with
its runtime directory, so Podman starts from a clean state), copies the
last changes, recreates the volume with Podman run through runuser, and
starts the session again. Old data is moved aside and removed in
background, to keep the downtime short.

Finalize refuses to run while the module agent is running a task,
unless --force is given. On failure or interruption the original volume
is restored and the session is started again.

The developer manual describes the procedure.

Assisted-by: Claude Code:claude-opus-5-5
Comment thread core/imageroot/usr/local/bin/volumectl Resolved
@DavidePrincipi
DavidePrincipi merged commit 36f0f40 into main Nov 12, 2026
4 checks passed
@DavidePrincipi
DavidePrincipi deleted the feat-8259 branch November 12, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants