LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-09-2020, 10:50 AM   #1
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 359

Rep: Reputation: 56
Unable to change Volume Group name


Hello All

I want to change the name of the volume group from deb-vg to vgd. The OS is Debian 10 in the KVM Lab environment.

Settings before:
Code:
root@deb:~# vgs
  VG     #PV #LV #SN Attr   VSize  VFree
  deb-vg   1   2   0 wz--n- <9.76g    0 

root@deb:~# lvs
  LV     VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   deb-vg -wi-ao---- <8.76g                                                    
  swap_1 deb-vg -wi-ao----  1.00g                                                    

root@deb:~# cat /etc/fstab
/dev/mapper/deb--vg-root /               ext4    errors=remount-ro 0       1
UUID=3ddccc19-e6ab-40ba-8302-08e25e40227e /boot           ext2    defaults        0       2
/dev/mapper/deb--vg-swap_1 none            swap    sw              0       0

root@deb:~# cat /etc/initramfs-tools/conf.d/resume 
RESUME=/dev/mapper/deb--vg-swap_1
Following are the steps I did
Code:
root@deb:~# vgrename deb-vg vgd
  Volume group "deb-vg" successfully renamed to "vgd"

root@deb:~# vgs
  VG  #PV #LV #SN Attr   VSize  VFree
  vgd   1   2   0 wz--n- <9.76g    0 

root@deb:~# lvs
  LV     VG  Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   vgd -wi-ao---- <8.76g                                                    
  swap_1 vgd -wi-ao----  1.00g                                        

root@deb:~# vim /etc/fstab
/dev/mapper/vgd-root /               ext4    errors=remount-ro 0       1
UUID=3ddccc19-e6ab-40ba-8302-08e25e40227e /boot           ext2    defaults        0       2
/dev/mapper/vgd-swap_1 none            swap    sw              0       0


root@deb:~# vim /etc/initramfs-tools/conf.d/resume 
RESUME=/dev/mapper/vgd-swap_1

root@deb:~# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.19.0-9-amd64

root@deb:~# update-grub2
/usr/sbin/grub-probe: error: failed to get canonical path of `/dev/mapper/deb--vg-root'.
I don't know from where the above error is coming. Then, when I reboot, I get stuck (screenshot attached).

What I'm doing wrong? How to properly rename VG?

Thanks
Attached Thumbnails
Click image for larger version

Name:	error.png
Views:	111
Size:	24.4 KB
ID:	33360  
 
Old 06-09-2020, 12:54 PM   #2
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 359

Original Poster
Rep: Reputation: 56
Figured it out.

The following are the new steps I followed. Bold ones are the ones that I had missed earlier.
  1. Run the command
    # vgrename actualName NewName
  2. Edit /boot/grub/grub.cfg and change all the entries with the new name.
  3. Edit /etc/fstab and change all the entries with the new name.
  4. Edit /etc/initramfs-tools/conf.d/resume and replace the old name with the new one.
  5. Rebuild an initramfs:
    # update-initramfs -u -k all
  6. Reboot
  7. Rebuild grub2
    # update-grub2

Working fine now. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
Map/Mount Volume Group Folder to Volume Group Folder??? Led Zappa Linux - Newbie 4 09-21-2013 04:12 PM
[SOLVED] Redhat volume group,logical volume group dhairysheel Red Hat 3 08-02-2011 05:07 AM
Corrupted Volume: fsck shows thousands of group descriptor errors on ext4 volume. abejarano Linux - General 2 04-21-2011 06:49 AM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:10 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions