Linux - GeneralThis 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.
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.
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?
- 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.
- 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.
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.
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.
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.
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.
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)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.