Adding an LVM hard disk to a system already running/using LVM
I have two systems, both having file systems running on LVM.
System No 1 has 2 PATA HDD (40 and 80 GB) running linux on LVM.
System 2 has a single SATA HDD (300 GB) which again uses LVM. What i was trying to do was to add the two HDD in system 1 to system 2, possibly with little or no data loss.
So i connected the PATA drives from system 1 to system 2 and booted up. The system booted up to the openSUSE 11.3 splash screen and stopped after scanning the HDDs. Frankly i never expected openSUSE to try n auto mount the new drives.
I think the problem was caused because both the systems had VG and LV of the same names.
Any idea how to resolve this conflict? Can the volume group be renamed, maybe from a live CD or somthing?? System 2 is not boot able now.
Thanks in advance for your reply.
I never tried this, but I would handle it like this
check also the fstab to modify the device names that refer to the lv's
after this connect to system1
you can also use a live cd and use these commands as root
vgrename oldname newname
the vgchange -an without argument will deactivate all volumegroups wich shouldn't be a problem since you are running with a livecd
Also, will any live CD work?? Or is there a particular one i should try for this purpose??
well you need the rename the volume group you will add to the other system, since that way that system will still work
I think you could try a knoppix cdrom, but others might also work.
maybe you will need to use
modprobe dm-mod # to enable the device mapper used for LVM
vgrename oldname newname
after this you could reboot and see what happens if you repeat this until lvs
when you see it renamed connect the volume group to the other system
I hope this can help
Thank you for the help... I ll try it n let you know what happens.
I tried to follow the method. But since i did not have any Live CDs or access to the old system, i had to do it the hard way.Here is what i did:
1. Unplugged the 300GB HDD and booted system2.
2. Now i was booting into the volume group that i wanted to rename (the root partition is also an LV).This meant that i could not use the "vgrename" command since the VG was in use.
3. I took a metadata backup of the current VG (named system) using "vgcfgbackup" command to /etc/lvm/backup/system (file)
4. Edited the file changed the VG name in the file to "system1" and renamed the backup file to "system1".
5. Restored the edited metatdata backup file (system2) using the command "vgcfgrestore".
6. Edited the necessary files like fstab etc
7. Rebooted the system.
Thats it added a VG with the same name from another system with zero data loss. I did take a backup, just in case there was a worst case scenario.
|All times are GMT -5. The time now is 06:54 PM.|