Linux
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Linux

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 18th, 2007, 05:10 PM
Peter Daum
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
pvresize after extending RAID array

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 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: 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


linux-lvm mailing list
linux-lvm (AT) redhat (DOT) com

read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/

Reply With Quote
  #2  
Old June 19th, 2007, 06:11 AM
Peter Daum
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
pvresize after extending RAID array

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
""?


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 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: 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?


linux-lvm mailing list
linux-lvm (AT) redhat (DOT) com

read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/

Reply With Quote
  #3  
Old June 19th, 2007, 08:40 AM
Alasdair G Kergon
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
pvresize after extending RAID array

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 (AT) redhat (DOT) com


linux-lvm mailing list
linux-lvm (AT) redhat (DOT) com

read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/

Reply With Quote
  #4  
Old June 19th, 2007, 01:10 PM
Peter Daum
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
pvresize after extending RAID array

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 " does it
(which silently fails on that disk; "blockdev /dev/sdb" reports
the correct size in bytes)

Regards,
Peter Daum


linux-lvm mailing list
linux-lvm (AT) redhat (DOT) com

read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/

Reply With Quote
  #5  
Old October 19th, 2007, 06:05 PM
blenc blenc is offline
Registered User
Dev Archives Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 1 blenc User rank is Just a Lowly Private (1 - 20 Reputation Level)  
Time spent in forums: 12 m 10 sec
Reputation Power: 0
I too noticed that /sys/block/sdb/size and /proc/partitions reported the size corresponding to the new and correct value after array online expansion. But blockdev didn't and pvresize seems to use the value that blockdev is reporting. I suspected that the block device was locked somehow, so that the update wouldn't happen until the lock was removed. It seems that it's lvm itself that is locking it, because this procedure solved the problem:

pvchange -x n /dev/sdb
pvresize /dev/sdb
pvchange -x y /dev/sdb


[QUOTE=Peter Daum]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 " does it
(which silently fails on that disk; "blockdev /dev/sdb" reports
the correct size in bytes)

Regards,
Peter Daum

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Linux > pvresize after extending RAID array


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway