* [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
@ 2011-03-03 5:25 Scott Arthur
2011-03-03 20:09 ` John Drescher
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Scott Arthur @ 2011-03-03 5:25 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 678 bytes --]
So I've just cloned a 1TB disk to a new 2TB disk using GNU ddresuce
My partition table looks like this:
Model: ATA WDC WD20EARS-00M (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 296MB 296MB primary ext4 boot
2 296MB 1000GB 1000GB extended
5 296MB 1000GB 1000GB logical lvm
I'm obviously wanting to expand the LVM partition to fill the remaining 1TB
of space.
Am I able to simply use parted to resize the partition before doing a
pvresize etc?
Or is it risky to resize the underlying LVM partition?
[-- Attachment #2: Type: text/html, Size: 1646 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-03 5:25 [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk Scott Arthur
@ 2011-03-03 20:09 ` John Drescher
2011-03-03 20:18 ` Stuart D. Gathman
2011-03-04 21:49 ` Koen Vermeer
2 siblings, 0 replies; 16+ messages in thread
From: John Drescher @ 2011-03-03 20:09 UTC (permalink / raw)
To: LVM general discussion and development; +Cc: Scott Arthur
On Thu, Mar 3, 2011 at 12:25 AM, Scott Arthur <scott@scottatron.com> wrote:
> So I've just cloned a 1TB disk to a new 2TB disk using GNU ddresuce
> My partition table looks like this:
> Model: ATA WDC WD20EARS-00M (scsi)
> Disk /dev/sda: 2000GB
> Sector size (logical/physical): 512B/512B
> Partition Table: msdos
> Number �Start � End � � Size � �Type � � �File system �Flags
> �1 � � �32.3kB �296MB � 296MB � primary � ext4 � � � � boot
> �2 � � �296MB � 1000GB �1000GB �extended
> �5 � � �296MB � 1000GB �1000GB �logical � � � � � � � �lvm
> I'm obviously wanting to expand the LVM partition to fill the remaining 1TB
> of space.
> Am I able to simply use parted to resize the partition before doing a
> pvresize etc?
> Or is it risky to resize the underlying LVM partition?
>
No. I do not believe this is risky.
John
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-03 5:25 [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk Scott Arthur
2011-03-03 20:09 ` John Drescher
@ 2011-03-03 20:18 ` Stuart D. Gathman
2011-03-04 8:41 ` Radu Rendec
2011-03-04 10:13 ` Lyn Rees
2011-03-04 21:49 ` Koen Vermeer
2 siblings, 2 replies; 16+ messages in thread
From: Stuart D. Gathman @ 2011-03-03 20:18 UTC (permalink / raw)
To: LVM general discussion and development
On Thu, 3 Mar 2011, Scott Arthur wrote:
> Partition Table: msdos
>
> Number Start End Size Type File system Flags
> 1 32.3kB 296MB 296MB primary ext4 boot
> 2 296MB 1000GB 1000GB extended
> 5 296MB 1000GB 1000GB logical lvm
>
> I'm obviously wanting to expand the LVM partition to fill the remaining 1TB
> of space.
>
> Am I able to simply use parted to resize the partition before doing a
> pvresize etc?
>
> Or is it risky to resize the underlying LVM partition?
You are getting to a size where msdos partition tables are risky.
Don't they crap out at 2TB?
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-03 20:18 ` Stuart D. Gathman
@ 2011-03-04 8:41 ` Radu Rendec
2011-03-04 13:50 ` Stuart D. Gathman
` (2 more replies)
2011-03-04 10:13 ` Lyn Rees
1 sibling, 3 replies; 16+ messages in thread
From: Radu Rendec @ 2011-03-04 8:41 UTC (permalink / raw)
To: LVM general discussion and development
On Thu, 2011-03-03 at 15:18 -0500, Stuart D. Gathman wrote:
> On Thu, 3 Mar 2011, Scott Arthur wrote:
>
> > Partition Table: msdos
> >
> > Number Start End Size Type File system Flags
> > 1 32.3kB 296MB 296MB primary ext4 boot
> > 2 296MB 1000GB 1000GB extended
> > 5 296MB 1000GB 1000GB logical lvm
> >
> > I'm obviously wanting to expand the LVM partition to fill the remaining 1TB
> > of space.
> >
> > Am I able to simply use parted to resize the partition before doing a
> > pvresize etc?
> >
> > Or is it risky to resize the underlying LVM partition?
I wouldn't do that. Instead, I would create a new logical partition,
"format" it as lvm physical volume and then extend the volume group to
use this partition as well.
I think this can be safely done like this:
* turn off lvm;
* note down the exact starting and ending *sector* of partition 5 (using
fdisk -lu)
* use fdisk and delete partition 5 and 2, then re-create partition 2 up
to the full disk size
* re-create partition 5 making sure it's on exactly the same starting
and ending sector as it was before
* create new partition 6
> You are getting to a size where msdos partition tables are risky.
> Don't they crap out at 2TB?
They do. But the "2TB" disk is actually 2000GB, which is safe (it takes
more than 2048GB to run into trouble with m$dos partitions).
Best regards,
Radu Rendec
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-03 20:18 ` Stuart D. Gathman
2011-03-04 8:41 ` Radu Rendec
@ 2011-03-04 10:13 ` Lyn Rees
2011-03-04 12:19 ` Scott Arthur
1 sibling, 1 reply; 16+ messages in thread
From: Lyn Rees @ 2011-03-04 10:13 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 1944 bytes --]
Why don't you just make a new partition and add it to the VG, then expand
the LV. Isn't that the point of LVM?
--------------------------------------------------
Mr Lyn Rees
Senior Engineer, UIG
Information Services Computing Centre
Cardiff University, 40-41 Park Place,
Cardiff. CF10 3BB.
--------------------------------------------------
Contact numbers:
(029) 2087 9188 (direct)
(029) 2087 4875 (reception)
(029) 2087 4285 (fax)
--------------------------------------------------
Email: rees@cardiff.ac.uk
Web: www.cardiff.ac.uk
From: "Stuart D. Gathman" <stuart@bmsi.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Date: 03/03/2011 20:27
Subject: Re: [linux-lvm] Resizing underlying LVM partition after
cloning to bigger disk
Sent by: linux-lvm-bounces@redhat.com
On Thu, 3 Mar 2011, Scott Arthur wrote:
> Partition Table: msdos
>
> Number Start End Size Type File system Flags
> 1 32.3kB 296MB 296MB primary ext4 boot
> 2 296MB 1000GB 1000GB extended
> 5 296MB 1000GB 1000GB logical lvm
>
> I'm obviously wanting to expand the LVM partition to fill the remaining
1TB
> of space.
>
> Am I able to simply use parted to resize the partition before doing a
> pvresize etc?
>
> Or is it risky to resize the underlying LVM partition?
You are getting to a size where msdos partition tables are risky.
Don't they crap out at 2TB?
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703
591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
[-- Attachment #2: Type: text/html, Size: 3528 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 10:13 ` Lyn Rees
@ 2011-03-04 12:19 ` Scott Arthur
2011-03-04 21:57 ` Stuart D. Gathman
0 siblings, 1 reply; 16+ messages in thread
From: Scott Arthur @ 2011-03-04 12:19 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 2653 bytes --]
I did consider that as an easier option.
Based on what is said here: http://tldp.org/HOWTO/LVM-HOWTO/multpartitions.html if I don't have striped logical volumes and there's only one physical drive, can I expect any performance issues?
On 4/03/2011, at 11:13 PM, Lyn Rees <Rees@cardiff.ac.uk> wrote:
> Why don't you just make a new partition and add it to the VG, then expand the LV. Isn't that the point of LVM?
> --------------------------------------------------
> Mr Lyn Rees
> Senior Engineer, UIG
> Information Services Computing Centre
> Cardiff University, 40-41 Park Place,
> Cardiff. CF10 3BB.
> --------------------------------------------------
> Contact numbers:
> (029) 2087 9188 (direct)
> (029) 2087 4875 (reception)
> (029) 2087 4285 (fax)
> --------------------------------------------------
> Email: rees@cardiff.ac.uk
> Web: www.cardiff.ac.uk
>
>
>
> From: "Stuart D. Gathman" <stuart@bmsi.com>
> To: LVM general discussion and development <linux-lvm@redhat.com>
> Date: 03/03/2011 20:27
> Subject: Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
> Sent by: linux-lvm-bounces@redhat.com
>
>
>
> On Thu, 3 Mar 2011, Scott Arthur wrote:
>
> > Partition Table: msdos
> >
> > Number Start End Size Type File system Flags
> > 1 32.3kB 296MB 296MB primary ext4 boot
> > 2 296MB 1000GB 1000GB extended
> > 5 296MB 1000GB 1000GB logical lvm
> >
> > I'm obviously wanting to expand the LVM partition to fill the remaining 1TB
> > of space.
> >
> > Am I able to simply use parted to resize the partition before doing a
> > pvresize etc?
> >
> > Or is it risky to resize the underlying LVM partition?
>
> You are getting to a size where msdos partition tables are risky.
> Don't they crap out at 2TB?
>
> --
> Stuart D. Gathman <stuart@bmsi.com>
> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
> "Confutatis maledictis, flammis acribus addictis" - background song for
> a Microsoft sponsored "Where do you want to go from here?" commercial.
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
[-- Attachment #2: Type: text/html, Size: 5213 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 8:41 ` Radu Rendec
@ 2011-03-04 13:50 ` Stuart D. Gathman
2011-03-04 15:31 ` Phillip Susi
2011-03-05 2:13 ` Scott Arthur
2 siblings, 0 replies; 16+ messages in thread
From: Stuart D. Gathman @ 2011-03-04 13:50 UTC (permalink / raw)
To: LVM general discussion and development
On Fri, 4 Mar 2011, Radu Rendec wrote:
> > > Or is it risky to resize the underlying LVM partition?
>
> I wouldn't do that. Instead, I would create a new logical partition,
> "format" it as lvm physical volume and then extend the volume group to
> use this partition as well.
>
> I think this can be safely done like this:
>
> * turn off lvm;
> * note down the exact starting and ending *sector* of partition 5 (using
> fdisk -lu)
> * use fdisk and delete partition 5 and 2, then re-create partition 2 up
> to the full disk size
> * re-create partition 5 making sure it's on exactly the same starting
> and ending sector as it was before
> * create new partition 6
If you are going to do all that risky "remember the sector" stuff anyway, then
just resize the partition. "pvresize" works perfectly well for the PV.
You should always use pvresize when convenient. LVM is not smart enough
to know when PVs are actually on the same spindle. (Could be done
with enhancements to the metadata.) So it will happily stripe,
put mirror legs, etc, between the apparently separate PVs.
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 8:41 ` Radu Rendec
2011-03-04 13:50 ` Stuart D. Gathman
@ 2011-03-04 15:31 ` Phillip Susi
2012-03-05 23:07 ` Dan B.
2011-03-05 2:13 ` Scott Arthur
2 siblings, 1 reply; 16+ messages in thread
From: Phillip Susi @ 2011-03-04 15:31 UTC (permalink / raw)
To: LVM general discussion and development; +Cc: Radu Rendec
On 3/4/2011 3:41 AM, Radu Rendec wrote:
> They do. But the "2TB" disk is actually 2000GB, which is safe (it takes
> more than 2048GB to run into trouble with m$dos partitions).
They are actually only 2 trillion bytes, or 1862 GB.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-03 5:25 [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk Scott Arthur
2011-03-03 20:09 ` John Drescher
2011-03-03 20:18 ` Stuart D. Gathman
@ 2011-03-04 21:49 ` Koen Vermeer
2011-03-04 22:05 ` John Drescher
2 siblings, 1 reply; 16+ messages in thread
From: Koen Vermeer @ 2011-03-04 21:49 UTC (permalink / raw)
To: LVM general discussion and development
On 03/03/2011 06:25 AM, Scott Arthur wrote:
> 1 32.3kB 296MB 296MB primary ext4 boot
> 2 296MB 1000GB 1000GB extended
> 5 296MB 1000GB 1000GB logical lvm
> I'm obviously wanting to expand the LVM partition to fill the
> remaining 1TB of space.
I'm just a regular LVM user and maybe I'm misunderstanding you, but why
not simply add partition #2 as a physical volume? I thought that was one
of the advantages of LVM: not having to worry about that kind of thing.
Best,
Koen
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 12:19 ` Scott Arthur
@ 2011-03-04 21:57 ` Stuart D. Gathman
0 siblings, 0 replies; 16+ messages in thread
From: Stuart D. Gathman @ 2011-03-04 21:57 UTC (permalink / raw)
To: LVM general discussion and development
On Sat, 5 Mar 2011, Scott Arthur wrote:
> I did consider that as an easier option.
>
> Based on what is said here:
> http://tldp.org/HOWTO/LVM-HOWTO/multpartitions.html if I don't have striped
> logical volumes and there's only one physical drive, can I expect any
> performance issues?
With no striping or mirroring, there is no performance issue.
Even with striping or mirroring, you can manually designate which
PVs to use and maintain optimal performance. At some point, there
should be some metadata for PVs (if there isn't already) to mark them
as belonging to the same physical drive.
It would also be useful to mark PVs that reside on "0 seek time" media
like solid state drives. (Which have limited bandwidth, so you still
don't want to stripe or mirror on the same physical drive.) There is
less need to defragment a PV with 0 seek time, and it would be more
optimal for snapshot COW LVs to be on zero seek PVs (since the COW
blocks are mapped in essentially random order).
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 21:49 ` Koen Vermeer
@ 2011-03-04 22:05 ` John Drescher
2011-03-04 22:07 ` John Drescher
0 siblings, 1 reply; 16+ messages in thread
From: John Drescher @ 2011-03-04 22:05 UTC (permalink / raw)
To: LVM general discussion and development
On Fri, Mar 4, 2011 at 4:49 PM, Koen Vermeer <koen@vermeer.tv> wrote:
> On 03/03/2011 06:25 AM, Scott Arthur wrote:
>> �1 � � �32.3kB �296MB � 296MB � primary � ext4 � � � � boot
>> �2 � � �296MB � 1000GB �1000GB �extended
>> �5 � � �296MB � 1000GB �1000GB �logical � � � � � � � �lvm
>> I'm obviously wanting to expand the LVM partition to fill the
>> remaining 1TB of space.
>
> I'm just a regular LVM user and maybe I'm misunderstanding you, but why
> not simply add partition #2 as a physical volume? I thought that was one
> of the advantages of LVM: not having to worry about that kind of thing.
>
LVM pvresize is safe. I have done this many times at work. Even with >
10TB physical volumes. There is one potential problem if your pv has 2
metadata areas however it will inform you and in this case it will
refuse to resize instead of causing breakage.
John
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 22:05 ` John Drescher
@ 2011-03-04 22:07 ` John Drescher
0 siblings, 0 replies; 16+ messages in thread
From: John Drescher @ 2011-03-04 22:07 UTC (permalink / raw)
To: LVM general discussion and development
On Fri, Mar 4, 2011 at 5:05 PM, John Drescher <drescherjm@gmail.com> wrote:
> On Fri, Mar 4, 2011 at 4:49 PM, Koen Vermeer <koen@vermeer.tv> wrote:
>> On 03/03/2011 06:25 AM, Scott Arthur wrote:
>>> �1 � � �32.3kB �296MB � 296MB � primary � ext4 � � � � boot
>>> �2 � � �296MB � 1000GB �1000GB �extended
>>> �5 � � �296MB � 1000GB �1000GB �logical � � � � � � � �lvm
>>> I'm obviously wanting to expand the LVM partition to fill the
>>> remaining 1TB of space.
>>
>> I'm just a regular LVM user and maybe I'm misunderstanding you, but why
>> not simply add partition #2 as a physical volume? I thought that was one
>> of the advantages of LVM: not having to worry about that kind of thing.
>>
> LVM pvresize is safe. I have done this many times at work. Even with >
> 10TB physical volumes. There is one potential problem if your pv has 2
> metadata areas however it will inform you and in this case it will
> refuse to resize instead of causing breakage.
>
BTW, I did not mention but the fix for this is in the works.
John
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 8:41 ` Radu Rendec
2011-03-04 13:50 ` Stuart D. Gathman
2011-03-04 15:31 ` Phillip Susi
@ 2011-03-05 2:13 ` Scott Arthur
2011-03-05 15:11 ` Milan Broz
2011-03-06 12:24 ` Radu Rendec
2 siblings, 2 replies; 16+ messages in thread
From: Scott Arthur @ 2011-03-05 2:13 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 2563 bytes --]
I've been playing around on a test system with a similar partition table.
Have successfully resized 2 to fill the disk extent. Partition 5 however
proves to be problematic.
Using fdisk, I tried deleting 2 and 5 and recreating based on sectors, but
couldn't recreate 5 on the same starting sector, it told me I was out of
bounds.
I then tried the same thing with fdisk but with cylinders instead and both
partitions were recreated okay, but destroyed all my LVM stuff.
I can happily resize 2 using parted but parted wont resize 5.
Should I expect to be able to resize 5, or am I missing the point. Should I
simply be creating a partition 6 to fill the additional space opened up by
the resizing of partition 2?
On 4 March 2011 21:41, Radu Rendec <radu.rendec@mindbit.ro> wrote:
> On Thu, 2011-03-03 at 15:18 -0500, Stuart D. Gathman wrote:
> > On Thu, 3 Mar 2011, Scott Arthur wrote:
> >
> > > Partition Table: msdos
> > >
> > > Number Start End Size Type File system Flags
> > > 1 32.3kB 296MB 296MB primary ext4 boot
> > > 2 296MB 1000GB 1000GB extended
> > > 5 296MB 1000GB 1000GB logical lvm
> > >
> > > I'm obviously wanting to expand the LVM partition to fill the remaining
> 1TB
> > > of space.
> > >
> > > Am I able to simply use parted to resize the partition before doing a
> > > pvresize etc?
> > >
> > > Or is it risky to resize the underlying LVM partition?
>
> I wouldn't do that. Instead, I would create a new logical partition,
> "format" it as lvm physical volume and then extend the volume group to
> use this partition as well.
>
> I think this can be safely done like this:
>
> * turn off lvm;
> * note down the exact starting and ending *sector* of partition 5 (using
> fdisk -lu)
> * use fdisk and delete partition 5 and 2, then re-create partition 2 up
> to the full disk size
> * re-create partition 5 making sure it's on exactly the same starting
> and ending sector as it was before
> * create new partition 6
>
> > You are getting to a size where msdos partition tables are risky.
> > Don't they crap out at 2TB?
>
> They do. But the "2TB" disk is actually 2000GB, which is safe (it takes
> more than 2048GB to run into trouble with m$dos partitions).
>
> Best regards,
>
> Radu Rendec
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
--
Scottatron | Mob +6421 89 11 88 | skype scottatron
[-- Attachment #2: Type: text/html, Size: 3561 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-05 2:13 ` Scott Arthur
@ 2011-03-05 15:11 ` Milan Broz
2011-03-06 12:24 ` Radu Rendec
1 sibling, 0 replies; 16+ messages in thread
From: Milan Broz @ 2011-03-05 15:11 UTC (permalink / raw)
To: LVM general discussion and development
On 03/05/2011 03:13 AM, Scott Arthur wrote:
> I've been playing around on a test system with a similar partition
> table.
>
> Have successfully resized 2 to fill the disk extent. Partition 5
> however proves to be problematic.
>
> Using fdisk, I tried deleting 2 and 5 and recreating based on
> sectors, but couldn't recreate 5 on the same starting sector, it told
> me I was out of bounds.
>
> I then tried the same thing with fdisk but with cylinders instead and
> both partitions were recreated okay, but destroyed all my LVM stuff.
>
> I can happily resize 2 using parted but parted wont resize 5.
If the start of partition moves (even by 1 sector) LVM metadata will
not be recognised. So you must manipulate only with partition end.
Cylinders can round up the start of partition so this can easily happen.
fdisk in sector mode (fdisk -u) should allow that, if it is not possible,
I guess it is bug (be sure to use new fdisk from util-linux[-ng], there
was a lot of bugfixes in last years).
(and partition 5 is extended partition so you probably need to resize
"parent" partion before it as well.)
Anyway, from the LVM point of view you can do both - either move partition
end to enlarge disk (and inform LVM about it using pvresize afterward)
or simply add new partition to VG.
(The problems are usualy outside of LVM scope - like 2G partition limitation,
problems to change open partition size in kernel etc.)
Just avoid moving the start sector of PV - this will not work.
Milan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-05 2:13 ` Scott Arthur
2011-03-05 15:11 ` Milan Broz
@ 2011-03-06 12:24 ` Radu Rendec
1 sibling, 0 replies; 16+ messages in thread
From: Radu Rendec @ 2011-03-06 12:24 UTC (permalink / raw)
To: LVM general discussion and development
On Sat, 2011-03-05 at 15:13 +1300, Scott Arthur wrote:
> I've been playing around on a test system with a similar partition
> table.
>
>
> Have successfully resized 2 to fill the disk extent. Partition 5
> however proves to be problematic.
>
>
> Using fdisk, I tried deleting 2 and 5 and recreating based on sectors,
> but couldn't recreate 5 on the same starting sector, it told me I was
> out of bounds.
Perhaps there's a (hidden) problem with partition 2 as well: it should
also start on the same sector as it did before deleting/re-creating.
Otherwise it would "push" the beginning of partition 5 by a bunch of
sectors.
> I then tried the same thing with fdisk but with cylinders instead and
> both partitions were recreated okay, but destroyed all my LVM stuff.
It's exactly like Milan Broz said in his earlier post: if the partition
doesn't start at exactly the same location (sector) as it did before,
LVM won't find its metadata at the expected location, thus rendering the
volume unusable.
> I can happily resize 2 using parted but parted wont resize 5.
>
>
> Should I expect to be able to resize 5, or am I missing the point.
> Should I simply be creating a partition 6 to fill the additional space
> opened up by the resizing of partition 2?
Yup, you should create partition 6 to fill the remaining space, then
make it a physical volume and add it to the volume group. At least this
is what I had in mind when I made the other post.
Someone else also suggested simply extending the physical volume. I
haven't done this, but I guess it is also worth looking into it.
However, you should resize the partitions anyway (even if you use this
approach). It's just that you would resize partition 5 instead of
creating partition 6.
>
> On 4 March 2011 21:41, Radu Rendec <radu.rendec@mindbit.ro> wrote:
> On Thu, 2011-03-03 at 15:18 -0500, Stuart D. Gathman wrote:
> > On Thu, 3 Mar 2011, Scott Arthur wrote:
> >
> > > Partition Table: msdos
> > >
> > > Number Start End Size Type File system
> Flags
> > > 1 32.3kB 296MB 296MB primary ext4
> boot
> > > 2 296MB 1000GB 1000GB extended
> > > 5 296MB 1000GB 1000GB logical lvm
> > >
> > > I'm obviously wanting to expand the LVM partition to fill
> the remaining 1TB
> > > of space.
> > >
> > > Am I able to simply use parted to resize the partition
> before doing a
> > > pvresize etc?
> > >
> > > Or is it risky to resize the underlying LVM partition?
>
>
> I wouldn't do that. Instead, I would create a new logical
> partition,
> "format" it as lvm physical volume and then extend the volume
> group to
> use this partition as well.
>
> I think this can be safely done like this:
>
> * turn off lvm;
> * note down the exact starting and ending *sector* of
> partition 5 (using
> fdisk -lu)
> * use fdisk and delete partition 5 and 2, then re-create
> partition 2 up
> to the full disk size
> * re-create partition 5 making sure it's on exactly the same
> starting
> and ending sector as it was before
> * create new partition 6
>
> > You are getting to a size where msdos partition tables are
> risky.
> > Don't they crap out at 2TB?
>
>
> They do. But the "2TB" disk is actually 2000GB, which is safe
> (it takes
> more than 2048GB to run into trouble with m$dos partitions).
>
> Best regards,
>
> Radu Rendec
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk
2011-03-04 15:31 ` Phillip Susi
@ 2012-03-05 23:07 ` Dan B.
0 siblings, 0 replies; 16+ messages in thread
From: Dan B. @ 2012-03-05 23:07 UTC (permalink / raw)
To: LVM general discussion and development
Phillip Susi wrote:
> On 3/4/2011 3:41 AM, Radu Rendec wrote:
>> They do. But the "2TB" disk is actually 2000GB, which is safe (it takes
>> more than 2048GB to run into trouble with m$dos partitions).
>
> They are actually only 2 trillion bytes, or 1862 GB.
Don't abuse SI units like that. You apparently mean 1862 GiB.
Daniel
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2012-03-05 23:11 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03 5:25 [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk Scott Arthur
2011-03-03 20:09 ` John Drescher
2011-03-03 20:18 ` Stuart D. Gathman
2011-03-04 8:41 ` Radu Rendec
2011-03-04 13:50 ` Stuart D. Gathman
2011-03-04 15:31 ` Phillip Susi
2012-03-05 23:07 ` Dan B.
2011-03-05 2:13 ` Scott Arthur
2011-03-05 15:11 ` Milan Broz
2011-03-06 12:24 ` Radu Rendec
2011-03-04 10:13 ` Lyn Rees
2011-03-04 12:19 ` Scott Arthur
2011-03-04 21:57 ` Stuart D. Gathman
2011-03-04 21:49 ` Koen Vermeer
2011-03-04 22:05 ` John Drescher
2011-03-04 22:07 ` John Drescher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).