LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 03-25-2013, 03:48 PM   #1
rnbguy
LQ Newbie
 
Registered: Apr 2009
Posts: 7

Rep: Reputation: 0
pvextend not working


Hi All,

I have added 100GIG of disk to one of my LUNs however after a powermt scan i'm still not able to extend the physical from 100GIG to 200GIG.

The confusing thing is I can see the full disk in 'fdisk -l':

Code:
Disk /dev/emcpowerb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

         Device Boot      Start         End      Blocks   Id  System
/dev/emcpowerb1               1       13054   104856223+  8e  Linux LVM

... But my physical volume won't extend:
Code:
pvresize /dev/emcpowerb1
  Physical volume "/dev/emcpowerb1" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

[root@HN-Prod-MySQL01 ~]# pvscan
  PV /dev/emcpowerb1     VG vglog01    lvm2 [100.00 GB / 50.00 GB free]


any help would be great on this?
 
Old 03-25-2013, 07:31 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
Looks like you haven't extended the partition
Quote:
Disk /dev/emcpowerb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/emcpowerb1 1 13054 104856223+ 8e Linux LVM
Actually I might be wrong there, can you display it in sectors rather than cylinders?

Last edited by kbp; 03-25-2013 at 07:33 PM.
 
Old 03-26-2013, 12:54 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Your total disk space may be 200Gb, but that first partition is only 100Gb. pvresize can't grow the PV to larger than the partition it is made out of.

You can either:

(1) Resize the partition larger (using fdisk ?), then run pvresize. Since I have never used pvresize personally I am not familiar with this procedure. I wouldn't think you'd have to do anything with the VG at this point, and could simply grow your LV(s) now. But having never used pcresize, I cannot say for sure without doing some research.

-or-

(2) Leave the first partition as it is, make a second partition out of the rest of your disk using fdisk, mark that second partition as a PV with pvcreate, then add that new PV to the existing VG with vgextend, then grow your LV(s) (specific steps for growing an LV vary depending on filesystem type).

======

Method (2) is much safer IMHO. I have never liked resizing partitions while trying to keep their data intact. That gives me the willies just thinking about it. I did it once or twice in Windows using "Partition Magic" years ago, and it worked, but I was nervous the entire operation even though I had everything well backed up before starting. I have used method (2) many many times - adding hard disks, creating new partitions, marking those new partitions as PV's, adding those new PV's to existing VG's, and then extending LV's.

Last edited by haertig; 03-30-2013 at 07:19 PM.
 
Old 03-27-2013, 12:19 AM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
I've used method (1) before but I had backups and it wasn't a production system so I wasn't too concerned

- note the partition start block and type
- using fdisk delete the partition and recreate starting at the same start block but finishing at the end
- ensure the new partition has the same type as before
- 'w' to save changes

Then continue on with pvresize /dev/emcpowerb1

* no responsibility accepted for any loss of data or productivity!
 
Old 03-30-2013, 05:28 AM   #5
rnbguy
LQ Newbie
 
Registered: Apr 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Brilliant replies, I will go with option 2 above but will keep notes of option 1 for future reference, thanks guys.

it would be good if the initial partition could be dynamic so whenever disk of the original partition grew a simple resize could take place
 
Old 03-30-2013, 06:53 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
You can just use the whole device without partitioning at all, but I never do it this way as it can be confusing for people to see no partition. I have a vague memory that it will automatically resize if you increase the volume, but you should probably read up to confirm.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Wifi not working in Eee PPC 1000HE (Debian Squeeze), but ethernet is working someshpr Linux - Laptop and Netbook 8 10-10-2011 04:59 PM
media problem with .avi --- audio only in vlc working rest amarock ,etc. not working fedex Linux - Newbie 1 12-22-2007 09:06 AM
SED - minor changes work - Larger doesn't (working and non working code included) Nimoy Programming 17 09-22-2007 05:34 PM
Fortemedia FM801 card not working under FC5 on Intel 845 but working with windows morningkiran Linux - Hardware 0 11-30-2006 08:57 AM
acpi nearly working IBM thinkpad R40e 2684HVG no Fn key working, throttling OK Emmanuel_uk Linux - Laptop and Netbook 2 05-31-2006 02:41 AM


All times are GMT -5. The time now is 02:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration