Rename Root Logical Volume group?

Hello,

I'm running Ubuntu 12.04. I need to rename my root logical volume group and it's bootmanager/fstab accordingly.

Here is the output: I need to change the HP-TEST001 to PRODGROUP01. Please advice me.

root@PROD-02:/home# vgdisplay
--- Volume group ---
VG Name HP-TEST001
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 9.76 GiB
PE Size 4.00 MiB
Total PE 2498
Alloc PE / Size 2498 / 9.76 GiB
Free PE / Size 0 / 0
VG UUID vMIkzy-BCSa-bSHb-zt84-2xZ4-Xidm-zf46xB


root@PROD-02:/home# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/mapper/HP--TEST001-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=29b6596c-j4r2-47db-9890-c654c9ca4c46 /boot ext2 defaults 0 2
/dev/mapper/HP--TEST001-swap_1 none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0


root@PROD-02:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/HP--TEST001-root 9.3G 1.5G 7.4G 17% /
udev 2.0G 4.0K 2.0G 1% /dev
tmpfs 791M 268K 791M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 0 2.0G 0% /run/shm
/dev/sda1 228M 27M 189M 13% /boot

Not to be too short, but

# man vgrename

edit fstab

/dev/PRODGROUP01/root / ext4 errors=remount-ro 0 1

I managed to fix it. Here are the steps:

  1. Boot into Ubuntu � Rescue mode
  2. Do not mount the root file system
  3. lvm vgscan
  4. Deactivate the volume group
  • a. vgchange �a n VOLUME-GROUP-NAME
    b. lvm lvscan
  1. Rename the volume group
  • a. lvm vgrename OLD-NAME NEW-NAME
    b. lvm lvscan
    c. It will be activated automatically, if not type vgchange �a y NEW-VOLUME-GROUP-NAME
  1. Exit and choose different file system
  • a. select ROOT file system
  1. Backup /etc/fstab file
  • a. cp �p /etc/fstab /etc/fstab.old
  1. Edit /etc/fstab and replace OLD-NAME
  • a. vi /etc/fstab
    b. :%s/OLD--NAME/NEW-NAME/g
  1. If /boot is empty, then mount /dev/sda1
  • a. mount /dev/sda1 /boot
  1. Install grub and update it.
  • a. grub-install /dev/sda
    b. update-grub
  1. Exit and reboot the server.
  2. Boot from hard disk.