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-23-2009, 07:57 AM
Neil Bothwick
 
Default Resizing physical volume for lvm.

On Mon, 23 Mar 2009 08:57:08 +0100, Momesso Andrea wrote:

> It looks more like a workaround than a solution. If my non native
> English understood it well, it suggests to backup everything, recreate
> the pv for the whole size, and then restore from backup.

Since you currently have plenty of free space, you don't have to take the
system out of service to do a backup. Create a new PV in sda4 and run
pvmove, then remove and recreate the PV on sda3 and pvmove the data back.
Then you can delete sda4 and enlarge sda3.


--
Neil Bothwick

UNILINGUAL: American.
 
Old 03-23-2009, 08:07 AM
Momesso Andrea
 
Default Resizing physical volume for lvm.

On Mon, 23 Mar 2009 08:57:19 +0000
Neil Bothwick <neil@digimed.co.uk> wrote:

> On Mon, 23 Mar 2009 08:57:08 +0100, Momesso Andrea wrote:
>
> > It looks more like a workaround than a solution. If my non native
> > English understood it well, it suggests to backup everything,
> > recreate the pv for the whole size, and then restore from backup.
>
> Since you currently have plenty of free space, you don't have to take
> the system out of service to do a backup. Create a new PV in sda4 and
> run pvmove, then remove and recreate the PV on sda3 and pvmove the
> data back. Then you can delete sda4 and enlarge sda3.
>
>

Since, as Alan suggested, I enlarged sda3 with fdisk, how can I have
back my old sda4 without risking to lose the data?

---
TopperH
http://topperh.blogspot.com
 
Old 03-23-2009, 08:31 AM
Neil Bothwick
 
Default Resizing physical volume for lvm.

On Mon, 23 Mar 2009 10:07:59 +0100, Momesso Andrea wrote:

> > Since you currently have plenty of free space, you don't have to take
> > the system out of service to do a backup. Create a new PV in sda4 and
> > run pvmove, then remove and recreate the PV on sda3 and pvmove the
> > data back. Then you can delete sda4 and enlarge sda3.

> Since, as Alan suggested, I enlarged sda3 with fdisk, how can I have
> back my old sda4 without risking to lose the data?

You only enlarged the partition, not the PV that lives on it. So you can
delete and recreate it at the original size,although I'd make it a
little larger than before, just to be certain it is never smaller.


--
Neil Bothwick

WindowError:01B Illegal error. Do NOT get this error.
 
Old 03-23-2009, 09:22 AM
Momesso Andrea
 
Default Resizing physical volume for lvm.

On Mon, 23 Mar 2009 09:31:20 +0000
Neil Bothwick <neil@digimed.co.uk> wrote:

> On Mon, 23 Mar 2009 10:07:59 +0100, Momesso Andrea wrote:
>
> > > Since you currently have plenty of free space, you don't have to
> > > take the system out of service to do a backup. Create a new PV in
> > > sda4 and run pvmove, then remove and recreate the PV on sda3 and
> > > pvmove the data back. Then you can delete sda4 and enlarge sda3.
>
> > Since, as Alan suggested, I enlarged sda3 with fdisk, how can I have
> > back my old sda4 without risking to lose the data?
>
> You only enlarged the partition, not the PV that lives on it. So you
> can delete and recreate it at the original size,although I'd make it a
> little larger than before, just to be certain it is never smaller.
>
>

Wow, didn't know that lvm offers such a great flexibility...

But I still miss someting... If I pvmove the pv from sda3 to sda4, then
recreate a brand new pv on sda3, pvmove the data back, fdisk to delete
sda4 and enlarge sda3, what will prevent pvextend to fall in the same
error I had before?

---
TopperH
http://topperh.blogspot.com
 
Old 03-23-2009, 05:16 PM
Mick
 
Default Resizing physical volume for lvm.

On Sunday 22 March 2009, Alan McKinnon wrote:

> Caveat: I have no idea why this doesn't work, but if you make sda4 an
> extended partition and create sda5 as a logical with exactly the same start
> and end as you describe above, you do in fact lose all data. Obviously
> there is a difference between a physical and a logical partition with the
> same location, but I don't know why this is.

I think that this is because the extended partition contains the extended
partition table at its boot sector. A primary partition at the same position
does not and therefore has a different offset. Having spent some interesting
white-knuckle-ride moments with testdisk, I realised that carelessly
switching between primary and extended/logical partitions is not something I
would like to try again - unless I am playing around in a test environment.

> Which is a pity, as 4 logical partitions is a little too constrictive,

Do you mean primary?

> I
> prefer the extra freedom to move things around with extended partitions.
--
Regards,
Mick
 
Old 03-23-2009, 06:18 PM
Alan McKinnon
 
Default Resizing physical volume for lvm.

On Monday 23 March 2009 20:16:15 Mick wrote:
> On Sunday 22 March 2009, Alan McKinnon wrote:
> > Caveat: I have no idea why this doesn't work, but if you make sda4 an
> > extended partition and create sda5 as a logical with exactly the same
> > start and end as you describe above, you do in fact lose all data.
> > Obviously there is a difference between a physical and a logical
> > partition with the same location, but I don't know why this is.
>
> I think that this is because the extended partition contains the extended
> partition table at its boot sector. A primary partition at the same
> position does not and therefore has a different offset. Having spent some
> interesting white-knuckle-ride moments with testdisk, I realised that
> carelessly switching between primary and extended/logical partitions is not
> something I would like to try again - unless I am playing around in a test
> environment.

Yes, that makes sense. Also explains why you can't just switching them around
without side-effects

> > Which is a pity, as 4 logical partitions is a little too constrictive,
>
> Do you mean primary?

Yes - that was a thinko :-0
--
alan dot mckinnon at gmail dot com
 

Thread Tools




All times are GMT. The time now is 08:33 PM.

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