Alfred von Campe
2008-May-02 21:04 UTC
[CentOS] Is it possible to lvrename the current root partition?
I'd like to rename my existing volume groups and logical volumes (I picked names a long time ago I no longer like :-). I recently stumbled across the lvrename and vgrename commands, but when I tried the former to rename the logical volume that my root partition resides on, the system became unbootable. In addition to renaming the LV (and VG if I decide to to that as well), what else needs to be changed? So far my list includes: o /etc/fstabb o /boot/grub/grub.conf o /dev/<vgname>/<lvnamex> o /dev/mapper/<vgname-lvnamex> I was hoping the lvrename and/or vgrename would take care of these details. Are there any scripts out there that take care of all the details? If not, I may write one (once I have the recipe to get this working, of course). Alfred
Joshua Gimer
2008-May-02 21:19 UTC
[CentOS] Is it possible to lvrename the current root partition?
I have never done this before, but I would think that the only thing that you would have to change would be fstab and your grub configuration. vgrename and lvrename did not recreate items under /dev? Did you get the system booting or is this more of just a list for a script that you are planning to create? Josh Gimer On May 2, 2008, at 3:04 PM, Alfred von Campe wrote:> I'd like to rename my existing volume groups and logical volumes (I > picked names a long time ago I no longer like :-). I recently > stumbled across the lvrename and vgrename commands, but when I tried > the former to rename the logical volume that my root partition > resides on, the system became unbootable. > > In addition to renaming the LV (and VG if I decide to to that as > well), what else needs to be changed? So far my list includes: > > o /etc/fstabb > o /boot/grub/grub.conf > o /dev/<vgname>/<lvnamex> > o /dev/mapper/<vgname-lvnamex> > > I was hoping the lvrename and/or vgrename would take care of these > details. Are there any scripts out there that take care of all the > details? If not, I may write one (once I have the recipe to get > this working, of course). > > Alfred > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos
William L. Maltby
2008-May-02 21:23 UTC
[CentOS] Is it possible to lvrename the current root partition?
On Fri, 2008-05-02 at 17:04 -0400, Alfred von Campe wrote:> I'd like to rename my existing volume groups and logical volumes (I > picked names a long time ago I no longer like :-). I recently > stumbled across the lvrename and vgrename commands, but when I tried > the former to rename the logical volume that my root partition > resides on, the system became unbootable. > > In addition to renaming the LV (and VG if I decide to to that as > well), what else needs to be changed? So far my list includes: > > o /etc/fstabb > o /boot/grub/grub.conf > o /dev/<vgname>/<lvnamex> > o /dev/mapper/<vgname-lvnamex> > > I was hoping the lvrename and/or vgrename would take care of these > details. Are there any scripts out there that take care of all the > details? If not, I may write one (once I have the recipe to get this > working, of course).Remake your initrd. In there is a reference to the volgroup/lvol that you will want to change. Or you can add and change the parameter to ignore check failures. Then just the usual fstab, local scripts, etc.> > Alfred > <snip sig stuff>HTH -- Bill
Ross S. W. Walker
2008-May-02 21:24 UTC
[CentOS] Is it possible to lvrename the current root partition?
Alfred von Campe wrote:> > I'd like to rename my existing volume groups and logical volumes (I > picked names a long time ago I no longer like :-). I recently > stumbled across the lvrename and vgrename commands, but when I tried > the former to rename the logical volume that my root partition > resides on, the system became unbootable. > > In addition to renaming the LV (and VG if I decide to to that as > well), what else needs to be changed? So far my list includes: > > o /etc/fstabb > o /boot/grub/grub.conf > o /dev/<vgname>/<lvnamex> > o /dev/mapper/<vgname-lvnamex> > > I was hoping the lvrename and/or vgrename would take care of these > details. Are there any scripts out there that take care of all the > details? If not, I may write one (once I have the recipe to get this > working, of course).Sure you can do all this from rescue mode off the first CD. Boot the cd type in 'linux rescue' and continue to the command prompt. At the command prompt: 1) make sure swap isn't using the swap lv - swapoff -a 2) unmount all lvs mounted - umount /mnt/sysimage/boot - umount /mnt/sysimage 3) mark all lvs as unavailable - lvchange -a n <vgname> 4) rename the volume group - vgrename <oldvgname> <newvgname> 5) rename the logical volumes - lvrename <vgname>\<oldlvname> <newlvname> 6) repeat #5 as necessary 7) re-activate all the lvs - lvchange -a y <vgname> 8) re-mount the root and boot lvs, - mount /dev/<vgname>/<rootlv> /mnt/sysimage - mount /dev/<vgname>/<bootlv> /mnt/sysimage/boot 9) chroot to the mounts with, 'chroot /mnt/sysimage /bin/bash' 10) edit /etc/fstab 11) edit /boot/grub/grub.conf That should do it. -Ross ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.