pvmove
Move physical extents between physical volumes
SYNOPSIS
pvmove [OPTIONS] [SOURCE_PV[:PE[-PE]...]] [DEST_PV[:PE[-PE]...]...]
pvmove [OPTIONS] SOURCE_PV
pvmove --abort
PARAMETERS
SOURCE_PV
The physical volume from which extents will be moved. Can be optionally followed by extent ranges (e.g., 'pv_name:100-200').
DEST_PV
The physical volume(s) to which extents will be moved. Optional if moving all data off a source PV.
--alloc allocation_policy
Specifies the allocation policy for new physical extents (e.g., 'normal', 'contiguous', 'anywhere').
-b, --background
Runs the pvmove process in the background, allowing the terminal to be freed.
-i seconds, --interval seconds
Reports progress at specified time intervals, updating the status of the move.
--atomic
Attempts to move all data in one go, without allowing partial completion. Use with caution for large moves as it consumes significant resources.
--abort
Aborts a currently running or suspended pvmove operation.
--nofsck
Skips filesystem consistency checks. Use with extreme caution as it bypasses critical safeguards and may lead to data corruption if the filesystem is not clean.
--profile profile_name
Applies a configuration profile from the LVM configuration file to the command.
-v, --verbose
Increases the verbosity of the command's output, showing more details about the operation.
-y, --yes
Assumes 'yes' to all questions, bypassing interactive prompts and proceeding with the operation automatically.
--noui, -j
Suppresses the interactive user interface for progress reporting, useful for scripting.
DESCRIPTION
pvmove is a crucial command within the Linux Logical Volume Manager (LVM) suite. It enables administrators to move allocated physical extents from one physical volume (PV) to another within the same volume group (VG). This operation is frequently performed to free up space on a specific PV, remove a PV from a volume group (e.g., before decommissioning a disk), replace a failing physical disk, or rebalance data across PVs for improved performance or redundancy.
The process involves identifying the extents to be moved and copying them to designated target PVs, updating LVM metadata as it progresses. pvmove can operate on specific logical volumes, specific source PVs, or automatically move all data off an entire PV. Crucially, pvmove can be a long-running operation, especially with large amounts of data, and it is designed to be resumable and safe against system reboots during the move.
CAVEATS
Moving data can be a lengthy process (potentially hours or days for large PVs) and may temporarily impact the I/O performance of affected logical volumes.
Ensure sufficient free extents on target physical volumes before initiating a move, as insufficient space will cause the operation to fail.
While pvmove is designed to be resumable across reboots, it's crucial to ensure system stability during the operation.
The --nofsck option should be used with extreme caution as it bypasses critical filesystem checks and could lead to data corruption if the underlying filesystem has issues.
PROGRESS MONITORING
During a pvmove operation, progress can be monitored by running pvmove in a separate terminal with the -i or --interval option, or by simply running pvmove without any arguments (which will display the status of any active moves).
RESUMING A MOVE
If a pvmove operation is interrupted (e.g., by a system reboot or power failure), it can usually be resumed by simply running pvmove without any source or destination arguments. LVM automatically detects and continues any suspended moves when the command is re-executed.
HISTORY
The Logical Volume Manager (LVM) framework, which includes pvmove, has been a core component of Linux storage management since its integration in the 2.4 kernel series. pvmove itself was introduced as a fundamental utility to provide online data migration capabilities, allowing administrators to move data between physical volumes without system downtime. This capability has been crucial for tasks such as decommissioning old disks, replacing failing hardware, or rebalancing storage, evolving alongside the increasing demand for flexible and dynamic storage solutions in enterprise and data center environments.