Re: [CentOS] Is it possible to lvrename the current root partition?

2008-05-02 Thread Joshua Gimer
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//
 o /dev/mapper/

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@centos.org
http://lists.centos.org/mailman/listinfo/centos


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Is it possible to lvrename the current root partition?

2008-05-02 Thread William L. Maltby
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//
>o /dev/mapper/
> 
> 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
> 

HTH
-- 
Bill

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] Is it possible to lvrename the current root partition?

2008-05-02 Thread Ross S. W. Walker
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//
>o /dev/mapper/
> 
> 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 

4) rename the volume group
- vgrename  

5) rename the logical volumes
- lvrename \ 

6) repeat #5 as necessary

7) re-activate all the lvs
- lvchange -a y 

8) re-mount the root and boot lvs,
- mount /dev// /mnt/sysimage
- mount /dev// /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.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] Is it possible to lvrename the current root partition?

2008-05-02 Thread Ross S. W. Walker
Ross S. W. Walker wrote:
> 
> 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//
> >o /dev/mapper/
> > 
> > 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 
> 
> 4) rename the volume group
>   - vgrename  
> 
> 5) rename the logical volumes
>   - lvrename \ 
> 
> 6) repeat #5 as necessary
> 
> 7) re-activate all the lvs
>   - lvchange -a y 
> 
> 8) re-mount the root and boot lvs,
>   - mount /dev// /mnt/sysimage
>   - mount /dev// /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.

Oh, I forgot, as Bill pointed out...

12) remake the initrd
- mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)

Does uname work correctly chroot'd? I'll have to test that out...

-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.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] Is it possible to lvrename the current root partition?

2008-05-02 Thread William L. Maltby
On Fri, 2008-05-02 at 17:28 -0400, Ross S. W. Walker wrote:
> Ross S. W. Walker wrote:
> > 
> > Alfred von Campe wrote:
> > > 
> > >

> Oh, I forgot, as Bill pointed out...
> 
> 12) remake the initrd
>   - mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)

In the output from the gzip -dc  | cpio -idumv
is a file named init. Look around this area.

   echo Creating root device.
   mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00
   echo Mounting root filesystem.

> 

-- 
Bill

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Is it possible to lvrename the current root partition?

2008-05-02 Thread Alfred von Campe
Josh, Bill, and Ross, than you for all the suggestions.  I'm running  
out of time to try them today, but I will do so on Monday when I'm  
back in the office and I"ll post an update.


TGIF!
Alfred

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] Is it possible to lvrename the current root partition?

2008-05-02 Thread Ross S. W. Walker
Alfred von Campe wrote:
> 
> Josh, Bill, and Ross, than you for all the suggestions.  I'm running  
> out of time to try them today, but I will do so on Monday when I'm  
> back in the office and I"ll post an update.

Sounds good, I verified uname doesn't work under rescue and there
are a couple other problems with /proc /sys being mounted under
/mnt/sysimage. I have done it successfully with the FC8 cd though.

-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.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Is it possible to lvrename the current root partition?

2008-05-07 Thread Alfred von Campe

On May 2, 2008, at 17:24, Ross S. W. Walker wrote:

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.


First, thanks for the detailed list, Ross.  It was very helpful.  I  
was able to rename both the VG and the LVs, but it was slightly more  
complicated than the items on the list.



1) make sure swap isn't using the swap lv
- swapoff -a


What I did was say "Skip" when the rescue image asks you if you want  
it to find existing Linux installations and mount them under /mnt/ 
sysimage.  The reason I did this was that if you let it mount your  
partitions, you need to go through a lot of additional steps to get  
everything under /mnt/sysimage unmounted, and nothing in there is  
needed to do the rename (unless you want to rename the VG -- see below).



2) unmount all lvs mounted
- umount /mnt/sysimage/boot
- umount /mnt/sysimage


Not needed because of what I did in step 1, but there are additional  
mount points to unmount if you do let the rescue image do the mounts  
(do a "mount | grep  sysimage" to find all the mount points).



3) mark all lvs as unavailable
- lvchange -a n 


This step is indeed required unless you chose to skip the mounting  
of /mnt/sysimage altogether.  Do a "lvm lvscan" to find out which LVs  
are active (and use "lvm lvchange" as described below).



4) rename the volume group
- vgrename  


Well, vgrename is not part of the rescue disk.  So if you want to do  
this, you will have to mark the root LV as available, mount it, and  
then copy /mnt//usr/sbin/vgrename to /tmp.  Then you have  
to unmount the root partition and mark the LV as unavailable.



5) rename the logical volumes
- lvrename \ 

6) repeat #5 as necessary


The lvrename binary (symbolic link) does not exit in rescue mode, so  
you will have to type "lvm lvrename" (and "lvm lvchange", etc.).   
Also, you have to use a forward slash here.




7) re-activate all the lvs
- lvchange -a y 


Remember to use the new names.


8) re-mount the root and boot lvs,
- mount /dev// /mnt/sysimage
- mount /dev// /mnt/sysimage/boot


I think this part worked as is.


9) chroot to the mounts with, 'chroot /mnt/sysimage /bin/bash'


