lvrename
Rename existing logical volumes
SYNOPSIS
lvrename [OPTIONS] OldLogicalVolumePath NewLogicalVolumePath
lvrename [OPTIONS] VolumeGroupName OldLogicalVolumeName NewLogicalVolumeName
PARAMETERS
-y, --yes
Assume yes to all questions.
-f, --force
Proceed without prompting.
-v, --verbose
Show verbose information.
-h, --help
Display help message.
--noudevsync
Disable udev synchronization. Use with caution in scripts.
DESCRIPTION
lvrename is a utility used to rename a logical volume (LV) in the Logical Volume Manager (LVM) system. It allows administrators to change the name of an existing logical volume, which can be useful for organizational purposes or when re-purposing storage.
The command can rename a logical volume by specifying its current full path (e.g., /dev/VolumeGroup/LogicalVolumeName) to a new full path, or by providing the volume group name, old logical volume name, and new logical volume name. Renaming an active logical volume is generally safe, as lvrename updates the LVM metadata accordingly. However, it's crucial to update any applications or scripts that refer to the old path or name after the rename operation is complete. This command primarily modifies LVM metadata and does not affect the data stored on the logical volume itself.
CAVEATS
While renaming an active LV is usually safe, any applications or entries in /etc/fstab referring to the old name or path must be updated manually after the rename operation. If the LV is mounted, the mount point will still refer to the old path until remounted or the system restarts. It's generally a good practice to unmount the logical volume if possible before renaming it.
PATH VS. NAME
lvrename can operate using full device paths (e.g., /dev/vg_name/lv_name) or by specifying the volume group name and old/new logical volume names separately. Both methods achieve the same result of updating the LVM metadata.
UPDATING FSTAB
After renaming a logical volume that is automatically mounted at boot, it is crucial to update the corresponding entry in /etc/fstab to reflect the new logical volume path or UUID/LABEL if those are used for mounting. Failure to do so will result in mount failures on reboot.
HISTORY
LVM (Logical Volume Manager) has been a fundamental part of Linux storage management for many years, offering a more flexible alternative to traditional partitioning. lvrename, as a core LVM utility, has been present since the early versions of LVM2, which became the standard in Linux distributions around the early 2000s, replacing the older LVM1. Its consistent functionality reflects the stable and mature nature of LVM for managing logical volumes.