linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] pvresize after extending RAID array
@ 2007-06-18 21:16 Peter Daum
  2007-06-19  9:49 ` [linux-lvm] " Peter Daum
  2007-06-19 13:16 ` [linux-lvm] " Alasdair G Kergon
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Daum @ 2007-06-18 21:16 UTC (permalink / raw)
  To: linux-lvm

I have a physical volume consisting of 1 hardware raid array (/dev/sdb).
Now I added some disks to the raid array, extending its size from 4.5
to ~6 TB. The kernel (Linux 2.6.16.51) now correctly reports the new
device size:

# cat /sys/block/sdb/size
12695042048

From reading the manuals I got the impression, that all that is needed
to be able to use the additional space is "pvresize /dev/sdb".
Unfortunately, it looks like pvresize insists on the old device size:

# pvresize -v  -d  /dev/sdb
File descriptor 3 left open
    Using physical volume(s) on command line
    Archiving volume group "raid6_12" metadata (seqno 19).
    No change to size of physical volume /dev/sdb.
    Resizing volume "/dev/sdb" to 9765416576 sectors.
    Updating physical volume "/dev/sdb"
    Creating volume group backup "/etc/lvm/backup/raid6_12" (seqno 20).
  Physical volume "/dev/sdb" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

Did I miss something? Is there anything to worry about or should I just
go ahead and set the new device size manually:
# pvresize -v  -d --setphysicalvolumesize 6347521024k /dev/sdb
File descriptor 3 left open
    Using physical volume(s) on command line
    Archiving volume group "raid6_12" metadata (seqno 22).
  WARNING: /dev/sdb: Overriding real size. You could lose data.
    /dev/sdb: Pretending size is 12695042048 not 12695035904 sectors.
    No change to size of physical volume /dev/sdb.
    Resizing volume "/dev/sdb" to 12695041664 sectors.
    Updating physical volume "/dev/sdb"
    Creating volume group backup "/etc/lvm/backup/raid6_12" (seqno 23).
  Physical volume "/dev/sdb" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

In this case, pvresize comes up with yet another size for the device
(12695035904 sectors) - is this the actual size of the device minus
the space needed for lvm's metadata? Should I manually set to this?

Any comments?

Regards,
                          Peter Daum

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [linux-lvm] Re: pvresize after extending RAID array
  2007-06-18 21:16 [linux-lvm] pvresize after extending RAID array Peter Daum
@ 2007-06-19  9:49 ` Peter Daum
  2007-06-19 13:16 ` [linux-lvm] " Alasdair G Kergon
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Daum @ 2007-06-19  9:49 UTC (permalink / raw)
  To: linux-lvm


Little Addendum:
After a reboot (which of course defeats the purpose a little) lvm
recognizes the new device size:

# pvresize -v  -d  /dev/sdb
    Using physical volume(s) on command line
    Archiving volume group "raid6_12" metadata (seqno 30).
    Resizing physical volume /dev/sdb from 1192067 to 1549687 extents.
    Resizing volume "/dev/sdb" to 12695041664 sectors.
    Updating physical volume "/dev/sdb"
    Creating volume group backup "/etc/lvm/backup/raid6_12" (seqno 31).
  Physical volume "/dev/sdb" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

The figures reported by pvresize are the same as below (except without
warnings this time) so I guess it generally would be o.k in such a case
to just use the kernel's device size and set it manually with
"--setphysicalvolumesize"?


Peter Daum wrote:
> I have a physical volume consisting of 1 hardware raid array (/dev/sdb).
> Now I added some disks to the raid array, extending its size from 4.5
> to ~6 TB. The kernel (Linux 2.6.16.51) now correctly reports the new
> device size:
> 
> # cat /sys/block/sdb/size
> 12695042048
> 
>>From reading the manuals I got the impression, that all that is needed
> to be able to use the additional space is "pvresize /dev/sdb".
> Unfortunately, it looks like pvresize insists on the old device size:
> 
> # pvresize -v  -d  /dev/sdb
> File descriptor 3 left open
>     Using physical volume(s) on command line
>     Archiving volume group "raid6_12" metadata (seqno 19).
>     No change to size of physical volume /dev/sdb.
>     Resizing volume "/dev/sdb" to 9765416576 sectors.
>     Updating physical volume "/dev/sdb"
>     Creating volume group backup "/etc/lvm/backup/raid6_12" (seqno 20).
>   Physical volume "/dev/sdb" changed
>   1 physical volume(s) resized / 0 physical volume(s) not resized
> 
> Did I miss something? Is there anything to worry about or should I just
> go ahead and set the new device size manually:
> # pvresize -v  -d --setphysicalvolumesize 6347521024k /dev/sdb
> File descriptor 3 left open
>     Using physical volume(s) on command line
>     Archiving volume group "raid6_12" metadata (seqno 22).
>   WARNING: /dev/sdb: Overriding real size. You could lose data.
>     /dev/sdb: Pretending size is 12695042048 not 12695035904 sectors.
>     No change to size of physical volume /dev/sdb.
>     Resizing volume "/dev/sdb" to 12695041664 sectors.
>     Updating physical volume "/dev/sdb"
>     Creating volume group backup "/etc/lvm/backup/raid6_12" (seqno 23).
>   Physical volume "/dev/sdb" changed
>   1 physical volume(s) resized / 0 physical volume(s) not resized
> 
> In this case, pvresize comes up with yet another size for the device
> (12695035904 sectors) - is this the actual size of the device minus
> the space needed for lvm's metadata? Should I manually set to this?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] pvresize after extending RAID array
  2007-06-18 21:16 [linux-lvm] pvresize after extending RAID array Peter Daum
  2007-06-19  9:49 ` [linux-lvm] " Peter Daum
@ 2007-06-19 13:16 ` Alasdair G Kergon
  2007-06-19 17:46   ` [linux-lvm] " Peter Daum
  1 sibling, 1 reply; 4+ messages in thread
From: Alasdair G Kergon @ 2007-06-19 13:16 UTC (permalink / raw)
  To: LVM general discussion and development

Exactly which version of LVM2 was this (e.g. output of 'lvm version')?

> # cat /sys/block/sdb/size
> 12695042048
 
Use the 'blockdev' command - that gets the sizes the same way that lvm2
does.

Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [linux-lvm] Re: pvresize after extending RAID array
  2007-06-19 13:16 ` [linux-lvm] " Alasdair G Kergon
@ 2007-06-19 17:46   ` Peter Daum
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Daum @ 2007-06-19 17:46 UTC (permalink / raw)
  To: linux-lvm


Alasdair G Kergon wrote:
> Exactly which version of LVM2 was this (e.g. output of 'lvm version')?
# lvm version
  LVM version:     2.02.07 (2006-07-17)
  Library version: 1.02.08 (2006-07-17)
  Driver version:  4.5.0

> 
>> # cat /sys/block/sdb/size
>> 12695042048
>  
> Use the 'blockdev' command - that gets the sizes the same way that lvm2
> does.

Hopefully not the same way as "blockdev --getsz" does it
(which silently fails on that disk; "blockdev --getsize64 /dev/sdb" reports
the correct size in bytes)

Regards,
                    Peter Daum

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-19 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-18 21:16 [linux-lvm] pvresize after extending RAID array Peter Daum
2007-06-19  9:49 ` [linux-lvm] " Peter Daum
2007-06-19 13:16 ` [linux-lvm] " Alasdair G Kergon
2007-06-19 17:46   ` [linux-lvm] " Peter Daum

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).