Before I could do this, I had to use mknod to create the device  
entries in /mnt/sysimage/dev/mapper/- and the  
symbolic links in /mnt/sysimage/dev//.  Make sure the  
symbolic links point to /dev/mapper/... and not /mnt/sysimage/dev/ 
mapper/...  I don't remember if this was required to mount it while  
in rescue mode or to make the system bootable again.  But I remember  
that I had to do it.



10) edit /etc/fstab

11) edit /boot/grub/grub.conf

12) remake the initrd
- mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)


You will have to type the release version of the kernel instead of  
relying on the output of uname -r.


It turns out that I can skip steps 7-12 since I plan to upgrade the  
systems from CentOS 4.6 to CentOS 5.1 immediately after doing the  
rename, and the installer (anaconda) will take care of all these  
details.   I just had to adjust my kickstart scripts to use the new  
names.


Anyway, thanks again for all the help.  I'm starting to upgrade my  
two dozen or so desktops to CentOS 5.1 using the new VG and LV names.


Alfred

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] Is it possible to lvrename the current root partition?

2008-05-08 Thread Ross S. W. Walker
Alfred von Campe wrote:
> 
> On May 2, 2008, at 17:24, Ross S. W. Walker wrote:
> > 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.
> 
> First, thanks for the detailed list, Ross.  It was very helpful.  I  
> was able to rename both the VG and the LVs, but it was slightly more  
> complicated than the items on the list.
> 
> > 1) make sure swap isn't using the swap lv
> > - swapoff -a
> 
> What I did was say "Skip" when the rescue image asks you if you want  
> it to find existing Linux installations and mount them under /mnt/ 
> sysimage.  The reason I did this was that if you let it mount your  
> partitions, you need to go through a lot of additional steps to get  
> everything under /mnt/sysimage unmounted, and nothing in there is  
> needed to do the rename (unless you want to rename the VG -- 
> see below).
> 
> > 2) unmount all lvs mounted
> > - umount /mnt/sysimage/boot
> > - umount /mnt/sysimage
> 
> Not needed because of what I did in step 1, but there are additional  
> mount points to unmount if you do let the rescue image do the mounts  
> (do a "mount | grep  sysimage" to find all the mount points).
> 
> > 3) mark all lvs as unavailable
> > - lvchange -a n 
> 
> This step is indeed required unless you chose to skip the mounting  
> of /mnt/sysimage altogether.  Do a "lvm lvscan" to find out 
> which LVs  
> are active (and use "lvm lvchange" as described below).
> 
> > 4) rename the volume group
> > - vgrename  
> 
> Well, vgrename is not part of the rescue disk.  So if you want to do  
> this, you will have to mark the root LV as available, mount it, and  
> then copy /mnt//usr/sbin/vgrename to /tmp.  Then 
> you have  
> to unmount the root partition and mark the LV as unavailable.
> 
> > 5) rename the logical volumes
> > - lvrename \ 
> >
> > 6) repeat #5 as necessary
> 
> The lvrename binary (symbolic link) does not exit in rescue mode, so  
> you will have to type "lvm lvrename" (and "lvm lvchange", etc.).   
> Also, you have to use a forward slash here.
> 
> >
> > 7) re-activate all the lvs
> > - lvchange -a y 
> 
> Remember to use the new names.
> 
> > 8) re-mount the root and boot lvs,
> > - mount /dev// /mnt/sysimage
> > - mount /dev// /mnt/sysimage/boot
> 
> I think this part worked as is.
> 
> > 9) chroot to the mounts with, 'chroot /mnt/sysimage /bin/bash'
> 
> Before I could do this, I had to use mknod to create the device  
> entries in /mnt/sysimage/dev/mapper/- and the  
> symbolic links in /mnt/sysimage/dev//.  Make sure the  
> symbolic links point to /dev/mapper/... and not /mnt/sysimage/dev/ 
> mapper/...  I don't remember if this was required to mount it while  
> in rescue mode or to make the system bootable again.  But I remember  
> that I had to do it.
> 
> > 10) edit /etc/fstab
> >
> > 11) edit /boot/grub/grub.conf
> >
> > 12) remake the initrd
> > - mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)
> 
> You will have to type the release version of the kernel instead of  
> relying on the output of uname -r.
> 
> It turns out that I can skip steps 7-12 since I plan to upgrade the  
> systems from CentOS 4.6 to CentOS 5.1 immediately after doing the  
> rename, and the installer (anaconda) will take care of all these  
> details.   I just had to adjust my kickstart scripts to use the new  
> names.
> 
> Anyway, thanks again for all the help.  I'm starting to upgrade my  
> two dozen or so desktops to CentOS 5.1 using the new VG and LV names.

Thanks for updating the points with your experience. I wrote it
from memory, so was bound to miss something. Maybe it can be
incorporated into a general how-to.

Yeah the lvm included in the busybox rescue is a little kludgy,
that's why I typically use the FC8 rescue CD as it is a little
more refined.

You can try making symlinks to 'lvm' for lvrename and vgrename
or even hard links and it should provide that function.

Good idea to skip the mounting, because once it's mounted it's
a PITA to umount everything and re-mount it.

Of course if your performing an upgrade there is no need to
regenerate the initrd as a new one is created during install.

-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.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos