LinuxCommandLibrary

pct-move_volume

Move container storage volumes

TLDR

View documentation for the original command

$ tldr pct move-volume
copy

SYNOPSIS

pct-move_volume <vmid> <volume-name> <target-storage-id> [OPTIONS]

PARAMETERS

vmid
    The unique identifier (numeric ID) of the Proxmox LXC container whose volume is to be moved.

volume-name
    The identifier for the specific volume within the container to move. This could be rootfs for the primary disk, or an identifier like mp0, mp1 for additional mounted disks.

target-storage-id
    The identifier of the destination storage pool where the volume should be moved (e.g., local-lvm, nfs-share, ceph-rbd).

-d, --delete-source
    If specified, the original volume on the source storage will be deleted after the move operation successfully completes. Use with caution.

--dry-run
    Simulate the move operation without actually making any changes to the volumes or storage. Useful for testing the command and verifying parameters.

-v, --verbose
    Enable verbose output, providing more detailed information about the progress and steps taken during the volume move.

--wait
    Wait for the move operation to complete before the command exits. By default, some long-running operations might return immediately and run in the background.

DESCRIPTION

The pct-move_volume command is designed to facilitate the migration of storage volumes associated with Proxmox LXC containers. This utility allows administrators to relocate a container's disk image or other attached volumes from one storage pool to another within a Proxmox Virtual Environment (PVE) cluster. It's particularly useful for storage rebalancing, upgrading underlying storage hardware, or changing the storage type (e.g., from local storage to shared network storage like NFS or CEPH).

The process typically involves detaching the volume from the container, copying its data to the specified target storage, and then reattaching it. For data integrity and consistency, the container usually needs to be stopped during the move operation, though some advanced systems might support live migration of storage. This command streamlines what would otherwise be a complex manual process involving low-level storage operations.

CAVEATS

The container associated with the volume typically needs to be stopped before initiating a move operation to prevent data corruption.
Ensure the target storage has sufficient free space to accommodate the volume.
Moving large volumes can be time-consuming and resource-intensive, potentially impacting other operations on the PVE host.
Data integrity is paramount; always back up critical data before performing storage migration operations.
Compatibility between source and target storage types must be considered (e.g., raw images vs. qcow2, block storage vs. file-based).

PREREQUISITES

This command requires a running Proxmox Virtual Environment (PVE) installation with appropriate permissions. The user executing the command must have administrative rights or specific permissions to manage containers and storage volumes on the PVE host.

SECURITY CONSIDERATIONS

Moving volumes involves sensitive data. Ensure that the target storage is secure and that network paths (if applicable) are protected. Improper permissions or network access could expose data during or after the migration.

HISTORY

While pct-move_volume is not a standard, universally distributed Linux command, its naming convention strongly suggests it's a specialized script or utility within the Proxmox Virtual Environment (PVE) ecosystem. Such tools often evolve from administrators' needs to automate repetitive and error-prone manual tasks. Initially, moving volumes might have involved a sequence of pvesm commands, dd or rsync operations, and manual configuration file edits. Over time, these steps get encapsulated into helper scripts like this one to provide a simpler, more robust, and less error-prone interface for common management actions, especially within a complex system like Proxmox VE which heavily relies on command-line tools for automation and orchestration.

SEE ALSO

pct(1) (Proxmox Container Toolkit), qm(1) (Proxmox QEMU/KVM Virtual Machine Manager), pvesm(1) (Proxmox Storage Manager), mv(1) (Move or rename files), dd(1) (Convert and copy a file)

Copied to clipboard