Search This Blog

Wednesday, February 27, 2013

How to change the name of a logical volume

How to change the name of a logical volume

ibtest:/root#bdf /usr/sap/ZH1/EXT

Filesystem          kbytes    used   avail %used Mounted on
/dev/vgusrsapall/usrsapZH1
                   20971520   67432 20740784    0% /usr/sap/ZH1/EXT

Make the note of the device file

ibtest:/root#ll /dev/vgusrsapall/usrsapZH1
brw-r-----   1 root       sys         64 0x02000f Dec  6 19:31 /dev/vgusrsapall/usrsapZH1

ibtest:/#umount /usr/sap/ZH1/EXT

ibtest:/dev/vgusrsapall#mv rusrsapZH1 rusrsap
ibtest:/dev/vgusrsapall#mv usrsapZH1 usrsap

# mknod /dev/vgusrsapall/usrsap b 64 0x02000f

# mknod /dev/vgusrsapall/rusrsap c 64 0x02000f

#vi /etc/fstab {reflect the new logical volume }


# mount -a


#rmsf /dev/vgusrsapall/usrsapZH1

#rmsf /dev/vgusrsapall/rusrsapZH1

Or
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.

Thank you for Reading,

For Reading other article, visit to “https://sites.google.com/site/unixwikis/

No comments:

Post a Comment