LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 08-10-2010, 12:01 AM   #1
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Rep: Reputation: 37
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.
 
Old 08-10-2010, 01:30 AM   #2
tlowk
Member
 
Registered: Nov 2003
Location: Belgium
Distribution: Slackware
Posts: 151

Rep: Reputation: 23
I never tried this, but I would handle it like this

boot system1

use vgrename

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

vgscan
vgchange -ay
vgrename oldname newname

vgchange -an

the vgchange -an without argument will deactivate all volumegroups wich shouldn't be a problem since you are running with a livecd

Last edited by tlowk; 08-10-2010 at 01:34 AM.
 
Old 08-10-2010, 03:18 AM   #3
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by tlowk View Post
I never tried this, but I would handle it like this

boot system1

use vgrename

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

vgscan
vgchange -ay
vgrename oldname newname

vgchange -an

the vgchange -an without argument will deactivate all volumegroups wich shouldn't be a problem since you are running with a livecd
That is quite confusing... i think u mixed up the system numbers...

Also, will any live CD work?? Or is there a particular one i should try for this purpose??
 
Old 08-10-2010, 03:25 AM   #4
tlowk
Member
 
Registered: Nov 2003
Location: Belgium
Distribution: Slackware
Posts: 151

Rep: Reputation: 23
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

then just

vgscan
vgchange -ay
lvs
vgrename oldname newname
vgchange -an

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
 
Old 08-11-2010, 02:13 AM   #5
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Thank you for the help... I ll try it n let you know what happens.
 
Old 08-15-2010, 01:59 AM   #6
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a new hard drive to my LVM simplified Linux - Newbie 8 07-25-2009 12:03 PM
Adding a Physical Drive to an LVM System Linux31 Linux - Hardware 2 06-14-2007 07:06 PM
Problem adding new disk via in FD6 system-config-lvm BurntChips Fedora 0 11-16-2006 01:24 PM
LVM - adding a new scsi hard disk ddaas Red Hat 1 07-28-2005 03:13 AM
Adding drive with LVM to the exisitng system DBabo Linux - Hardware 3 06-12-2005 07:21 PM


All times are GMT -5. The time now is 06:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration