FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-06-2012, 08:45 AM
Datty
 
Default LVM: Removing 3 disks and replacing with 1

Hi all,

I've got an LVM setup at the minute that consists of 3x1TB and 3x1.5TB drives. Its setup with one huge XFS partition with all my data on. I don't have a backup of any kind and I know thats pretty silly but with the cost of replicating the whole lot being what it is and the lack of space in my server for more drives I have to live with it for the minute. Its got to the point now where I have 200gb free on it and the drives are pretty old so I'm going to need to get some new storage. I initially want to replace the 3x1TBs with a single 3TB drive but i've never removed/replaced a drive in an LVM setup before. I think I understand how it is done, using pvmove but a lot of the information around it has giant warnings saying backup before you do it. Has anyone used pvmove before and has it gone as planned or not? Also, would someone with a 3TB drive be able to give me the exact size of the drive so I can work out if it will have enough extents to replace the 3 drives?



Thanks for your help

Oliver
 
Old 03-06-2012, 03:32 PM
Stroller
 
Default LVM: Removing 3 disks and replacing with 1

On 6 March 2012, at 09:45, Datty wrote:…*I initially want to replace the 3x1TBs with a single 3TB drive but i've never removed/replaced a drive in an LVM setup before. I think I understand how it is done, using pvmove …*
Or you could just format and mount the new drive and use `cp`.
Stroller.
 
Old 03-06-2012, 04:02 PM
"Stefan G. Weichinger"
 
Default LVM: Removing 3 disks and replacing with 1

Am 06.03.2012 17:32, schrieb Stroller:
>
> On 6 March 2012, at 09:45, Datty wrote:
>> … I initially want to replace the 3x1TBs with a single 3TB drive but
>> i've never removed/replaced a drive in an LVM setup before. I think I
>> understand how it is done, using pvmove …
>
> Or you could just format and mount the new drive and use `cp`.

;-)
 
Old 03-06-2012, 04:24 PM
Florian Philipp
 
Default LVM: Removing 3 disks and replacing with 1

Am 06.03.2012 17:32, schrieb Stroller:
>
> On 6 March 2012, at 09:45, Datty wrote:
>> … I initially want to replace the 3x1TBs with a single 3TB drive but
>> i've never removed/replaced a drive in an LVM setup before. I think I
>> understand how it is done, using pvmove …
>
> Or you could just format and mount the new drive and use `cp`.
>
> Stroller.
>

+1

If you still want to work on LVM, you can use lvconvert to mirror your
old volume on the new disk and then remove the old disks. The creation
of the mirror should be inherently secure. pvmove should be safe, too. I
know pvmove once crashed for me (old kernel bug, years ago) and I didn't
loose data.

# create mirror, report progress every 10 seconds
lvconvert --interval 10 -m1 vg00/lvol1 /dev/new_disk

# detach mirror, creates snapshot
lvconvert -m0 vg00/lvol1

Disclaimer: Untested

Regards,
Florian Philipp
 
Old 03-06-2012, 04:25 PM
Neil Bothwick
 
Default LVM: Removing 3 disks and replacing with 1

On Tue, 6 Mar 2012 16:32:56 +0000, Stroller wrote:

> > … I initially want to replace the 3x1TBs with a single 3TB drive but
> > i've never removed/replaced a drive in an LVM setup before. I think I
> > understand how it is done, using pvmove …
>
> Or you could just format and mount the new drive and use `cp`.

Thereby instantly removing the benefits of LVM and making it almost
impossible to extend the space by adding another drive when needed.

To the OP, pvmove is perfectly safe as it does a copy;verify;delete on
one small block of extents at a time. It also ensures that any new writes
while pvmove is running go to the new drive, so you can still use the
system while moving (try doing that with cp .


--
Neil Bothwick

Interchangeable parts aren't.
 
Old 03-06-2012, 04:44 PM
Florian Philipp
 
Default LVM: Removing 3 disks and replacing with 1

Am 06.03.2012 18:25, schrieb Neil Bothwick:
> On Tue, 6 Mar 2012 16:32:56 +0000, Stroller wrote:
>
>>> … I initially want to replace the 3x1TBs with a single 3TB drive but
>>> i've never removed/replaced a drive in an LVM setup before. I think I
>>> understand how it is done, using pvmove …
>>
>> Or you could just format and mount the new drive and use `cp`.
>
> Thereby instantly removing the benefits of LVM and making it almost
> impossible to extend the space by adding another drive when needed.
>

I don't think so. vgextend the volume group with the new disk, lvcreate
a new volume using only extents from the new disk, copy data over to it,
swap mount points, done.

Plus points: Removes fragmentation of the old file system. Also probably
faster.

> To the OP, pvmove is perfectly safe as it does a copy;verify;delete on
> one small block of extents at a time. It also ensures that any new writes
> while pvmove is running go to the new drive, so you can still use the
> system while moving (try doing that with cp .
>
>

Wait, are we talking about a system disk (root and stuff)? I was under
the impression that it's just a data dump. Of course, with system
partitions and other media that cannot be handled read-only for a longer
time, pvmove or lvchange are the better options.

Regards,
Florian Philipp
 
Old 03-06-2012, 05:34 PM
Stroller
 
Default LVM: Removing 3 disks and replacing with 1

On 6 March 2012, at 17:25, Neil Bothwick wrote:

> On Tue, 6 Mar 2012 16:32:56 +0000, Stroller wrote:
>
>>> … I initially want to replace the 3x1TBs with a single 3TB drive but
>>> i've never removed/replaced a drive in an LVM setup before. I think I
>>> understand how it is done, using pvmove …
>>
>> Or you could just format and mount the new drive and use `cp`.
>
> Thereby instantly removing the benefits of LVM and making it almost
> impossible to extend the space by adding another drive when needed.

Uh, why not create a new volume group with the new disk?

OP says he wants to *replace* the old disks.

Admittedly, I don't like the RAID0 nature of LVM, so my question probably did reflect that cynicism.

> To the OP, pvmove is perfectly safe as it does a copy;verify;delete on
> one small block of extents at a time.

Yeah, I actually have quite a bit of confidence that migrating entirely in LVM would work just fine, but my qualifications in this area are quite minimal.

I am glad, however, to have generated some responses to OP's question, which had been languishing for c 8 hours without replies when I commented.

Stroller.
 
Old 03-06-2012, 05:47 PM
Michael Mol
 
Default LVM: Removing 3 disks and replacing with 1

On Tue, Mar 6, 2012 at 1:34 PM, Stroller <stroller@stellar.eclipse.co.uk> wrote:
>
> On 6 March 2012, at 17:25, Neil Bothwick wrote:
>
>> On Tue, 6 Mar 2012 16:32:56 +0000, Stroller wrote:
>>
>>>> … I initially want to replace the 3x1TBs with a single 3TB drive but
>>>> i've never removed/replaced a drive in an LVM setup before. I think I
>>>> understand how it is done, using pvmove …
>>>
>>> Or you could just format and mount the new drive and use `cp`.
>>
>> Thereby instantly removing the benefits of LVM and making it almost
>> impossible to extend the space by adding another drive when needed.
>
> Uh, why not create a new volume group with the new disk?
>
> OP says he wants to *replace* the old disks.

Makes a certain amount of sense. But it sounds like he found a tool
(pvmove) to do what he needs to do, and trying to do more on top
complicates things beyond what they need to be.


>
> Admittedly, I don't like the RAID0 nature of LVM, so my question probably did reflect that cynicism.

I typically put LVM on top of RAID.


--
:wq
 
Old 03-06-2012, 06:05 PM
Neil Bothwick
 
Default LVM: Removing 3 disks and replacing with 1

On Tue, 06 Mar 2012 18:44:18 +0100, Florian Philipp wrote:

> >> Or you could just format and mount the new drive and use `cp`.
> >
> > Thereby instantly removing the benefits of LVM and making it almost
> > impossible to extend the space by adding another drive when needed.
> >
>
> I don't think so. vgextend the volume group with the new disk, lvcreate
> a new volume using only extents from the new disk, copy data over to it,
> swap mount points, done.

But Stroller made no mention of LVM on the new disk, just format and
mount.

> > To the OP, pvmove is perfectly safe as it does a copy;verify;delete on
> > one small block of extents at a time. It also ensures that any new
> > writes while pvmove is running go to the new drive, so you can still
> > use the system while moving (try doing that with cp .

> Wait, are we talking about a system disk (root and stuff)? I was under
> the impression that it's just a data dump. Of course, with system
> partitions and other media that cannot be handled read-only for a longer
> time, pvmove or lvchange are the better options.

It doesn't have to be a system disk, just something that is in use.
Copying 3TB is going to take a while, making the drive unavailable to
whatever needs to write for it for that amount of time may be be
unacceptable and is certainly unnecessary.


--
Neil Bothwick

A consultant is a person who borrows your watch, tells you what time it
is, pockets the watch, and sends you a bill for it.
 
Old 03-06-2012, 06:14 PM
Florian Philipp
 
Default LVM: Removing 3 disks and replacing with 1

Am 06.03.2012 19:47, schrieb Michael Mol:
> On Tue, Mar 6, 2012 at 1:34 PM, Stroller <stroller@stellar.eclipse.co.uk> wrote:
>>
>> On 6 March 2012, at 17:25, Neil Bothwick wrote:
>>
>>> On Tue, 6 Mar 2012 16:32:56 +0000, Stroller wrote:
>>>
>>>>> … I initially want to replace the 3x1TBs with a single 3TB drive but
>>>>> i've never removed/replaced a drive in an LVM setup before. I think I
>>>>> understand how it is done, using pvmove …
>>>>
>>>> Or you could just format and mount the new drive and use `cp`.
>>>
>>> Thereby instantly removing the benefits of LVM and making it almost
>>> impossible to extend the space by adding another drive when needed.
>>
>> Uh, why not create a new volume group with the new disk?
>>

Nitpicking: No need for a new volume group, just a new PV. Using a
separate VG makes migration harder.

>> OP says he wants to *replace* the old disks.
>
> Makes a certain amount of sense. But it sounds like he found a tool
> (pvmove) to do what he needs to do, and trying to do more on top
> complicates things beyond what they need to be.
>
>
>>
>> Admittedly, I don't like the RAID0 nature of LVM, so my question probably did reflect that cynicism.
>
> I typically put LVM on top of RAID.
>
>

I guess the OP is running the JBOD nature ("linear" in LVM terms). Not
that it matters, really.

BTW: Am I the only one seeing a good opportunity for creating a backup
using the old disks? LVM snapshots would be perfect here, as long as the
old disks can be kept running.

Regards,
Florian Philipp
 

Thread Tools




All times are GMT. The time now is 08:58 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org