From Wiki-UX.info

Wiki-UX / Logical Volume Manager / How to change the name of a logical volume
Jump to: navigation, search

How to change the name of a logical volume

Abstract

This article explains how to change the name of a LVM logical volume renaming (moving) the corresponding device special files.

Contents


Procedure

Changing the name of logical volume "/dev/vg01/lvol1" to "/dev/vg01/data1" on volume group "vg01".

1. Check the current volume group special device files.

# ll /dev/vg01/*
crw-r-----   1 root       sys         64 0x010000 Oct 11 10:37 /dev/vg01/group
brw-r-----   1 root       sys         64 0x010001 Oct 11 10:45 /dev/vg01/lvol1
crw-r-----   1 root       sys         64 0x010001 Oct 11 10:45 /dev/vg01/rlvol1

2. Unmount the filesystem. You need to stop any active process on the logical volume.

# umount /dev/vg01/lvol1

3. Disable the volume group.

# vgchange -a n /dev/vg01
Volume group "/dev/vg01" has been successfully changed.

4. Rename the block and character device special files.

# mv /dev/vg01/lvol1 /dev/vg01/data1
 
# mv /dev/vg01/rlvol1 /dev/vg01/rdata1

5. Enable the volume group

# vgchange -a y /dev/vg01
Activated volume group
Volume group "/dev/vg01" has been successfully changed.

Edit the corresponding entries in /etc/fstab to point to the new volume group paths.

Reference

Authors

This page was last modified on 18 July 2010, at 02:22. This page has been accessed 3,225 times.