Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
04-11-2006, 03:56 AM
|
#1
|
|
Member
Registered: Apr 2006
Location: Singapore
Distribution: RHEL4,FC4,FC5
Posts: 89
Rep:
|
How to rename a vol group?
[root@localhost dev]# vgrename stuff store
Volume group "stuff" still has active LVs
as you can see, the LVs are still active and I can't change the name.
How do I stop it so that I can change the name of the VG?
Thanks.
|
|
|
|
04-11-2006, 09:07 AM
|
#2
|
|
Senior Member
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507
Rep:
|
IIRC I did `lvchange -an` the logical volumes first, then `vgrename`, then `lvchange -ay` again.
|
|
|
1 members found this post helpful.
|
04-11-2006, 09:37 AM
|
#3
|
|
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,566
Rep: 
|
uselpa listed the correct procedure. You will probably need to unmount any mounted logical volumes before these commands will work however. I usually do this type of low level stuff from runlevel 1, so filesystem unmounting is easier (no pesky users or processes holding the filesystems open). Also, as opposed to running "lvchange -an" on each logical volume, you can do "vgchange -an" on the volume group and hit all the logical volumes at once. Then after you've renamed, run "vgchange -ay" to activate all the logical volumes with one command.
Don't forget to modify your /etc/fstab entries to reflect the new name of the volume group.
|
|
|
|
04-12-2006, 01:23 AM
|
#4
|
|
Member
Registered: Apr 2006
Location: Singapore
Distribution: RHEL4,FC4,FC5
Posts: 89
Original Poster
Rep:
|
Thanks, it worked.
|
|
|
|
08-22-2007, 12:32 AM
|
#5
|
|
LQ Newbie
Registered: Aug 2007
Distribution: Fedora Core 7
Posts: 7
Rep:
|
Quote:
Originally Posted by haertig
uselpa listed the correct procedure. You will probably need to unmount any mounted logical volumes before these commands will work however. I usually do this type of low level stuff from runlevel 1, so filesystem unmounting is easier (no pesky users or processes holding the filesystems open). Also, as opposed to running "lvchange -an" on each logical volume, you can do "vgchange -an" on the volume group and hit all the logical volumes at once. Then after you've renamed, run "vgchange -ay" to activate all the logical volumes with one command.
Don't forget to modify your /etc/fstab entries to reflect the new name of the volume group.
|
I did go to runlevel 1, and still cannot unmount the logical volumes. When I say 'umount -a' it says 'umount: /: device is busy' and of course, as you mentioned, when I try to do vgchange -an w/o unmounting, it complains. Can you please help with this?
Thanks.
|
|
|
|
08-22-2007, 12:37 AM
|
#6
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,288
|
Do your work from a liveCD that has LVM support.
|
|
|
|
08-22-2007, 12:52 AM
|
#7
|
|
LQ Newbie
Registered: Aug 2007
Distribution: Fedora Core 7
Posts: 7
Rep:
|
Quote:
Originally Posted by syg00
Do your work from a liveCD that has LVM support.
|
Ok, I will try this. Thank you.
|
|
|
|
08-23-2007, 12:14 AM
|
#8
|
|
LQ Newbie
Registered: Aug 2007
Distribution: Fedora Core 7
Posts: 7
Rep:
|
Ok, here is what I did:
- I first edited /etc/fstab to change all "VolGroup00"s to "vg00"s
- I booted with Knoppix 5.1 live cd
- vgrename VolGroup00 vg00 --> success
- Reboot --> I get kernel panic. It says it cannot find VolGroup00. It does the same thing when I edit the kernel arguments to contain root=/dev/vg00/LogVol00 instead of root=/dev/VolGroup00/LogVol00, it does not work.
Thank you in advance for your help
|
|
|
|
08-23-2007, 05:42 PM
|
#9
|
|
LQ Newbie
Registered: Aug 2007
Distribution: Fedora Core 7
Posts: 7
Rep:
|
Quote:
Originally Posted by fenerli
Ok, here is what I did:
- I first edited /etc/fstab to change all "VolGroup00"s to "vg00"s
- I booted with Knoppix 5.1 live cd
- vgrename VolGroup00 vg00 --> success
- Reboot --> I get kernel panic. It says it cannot find VolGroup00. It does the same thing when I edit the kernel arguments to contain root=/dev/vg00/LogVol00 instead of root=/dev/VolGroup00/LogVol00, it does not work.
Thank you in advance for your help
|
Does anyone know what I should do now?
Thank you.
|
|
|
|
08-24-2007, 12:14 AM
|
#10
|
|
Member
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262
Rep:
|
how far did you get before it give you kernel panic? Can you paste your grub.conf and fstab?
|
|
|
|
08-24-2007, 12:42 AM
|
#11
|
|
LQ Newbie
Registered: Aug 2007
Posts: 14
Rep:
|
edit initrd init file contents to change vg references
Hello,
You need to change the contents of the nash init file inside your initrd ramdisk to remove references to your old volume names. There are typically three. The initrd file is ( on Fedora at least ) a compressed loopback filesystem. You need to:
1. gunzip initrd-2.6....img
2. mkdir ramdisk
3. mount -t ext2 -o loop initrd-2.6...img ramdisk
4. cd ramdisk
There will be a nash script which is called init in Fedora and linuxrc on other distros. In my init file there are three references to VolGroup00. These and possibly all others will need to be changed.
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure VolGroup00
resume /dev/VolGroup00/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00
Please change these references in a text editor, umount ramdisk, and recompress (gzip) the edited image. You will also need to, if you haven't already, change all references to the old volume name in the /dev directory. These may have been changed by the rename command.
Let me know if this works.
|
|
|
|
08-24-2007, 05:40 PM
|
#12
|
|
LQ Newbie
Registered: Aug 2007
Distribution: Fedora Core 7
Posts: 7
Rep:
|
Quote:
Originally Posted by tofino_surfer
Hello,
You need to change the contents of the nash init file inside your initrd ramdisk to remove references to your old volume names. There are typically three. The initrd file is ( on Fedora at least ) a compressed loopback filesystem. You need to:
1. gunzip initrd-2.6....img
2. mkdir ramdisk
3. mount -t ext2 -o loop initrd-2.6...img ramdisk
4. cd ramdisk
There will be a nash script which is called init in Fedora and linuxrc on other distros. In my init file there are three references to VolGroup00. These and possibly all others will need to be changed.
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure VolGroup00
resume /dev/VolGroup00/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00
Please change these references in a text editor, umount ramdisk, and recompress (gzip) the edited image. You will also need to, if you haven't already, change all references to the old volume name in the /dev directory. These may have been changed by the rename command.
Let me know if this works.
|
Wow! Thank you very much for the detailed explanations. I appreciate them. For the last couple days, I did not have time to work on it. I will let you know when I try these.
|
|
|
|
08-27-2007, 09:17 AM
|
#13
|
|
LQ Newbie
Registered: Aug 2007
Posts: 14
Rep:
|
old method of accessing intird posted in previous message
Hello,
In my previous message I stated that the initrd file was a compressed loopback filesystem. This was the old method which may be still in use in some distros. The new method in Fedora and other distros is a compressed cpio archive. To access this you need a temporary editing directory in which you will extract the cpio archive contents.
1. mdkir initrd-edit && cd initrd-edit
2. gzip -dc /boot/initrd-2.6...img | cpio -i -c
3. edit contents of directory, specifically init or linuxrc nash script
To repackage the initrd ( or initramfs )
1. cd /initrd-edit
2. find . | cpio --quiet -c -o >../newinitrd
3. cd ..
4. gzip -9 <newinitrd >initrd-2.6...img
5. copy the new initrd image to /boot
As I don't know which distro you use you will have to check which method of initrd creation yours uses. Have a look at the mkinitrd or mkinitramfs bash script ( usually in /sbin ) or simply gunzip the initrd file and look at its file type.
[root@localhost ~]# file initrd*
initrd-2.6.15-1.2054_FC5smp.img: ASCII cpio archive (SVR4 with no CRC)
Let me know if this works.
|
|
|
|
08-27-2007, 11:59 PM
|
#14
|
|
LQ Newbie
Registered: Aug 2007
Distribution: Fedora Core 7
Posts: 7
Rep:
|
Quote:
Originally Posted by tofino_surfer
Hello,
In my previous message I stated that the initrd file was a compressed loopback filesystem. This was the old method which may be still in use in some distros. The new method in Fedora and other distros is a compressed cpio archive. To access this you need a temporary editing directory in which you will extract the cpio archive contents.
1. mdkir initrd-edit && cd initrd-edit
2. gzip -dc /boot/initrd-2.6...img | cpio -i -c
3. edit contents of directory, specifically init or linuxrc nash script
To repackage the initrd ( or initramfs )
1. cd /initrd-edit
2. find . | cpio --quiet -c -o >../newinitrd
3. cd ..
4. gzip -9 <newinitrd >initrd-2.6...img
5. copy the new initrd image to /boot
As I don't know which distro you use you will have to check which method of initrd creation yours uses. Have a look at the mkinitrd or mkinitramfs bash script ( usually in /sbin ) or simply gunzip the initrd file and look at its file type.
[root@localhost ~]# file initrd*
initrd-2.6.15-1.2054_FC5smp.img: ASCII cpio archive (SVR4 with no CRC)
Let me know if this works.
|
Thank you very much, I could not look into this because I found some problem with the MoBo  I am getting a replacement. When I get it, I will work on this too. Thank you again for detailed answers.
|
|
|
|
08-28-2007, 01:07 AM
|
#15
|
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591
Rep:
|
Or you can just use mkinitrd from the live CD to regenerate initrd.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:26 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|