Hi,
I want to rename some volume groups and logical volumes.
I was not surprised when it would not let me rename active volumes.
So I booted up the system using the CentOS 5.5 LiveCD, but the LiveCD makes the logical volumes browsable using Nautilus, so they are still active and I can't rename them.
Tried:
/usr/sbin/lvchange -a n VolGroup00/LogVol00
but it still says:
LV VolGroup00/LogVol00 in use: not deactivating
Did some googling and found out that other folks have had problems with mkinitrd, but I haven't gotten that far yet.
Made a wild guess and killed my nautilus process, a lot of stuff disappeared from the desktop, then reappeared along with a new nautilus process.
Still googling, but haven't found anything useful so far.
Any idea?
On 09/11/10 12:45 PM, drew einhorn wrote:
Hi,
I want to rename some volume groups and logical volumes.
I was not surprised when it would not let me rename active volumes.
So I booted up the system using the CentOS 5.5 LiveCD, but the LiveCD makes the logical volumes browsable using Nautilus, so they are still active and I can't rename them.
Tried:
/usr/sbin/lvchange -a n VolGroup00/LogVol00
but it still says:
LV VolGroup00/LogVol00 in use: not deactivating
did you try booting the liveCD in single mode? in grub, add the word 'single' to the kernel line... that won't mount anything.
I want to rename some volume groups and logical volumes.
I was not surprised when it would not let me rename active volumes.
So I booted up the system using the CentOS 5.5 LiveCD, but the LiveCD makes the logical volumes browsable using Nautilus, so they are still active and I can't rename them.
Tried:
/usr/sbin/lvchange -a n VolGroup00/LogVol00
but it still says:
LV VolGroup00/LogVol00 in use: not deactivating
If its mounted you'll need to unmount it before you can deactivate it, and if its in use you wont be able to unmount it....
I'm guessing that with a name like VolGroup00/LogVol00 its probably the root filesystem so probably the best procedure is to boot from your live CD, then
umount /dev/VolGroup00/LogVol00 and you should then be able to deactivate it then do your lvrename/vgrename stuff
You'll also need to change any entry it may have in /etc/fstab before you reboot back onto the internal disks, or it wont mount on bootup and if its the root filesystem thats pretty fatal!
chris
On Sat, Sep 11, 2010 at 3:45 PM, drew einhorn drew.einhorn@gmail.com wrote:
I want to rename some volume groups and logical volumes. I was not surprised when it would not let me rename active volumes. So I booted up the system using the CentOS 5.5 LiveCD, but the LiveCD makes the logical volumes browsable using Nautilus, so they are still active and I can't rename them. Tried: /usr/sbin/lvchange -a n VolGroup00/LogVol00 but it still says: LV VolGroup00/LogVol00 in use: not deactivating
Did some googling and found out that other folks have had problems with mkinitrd, but I haven't gotten that far yet. Made a wild guess and killed my nautilus process, a lot of stuff disappeared from the desktop, then reappeared along with a new nautilus process.
Is VolGroup00/LogVol00 mounted?
Is VolGroup00/LogVol00 a swap partition that the Live CD is using?
At Sat, 11 Sep 2010 13:45:55 -0600 CentOS mailing list centos@centos.org wrote:
Hi,
I want to rename some volume groups and logical volumes.
I was not surprised when it would not let me rename active volumes.
So I booted up the system using the CentOS 5.5 LiveCD, but the LiveCD makes the logical volumes browsable using Nautilus, so they are still active and I can't rename them.
Tried:
/usr/sbin/lvchange -a n VolGroup00/LogVol00
but it still says:
LV VolGroup00/LogVol00 in use: not deactivating
Did some googling and found out that other folks have had problems with mkinitrd, but I haven't gotten that far yet.
Made a wild guess and killed my nautilus process, a lot of stuff disappeared from the desktop, then reappeared along with a new nautilus process.
Still googling, but haven't found anything useful so far.
Any idea?
*Don't* boot the GUI! Boot into text mode. Nautilus, etc. is not started and won't be restarted. Sometimes the GUI is not really easier, it can in fact be much harder.
You should be able to login as root and use the CLI to do what you need to do.
Note: in the case of mkinitrd, you will need to rebuild your initrd if you expect to actually boot the machine after renaming the volume group and logical volumes. You'll need to *manually* mount the root and /boot (at least) someplace (eg under /sysroot), then chroot there. Don't forget to fix /etc/fstab and /boot/grub/grub.conf (root=...).
On Sat, Sep 11, 2010 at 2:55 PM, Robert Heller heller@deepsoft.com wrote:
At Sat, 11 Sep 2010 13:45:55 -0600 CentOS mailing list centos@centos.org wrote: Note: in the case of mkinitrd, you will need to rebuild your initrd if you expect to actually boot the machine after renaming the volume group and logical volumes. You'll need to *manually* mount the root and /boot (at least) someplace (eg under /sysroot), then chroot there. Don't forget to fix /etc/fstab and /boot/grub/grub.conf (root=...).
Googling got me the command: /sbin/mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)
Unfortunately this resulted in:
error opening /sys/block: No such file or directory error opening /sys/block: No such file or directory
The renamed root lvm filesystem is mounted on /mnt/root the /boot is in /dev/sda1 and mounted on /mnt/root/boot
before doing the chroot, I tried
sudo cp -a /sys/block /mnt/root/sys
Even though it was done with root privilege I got a lot of read permission errors, but a lot stuff did copy, maybe I got what I need. did the mkinitrd, no errors
Lets try booting from the hard drive.
Hmm there's a splash screen, that's a good sign.
No Joy. It's not booting and complaining about not finding stuff with the old names.
Did I screw up the grub.conf edits. Just checked they are ok.
It finds the volume groups with the new names then complains about the old names:
Volume group "VolGroup00" not found Unable to access resume device (/dev/VolGroup00/LogVol01)
Hmm. That's the old name of the swap device.
There's at least one more piece of the puzzle that's missing.
Lets boot up the Live CD again. And take a closer look at fstab. Looks good to me.
At Sun, 12 Sep 2010 22:40:52 -0600 CentOS mailing list centos@centos.org wrote:
On Sat, Sep 11, 2010 at 2:55 PM, Robert Heller heller@deepsoft.com wrote:
At Sat, 11 Sep 2010 13:45:55 -0600 CentOS mailing list centos@centos.org wrote: Note: in the case of mkinitrd, you will need to rebuild your initrd if you expect to actually boot the machine after renaming the volume group and logical volumes. You'll need to *manually* mount the root and /boot (at least) someplace (eg under /sysroot), then chroot there. Don't forget to fix /etc/fstab and /boot/grub/grub.conf (root=...).
Googling got me the command: /sbin/mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)
Unfortunately this resulted in:
error opening /sys/block: No such file or directory error opening /sys/block: No such file or directory
The renamed root lvm filesystem is mounted on /mnt/root the /boot is in /dev/sda1 and mounted on /mnt/root/boot
before doing the chroot, I tried
sudo cp -a /sys/block /mnt/root/sys
Wrong!
Do this: mount --bind /sys /mnt/root/sys mount --bind /dev /mnt/root/dev mount --bind /proc /mnt/root/proc chroot /mnt/root /sbin/mkinitrd -f /boot/initrd-<actual KV>.img <actual KV> exit umount /mnt/root/sys umount /mnt/root/dev umount /mnt/root/proc
Note: you don't want to use 'uname -r' while running the LiveCD, since the it might not be the kernel your system wants to boot (in fact it wasn't as you discovered). Look in /boot/grub/grub.conf and see *exactly* which kernel your system is booting. Replace <actual KV> with whatever you find in /boot/grub/grub.conf -- this will rebuild the *correct* initrd. Yes, more *careful* typing, but that is what you need to do.
Even though it was done with root privilege I got a lot of read permission errors, but a lot stuff did copy, maybe I got what I need. did the mkinitrd, no errors
Lets try booting from the hard drive.
Hmm there's a splash screen, that's a good sign.
No Joy. It's not booting and complaining about not finding stuff with the old names.
Did I screw up the grub.conf edits. Just checked they are ok.
It finds the volume groups with the new names then complains about the old names:
Volume group "VolGroup00" not found Unable to access resume device (/dev/VolGroup00/LogVol01)
Hmm. That's the old name of the swap device.
There's at least one more piece of the puzzle that's missing.
Lets boot up the Live CD again. And take a closer look at fstab. Looks good to me.
On 09/11/2010 08:45 PM, drew einhorn wrote:
So I booted up the system using the CentOS 5.5 LiveCD, but the LiveCD makes the logical volumes browsable using Nautilus, so they are still active and I can't rename them.
Rather than the livecd, you might want to just boot the installer into rescue mode. You will have none of the issues you ran into.
- KB
At Mon, 13 Sep 2010 15:55:01 +0100 CentOS mailing list centos@centos.org wrote:
On 09/11/2010 08:45 PM, drew einhorn wrote:
So I booted up the system using the CentOS 5.5 LiveCD, but the LiveCD makes the logical volumes browsable using Nautilus, so they are still active and I can't rename them.
Rather than the livecd, you might want to just boot the installer into rescue mode. You will have none of the issues you ran into.
Right. The installer in rescue mode 'magically' deals with the stuff like /sys, /proc, and /dev when it chroots you to your installed system. The shell you end up at is all set up properly. You do want to be careful about uname -r: if your system has a newer (or otherwise different, such as centos plus) kernel installed, you will need to specifiy the kernel version manually.
- KB
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos