Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LVM2 Replacing Old Hard Disk [anybody done this???] SOLVED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Pax-UX
n00b
n00b


Joined: 20 Feb 2004
Posts: 65

PostPosted: Tue Jul 06, 2004 6:29 am    Post subject: LVM2 Replacing Old Hard Disk [anybody done this???] SOLVED Reply with quote

Quick system spec to get an idea of what needs to be done; currently I have 5x160GB HDs setup under Gentoo 2.6.6 (x86). I’m running LVM2 as my Volume Group Manager Software and Samba for file sharing. There’s only about 170GB free so it’s now time to upgrade some of the drives. I’m replacing 2x160GB hard disks with 2x250GB drive.

I’ve been reading the following LVM Removing an Old Disk to see how to remove an old hard drive and replace it with a new one. But what I would like to know is if you need to change the size of the Logical Volume (and file system, Reiser) before I start updating the Volume Group and then the underlying Physical Volumes? Or can I just move all the Physical Extents to the new HD and then unplug the old and do a normal file system resize which will grow instead of shrink the LV?

Has anybody else experience doing this? As I have a lot of data that I don’t want to loss during the upgrade. While I do have a second PC of the same configuration with all my data mirrored as a backup encase of drive failure, I would prefer not to have to rebuild the LVM from scratch as to transfer all the data would take at least 35 Hours as I can only seem to get an average transfer rate of 4MBytes/s. (Haha, and that’s another problem for another day)


Last edited by Pax-UX on Fri Jul 09, 2004 6:13 am; edited 1 time in total
Back to top
View user's profile Send private message
Jonasx
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2004
Posts: 118

PostPosted: Tue Jul 06, 2004 6:37 am    Post subject: Reply with quote

I did something similar, although not on that large a scale, with a mailserver I wanted to move to a new machine because of imminent hardware failure. The disk system wasn't on LVM though. I just built the new machine, hooked the 2 machines via the ethernet cards and a crossover cable and tar -xvpf 'ed everything from old to new. There were a few hitches as I remember, I'll look back at my notes I made if your interested in trying this avenue.
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Tue Jul 06, 2004 10:24 am    Post subject: Reply with quote

I did a while ago, replacing a hd is much simpler than removing one.

simply pvmove /dev/hda /dev/hdb for example, IF the drives are identical.

If not you'll need to look into shrinking and expanding, and you need a filesystem that supports it.

It's also possible you can use pvmove to move all the data on the old disk over, and then expand the rest of the free space on the new disk later.


If the disks are identical, it's a piece of cake though :)


It should be as simple as pvmove /dev/oldhd /dev/newhd and then remove the old hd. But I can't guarantee it will be that simple, and I cant guarantee my memory is correct.
Back to top
View user's profile Send private message
Pax-UX
n00b
n00b


Joined: 20 Feb 2004
Posts: 65

PostPosted: Tue Jul 06, 2004 12:01 pm    Post subject: Reply with quote

Thanks for the feed back. I'm going to be doing this upgrade later today. So I'll let you know how it goes.
Back to top
View user's profile Send private message
Pax-UX
n00b
n00b


Joined: 20 Feb 2004
Posts: 65

PostPosted: Thu Jul 08, 2004 5:55 am    Post subject: Reply with quote

I've tried to use the pvmove and it hasn't works, so let it be a warning to you people!!!

There seems to be a problem for most others I've read with google, who have tried to use pvmove with LVM2. I have to say LVM2 isn't anywhere near production quality. The basic stuff works, but once you try to start doing some admin on it, like removing a drive your off into a wonderland of problems.

I'm currentlying getting the Kernal 2.6.7 and apply some patchs to see if this will fix the problem.

I'll keep this topic updated on my progress.
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Thu Jul 08, 2004 8:54 am    Post subject: Reply with quote

I've used lvm2 quite a lot, and that's not my experience.

You are aware that you need some extra patches to use pvmove on a 2.6 kernel correct? It should be described in the documentation.

ftp://sources.redhat.com/pub/dm/patches/2.6-unstable/
Back to top
View user's profile Send private message
Pax-UX
n00b
n00b


Joined: 20 Feb 2004
Posts: 65

PostPosted: Thu Jul 08, 2004 11:05 am    Post subject: Reply with quote

LVM2 has been great for me and I only say "production" meaning if this was my home server I could go ahead and scrace the VG starting again with the new drives. But because this at work I can't do this till the weekend. (Sorry my original reply came from the heart at the joy of lossing my weekend) But since HD space isn't a real issue just yet I have a bit of time to play with server kernals in the evening.

Anyway...

I was reading on another forum that there are patchs in the 2.6.6-bk5 for the DM stuff, which is ment to help and that was going to make its way into the 2.6.7 release. I'm basicly going to installing 2.6.7 + the bk20 patch and try again. I'm running the most uptodate Gentoo emerge of 'lvm2' and its dependences. I hope to get around to doing this this evening after people are finished with the server. If it works I'll be back to say so, or just to wine some more.
Back to top
View user's profile Send private message
Pax-UX
n00b
n00b


Joined: 20 Feb 2004
Posts: 65

PostPosted: Fri Jul 09, 2004 6:10 am    Post subject: Reply with quote

Woohoo!!! I got pvmove to work!!

It took a little bit of messing but I got there in the end. I take back what I said about LVM2, as I was running an old version. emgere lvm2 default gave me the lvm2-2.00.08, which is very out of date, by version number standards. There was a masked version 2.00.15, which is the one I installed. I think the most upto date one (at time of writting) is 2.00.19, but that's not in portage system or I just couldn't find it. I also install the default 2.6.7 Kernal + bk20 patch from the kernel.org.

Once I had both of the above installed it was like Neuron said: a very simple case of 'pvmove -v -i10 /dev/hdc /dev/hdh' This was for verbose and 10 second updates of the status. It worked like a charm and was then able to do the 'vgremove vg /dev/hdc'. To free up the ide channel for one of the new drives. I'm going to do the other drive later today. Though I'm unsure if I'll keep my kernel at 2.6.7-bk as vmware was giving me the not complied for this kernel error. So I'm still running 2.6.6 for production today but will try the 2.6.7-bk over the weekend and see if everything is okay monday morning.

Thanks for the help neuron!
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Fri Jul 09, 2004 10:15 am    Post subject: Reply with quote

oh you remembered -v and status updates on pvmove, I always forget that... and keep wondering how much time is left :p

and for vmware, run /opt/vmware/bin/vmware-config.pl (or something like that, cd /opt/vmware/bin ; ls *config*), should fix your "not compiled for this kernel" error :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum