* [gentoo-user] Resizing physical volume for lvm.
@ 2009-03-22 20:15 Momesso Andrea
2009-03-22 20:33 ` Jil Larner
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Momesso Andrea @ 2009-03-22 20:15 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]
My current setup is:
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2894 23246023+ 83 Linux
/dev/sda2 2895 3381 3911827+ 82 Linux
swap /Solaris
/dev/sda3 3382 24804 172080247+ 83 Linux
/dev/sda4 24805 30401 44957902+ 83 Linux
where sda3 is an lvm volume and sda4 is free space.
I'd like to to merge sda3 and sda4 into a single partition without
losing the data on it, but I'm not sure if it is possible.
My guess is that I can use fdisk to delete sda4 and sda3, create a sda3
partition starting at 3382 and ending at 30401, then use pvresize to
enlarge it.
This is from man pvresize:
"Expand the PV on /dev/sda1 after enlarging the partition with fdisk:
pvresize /dev/sda1"
Is that going to work or I'm going to lose all the data?
P.S. I'm not using vgextend to simply add sda4 to the lvm because I
might want to migrate my root (sda1) to ext4, and to do so I will need
to split it in two separate partitions (/boot using ext3 and / using
ext4). This way I'm not going to need extended partitions.
---
TopperH
http://topperh.blogspot.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:15 [gentoo-user] Resizing physical volume for lvm Momesso Andrea
@ 2009-03-22 20:33 ` Jil Larner
2009-03-22 20:35 ` Alan McKinnon
2009-03-22 20:39 ` Dirk Heinrichs
2 siblings, 0 replies; 19+ messages in thread
From: Jil Larner @ 2009-03-22 20:33 UTC (permalink / raw
To: gentoo-user
Hi,
Momesso Andrea a écrit :
> My current setup is:
>
> Device Boot Start End Blocks Id System
> /dev/sda1 * 1 2894 23246023+ 83 Linux
> /dev/sda2 2895 3381 3911827+ 82 Linux
> swap /Solaris
> /dev/sda3 3382 24804 172080247+ 83 Linux
> /dev/sda4 24805 30401 44957902+ 83 Linux
>
> where sda3 is an lvm volume and sda4 is free space.
You may consider setting your partition type to 8E (Linux LVM), which
would give a better labeling of your table.
I understand what you want to do, and I would process the same way but
I'd rather make a backup before (of your partition table and data). As I
never did it, I prefer not telling you to go ahead ;)
Sincerely,
Jil
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:15 [gentoo-user] Resizing physical volume for lvm Momesso Andrea
2009-03-22 20:33 ` Jil Larner
@ 2009-03-22 20:35 ` Alan McKinnon
2009-03-22 20:42 ` Momesso Andrea
` (2 more replies)
2009-03-22 20:39 ` Dirk Heinrichs
2 siblings, 3 replies; 19+ messages in thread
From: Alan McKinnon @ 2009-03-22 20:35 UTC (permalink / raw
To: gentoo-user
On Sunday 22 March 2009 22:15:14 Momesso Andrea wrote:
> My current setup is:
>
> Device Boot Start End Blocks Id System
> /dev/sda1 * 1 2894 23246023+ 83 Linux
> /dev/sda2 2895 3381 3911827+ 82 Linux
> swap /Solaris
> /dev/sda3 3382 24804 172080247+ 83 Linux
> /dev/sda4 24805 30401 44957902+ 83 Linux
>
> where sda3 is an lvm volume and sda4 is free space.
>
> I'd like to to merge sda3 and sda4 into a single partition without
> losing the data on it, but I'm not sure if it is possible.
>
> My guess is that I can use fdisk to delete sda4 and sda3, create a sda3
> partition starting at 3382 and ending at 30401, then use pvresize to
> enlarge it.
Correct. That's all there is to it.
> This is from man pvresize:
> "Expand the PV on /dev/sda1 after enlarging the partition with fdisk:
> pvresize /dev/sda1"
>
> Is that going to work or I'm going to lose all the data?
Your data is safe if you do exactly the steps you said above.
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.
Which is a pity, as 4 logical partitions is a little too constrictive, I
prefer the extra freedom to move things around with extended partitions.
> P.S. I'm not using vgextend to simply add sda4 to the lvm because I
> might want to migrate my root (sda1) to ext4, and to do so I will need
> to split it in two separate partitions (/boot using ext3 and / using
> ext4). This way I'm not going to need extended partitions.
ext3 on /boot is pointless. The ext3 metadata takes up a considerable chunk of
the space on a typical /boot, for no good reason at all - writes to it are
exceptionally rare so there's no real-worlld benefit to the journal.
Ext2 is ideal for /boot.
--
alan dot mckinnon at gmail dot com
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:15 [gentoo-user] Resizing physical volume for lvm Momesso Andrea
2009-03-22 20:33 ` Jil Larner
2009-03-22 20:35 ` Alan McKinnon
@ 2009-03-22 20:39 ` Dirk Heinrichs
2009-03-22 20:46 ` Momesso Andrea
2009-03-22 20:49 ` Neil Bothwick
2 siblings, 2 replies; 19+ messages in thread
From: Dirk Heinrichs @ 2009-03-22 20:39 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 398 bytes --]
Am Sonntag, 22. März 2009 21:15:14 schrieb Momesso Andrea:
> P.S. I'm not using vgextend to simply add sda4 to the lvm because I
> might want to migrate my root (sda1) to ext4
Why do want to do that? ext4 is just a couple of months old and there's no
proof of stability whatsoever for it. Better try it with uncritical data
partitions (portage tree, distfiles) first.
Bye...
Dirk
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:35 ` Alan McKinnon
@ 2009-03-22 20:42 ` Momesso Andrea
2009-03-23 7:16 ` Alan McKinnon
2009-03-22 21:00 ` Momesso Andrea
2009-03-23 18:16 ` Mick
2 siblings, 1 reply; 19+ messages in thread
From: Momesso Andrea @ 2009-03-22 20:42 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2637 bytes --]
On Sun, 22 Mar 2009 22:35:35 +0200
Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On Sunday 22 March 2009 22:15:14 Momesso Andrea wrote:
> > My current setup is:
> >
> > Device Boot Start End Blocks Id System
> > /dev/sda1 * 1 2894 23246023+ 83 Linux
> > /dev/sda2 2895 3381 3911827+ 82 Linux
> > swap /Solaris
> > /dev/sda3 3382 24804 172080247+ 83 Linux
> > /dev/sda4 24805 30401 44957902+ 83 Linux
> >
> > where sda3 is an lvm volume and sda4 is free space.
> >
> > I'd like to to merge sda3 and sda4 into a single partition without
> > losing the data on it, but I'm not sure if it is possible.
> >
> > My guess is that I can use fdisk to delete sda4 and sda3, create a
> > sda3 partition starting at 3382 and ending at 30401, then use
> > pvresize to enlarge it.
>
> Correct. That's all there is to it.
>
> > This is from man pvresize:
> > "Expand the PV on /dev/sda1 after enlarging the partition with
> > fdisk: pvresize /dev/sda1"
> >
> > Is that going to work or I'm going to lose all the data?
>
> Your data is safe if you do exactly the steps you said above.
Good to know! In any case backups are available, but I prefer not to
use them if not necessary.
>
> 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.
>
> Which is a pity, as 4 logical partitions is a little too
> constrictive, I prefer the extra freedom to move things around with
> extended partitions.
>
> > P.S. I'm not using vgextend to simply add sda4 to the lvm because I
> > might want to migrate my root (sda1) to ext4, and to do so I will
> > need to split it in two separate partitions (/boot using ext3 and /
> > using ext4). This way I'm not going to need extended partitions.
>
> ext3 on /boot is pointless. The ext3 metadata takes up a considerable
> chunk of the space on a typical /boot, for no good reason at all -
> writes to it are exceptionally rare so there's no real-worlld benefit
> to the journal.
>
> Ext2 is ideal for /boot.
>
Thanks for the advice. Will be a problem for lvm if I add a partition
before it? I mean, will I need to change any config files while lvm is
gonna reside on sda4 instead of sda3?
---
TopperH
http://topperh.blogspot.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:39 ` Dirk Heinrichs
@ 2009-03-22 20:46 ` Momesso Andrea
2009-03-22 20:49 ` Neil Bothwick
1 sibling, 0 replies; 19+ messages in thread
From: Momesso Andrea @ 2009-03-22 20:46 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 854 bytes --]
On Sun, 22 Mar 2009 21:39:29 +0100
Dirk Heinrichs <dirk.heinrichs@online.de> wrote:
> Am Sonntag, 22. März 2009 21:15:14 schrieb Momesso Andrea:
> > P.S. I'm not using vgextend to simply add sda4 to the lvm because I
> > might want to migrate my root (sda1) to ext4
>
> Why do want to do that? ext4 is just a couple of months old and
> there's no proof of stability whatsoever for it. Better try it with
> uncritical data partitions (portage tree, distfiles) first.
>
> Bye...
>
> Dirk
Don't want to do that right now, but I like to have things set up to
create me less problems as possible when I will decide to do the
migration.
In any case I don't consider the root partition of my laptop to be
really critical. I'm not planning any migration in /home, that will
remain ext3.
---
TopperH
http://topperh.blogspot.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:39 ` Dirk Heinrichs
2009-03-22 20:46 ` Momesso Andrea
@ 2009-03-22 20:49 ` Neil Bothwick
2009-03-22 20:58 ` Momesso Andrea
1 sibling, 1 reply; 19+ messages in thread
From: Neil Bothwick @ 2009-03-22 20:49 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
On Sun, 22 Mar 2009 21:39:29 +0100, Dirk Heinrichs wrote:
> > P.S. I'm not using vgextend to simply add sda4 to the lvm because I
> > might want to migrate my root (sda1) to ext4
>
> Why do want to do that? ext4 is just a couple of months old and there's
> no proof of stability whatsoever for it. Better try it with uncritical
> data partitions (portage tree, distfiles) first.
Yet if you do, the latest GRUB boots from ext4 partitions, so you don't
need to separate /boot.
--
Neil Bothwick
"I'm Not Sure If I'm Homosexual", Said Tom, Half In Earnest.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:49 ` Neil Bothwick
@ 2009-03-22 20:58 ` Momesso Andrea
2009-03-22 21:39 ` Albert Hopkins
0 siblings, 1 reply; 19+ messages in thread
From: Momesso Andrea @ 2009-03-22 20:58 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 782 bytes --]
On Sun, 22 Mar 2009 20:49:36 +0000
Neil Bothwick <neil@digimed.co.uk> wrote:
> On Sun, 22 Mar 2009 21:39:29 +0100, Dirk Heinrichs wrote:
>
> > > P.S. I'm not using vgextend to simply add sda4 to the lvm because
> > > I might want to migrate my root (sda1) to ext4
> >
> > Why do want to do that? ext4 is just a couple of months old and
> > there's no proof of stability whatsoever for it. Better try it with
> > uncritical data partitions (portage tree, distfiles) first.
>
> Yet if you do, the latest GRUB boots from ext4 partitions, so you
> don't need to separate /boot.
>
>
I heard it can boot from ext4 using a patch that is not 100% safe...
Does anyone have positive (or negative) experience with that?
---
TopperH
http://topperh.blogspot.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:35 ` Alan McKinnon
2009-03-22 20:42 ` Momesso Andrea
@ 2009-03-22 21:00 ` Momesso Andrea
2009-03-23 7:22 ` Alan McKinnon
2009-03-23 18:16 ` Mick
2 siblings, 1 reply; 19+ messages in thread
From: Momesso Andrea @ 2009-03-22 21:00 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]
On Sun, 22 Mar 2009 22:35:35 +0200
Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On Sunday 22 March 2009 22:15:14 Momesso Andrea wrote:
> > My current setup is:
> >
> > Device Boot Start End Blocks Id System
> > /dev/sda1 * 1 2894 23246023+ 83 Linux
> > /dev/sda2 2895 3381 3911827+ 82 Linux
> > swap /Solaris
> > /dev/sda3 3382 24804 172080247+ 83 Linux
> > /dev/sda4 24805 30401 44957902+ 83 Linux
> >
> > where sda3 is an lvm volume and sda4 is free space.
> >
> > I'd like to to merge sda3 and sda4 into a single partition without
> > losing the data on it, but I'm not sure if it is possible.
> >
> > My guess is that I can use fdisk to delete sda4 and sda3, create a
> > sda3 partition starting at 3382 and ending at 30401, then use
> > pvresize to enlarge it.
>
> Correct. That's all there is to it.
>
> > This is from man pvresize:
> > "Expand the PV on /dev/sda1 after enlarging the partition with
> > fdisk: pvresize /dev/sda1"
> >
> > Is that going to work or I'm going to lose all the data?
>
> Your data is safe if you do exactly the steps you said above.
>
pvresize /dev/sda3
/dev/sda3: too many metadata areas for pvresize
Looks like I cannot expand it...
---
TopperH
http://topperh.blogspot.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:58 ` Momesso Andrea
@ 2009-03-22 21:39 ` Albert Hopkins
0 siblings, 0 replies; 19+ messages in thread
From: Albert Hopkins @ 2009-03-22 21:39 UTC (permalink / raw
To: gentoo-user
On Sun, 2009-03-22 at 21:58 +0100, Momesso Andrea wrote:
> On Sun, 22 Mar 2009 20:49:36 +0000
> Neil Bothwick <neil@digimed.co.uk> wrote:
>
> > On Sun, 22 Mar 2009 21:39:29 +0100, Dirk Heinrichs wrote:
> >
> > > > P.S. I'm not using vgextend to simply add sda4 to the lvm because
> > > > I might want to migrate my root (sda1) to ext4
> > >
> > > Why do want to do that? ext4 is just a couple of months old and
> > > there's no proof of stability whatsoever for it. Better try it with
> > > uncritical data partitions (portage tree, distfiles) first.
> >
> > Yet if you do, the latest GRUB boots from ext4 partitions, so you
> > don't need to separate /boot.
> >
> >
>
> I heard it can boot from ext4 using a patch that is not 100% safe...
> Does anyone have positive (or negative) experience with that?
You don't need to apply any patch; it comes with GRUB. I didn't get any
"WARNING: this patch will fuck your box" messages when I installed it.
In my experience I haven't seen any difference between it and the 25 or
so other patches that Gentoo applies to GRUB.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:42 ` Momesso Andrea
@ 2009-03-23 7:16 ` Alan McKinnon
0 siblings, 0 replies; 19+ messages in thread
From: Alan McKinnon @ 2009-03-23 7:16 UTC (permalink / raw
To: gentoo-user
On Sunday 22 March 2009 22:42:39 Momesso Andrea wrote:
> Thanks for the advice. Will be a problem for lvm if I add a partition
> before it? I mean, will I need to change any config files while lvm is
> gonna reside on sda4 instead of sda3?
It's not a problem. LVM scans the drive looking for pvs and uses them as it
finds them. You can see this behaviour when running 'vgchange -a y'. It
doesn't need or really use the partition number at all.
You may have such things in lvm config files somewhere. If it becomes
problematic, simply remove/comment those entries.
--
alan dot mckinnon at gmail dot com
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 21:00 ` Momesso Andrea
@ 2009-03-23 7:22 ` Alan McKinnon
2009-03-23 7:57 ` Momesso Andrea
0 siblings, 1 reply; 19+ messages in thread
From: Alan McKinnon @ 2009-03-23 7:22 UTC (permalink / raw
To: gentoo-user
On Sunday 22 March 2009 23:00:07 Momesso Andrea wrote:
> On Sun, 22 Mar 2009 22:35:35 +0200
>
> Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> > On Sunday 22 March 2009 22:15:14 Momesso Andrea wrote:
> > Your data is safe if you do exactly the steps you said above.
>
> pvresize /dev/sda3
> /dev/sda3: too many metadata areas for pvresize
>
> Looks like I cannot expand it...
This code commit is giving the error:
http://sources.redhat.com/ml/lvm2-cvs/2008-09/msg00001.html
and a solution can be found in this thread (courtesy of that nice man Mr.
Google):
http://archives.free.net.ph/message/20081129.151331.dd8edce0.en.html
>
> ---
> TopperH
> http://topperh.blogspot.com
--
alan dot mckinnon at gmail dot com
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-23 7:22 ` Alan McKinnon
@ 2009-03-23 7:57 ` Momesso Andrea
2009-03-23 8:57 ` Neil Bothwick
0 siblings, 1 reply; 19+ messages in thread
From: Momesso Andrea @ 2009-03-23 7:57 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]
On Mon, 23 Mar 2009 09:22:20 +0200
Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On Sunday 22 March 2009 23:00:07 Momesso Andrea wrote:
> > On Sun, 22 Mar 2009 22:35:35 +0200
> >
> > Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> > > On Sunday 22 March 2009 22:15:14 Momesso Andrea wrote:
>
> > > Your data is safe if you do exactly the steps you said above.
> >
> > pvresize /dev/sda3
> > /dev/sda3: too many metadata areas for pvresize
> >
> > Looks like I cannot expand it...
>
> This code commit is giving the error:
>
> http://sources.redhat.com/ml/lvm2-cvs/2008-09/msg00001.html
>
> and a solution can be found in this thread (courtesy of that nice
> man Mr. Google):
>
> http://archives.free.net.ph/message/20081129.151331.dd8edce0.en.html
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.
This is exactly what I did not want to do in the OP... By the way, if I
need to, I will.
---
TopperH
htpp://topperh.blogspot.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-23 7:57 ` Momesso Andrea
@ 2009-03-23 8:57 ` Neil Bothwick
2009-03-23 9:07 ` Momesso Andrea
0 siblings, 1 reply; 19+ messages in thread
From: Neil Bothwick @ 2009-03-23 8:57 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-23 8:57 ` Neil Bothwick
@ 2009-03-23 9:07 ` Momesso Andrea
2009-03-23 9:31 ` Neil Bothwick
0 siblings, 1 reply; 19+ messages in thread
From: Momesso Andrea @ 2009-03-23 9:07 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 809 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-23 9:07 ` Momesso Andrea
@ 2009-03-23 9:31 ` Neil Bothwick
2009-03-23 10:22 ` Momesso Andrea
0 siblings, 1 reply; 19+ messages in thread
From: Neil Bothwick @ 2009-03-23 9:31 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 764 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-23 9:31 ` Neil Bothwick
@ 2009-03-23 10:22 ` Momesso Andrea
0 siblings, 0 replies; 19+ messages in thread
From: Momesso Andrea @ 2009-03-23 10:22 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1145 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-22 20:35 ` Alan McKinnon
2009-03-22 20:42 ` Momesso Andrea
2009-03-22 21:00 ` Momesso Andrea
@ 2009-03-23 18:16 ` Mick
2009-03-23 19:18 ` Alan McKinnon
2 siblings, 1 reply; 19+ messages in thread
From: Mick @ 2009-03-23 18:16 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Resizing physical volume for lvm.
2009-03-23 18:16 ` Mick
@ 2009-03-23 19:18 ` Alan McKinnon
0 siblings, 0 replies; 19+ messages in thread
From: Alan McKinnon @ 2009-03-23 19:18 UTC (permalink / raw
To: gentoo-user
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
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2009-03-23 19:19 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-22 20:15 [gentoo-user] Resizing physical volume for lvm Momesso Andrea
2009-03-22 20:33 ` Jil Larner
2009-03-22 20:35 ` Alan McKinnon
2009-03-22 20:42 ` Momesso Andrea
2009-03-23 7:16 ` Alan McKinnon
2009-03-22 21:00 ` Momesso Andrea
2009-03-23 7:22 ` Alan McKinnon
2009-03-23 7:57 ` Momesso Andrea
2009-03-23 8:57 ` Neil Bothwick
2009-03-23 9:07 ` Momesso Andrea
2009-03-23 9:31 ` Neil Bothwick
2009-03-23 10:22 ` Momesso Andrea
2009-03-23 18:16 ` Mick
2009-03-23 19:18 ` Alan McKinnon
2009-03-22 20:39 ` Dirk Heinrichs
2009-03-22 20:46 ` Momesso Andrea
2009-03-22 20:49 ` Neil Bothwick
2009-03-22 20:58 ` Momesso Andrea
2009-03-22 21:39 ` Albert Hopkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox