LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can't extend volume group (http://www.linuxquestions.org/questions/linux-general-1/cant-extend-volume-group-117182/)

flv7a 11-17-2003 05:17 PM

Can't extend volume group
 
I'm trying to extend a volume group across a second physical volume without success and am looking for a little help.

My hard drive layout is as follows:
hda1 ntfs - windows part. - irrelevant
hda2 bootmanager - irrelevant
hda3 linux boot
hda4 extended
----hda5 linux lvm <- partition that currently houses Volume00
----hda6 linux lvm <- partition that I'm trying to add to Volume00

output from parted print to confirm the above:
Using /dev/hda
Information: The operating system thinks the geometry on /dev/hda is
5168/240/63. Therefore, cylinder 1024 ends at 7559.999M.
(parted) print
Disk geometry for /dev/hda: 0.000-38154.375 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 18722.812 primary ntfs
3 18722.812 18826.171 primary ext3 boot
4 18826.172 38146.992 extended lba
5 18826.203 29066.132 logical lvm
6 29066.164 38146.992 logical lvm
2 38146.992 38154.375 primary

Given the partition type and everything else, I should be able to add hda6 to the volume group Volume00 by running:
vgextend -v Volume00 /dev/hda6
But when doing so I get the following:
[root@Q-redhat ~] $ vgextend -v Volume00 /dev/hda6
vgextend -- locking logical volume manager
vgextend -- checking volume group name "Volume00"
vgextend -- checking volume group "Volume00" existence
vgextend -- checking for inactivity of volume group
vgextend -- reading data of volume group "Volume00" from lvmtab
vgextend -- INFO: maximum logical volume size is 255.99 Gigabyte
vgextend -- reading data for all physical volumes from disk(s)
vgextend -- extending VGDA structures of volume group "Volume00"
vgextend -- ERROR: no physical volumes usable to extend volume group "Volume00"


Any ideas on why I might be getting this or have ideas on how to get more information?

Thanks,

Quint

flv7a 11-17-2003 05:23 PM

No sooner did I post than I answered my own question...
I had forgotten:
pvcreate -v /dev/hda6

Thanks...all is well now

jspsandhu 01-03-2006 11:47 PM

Hey After adding space to VG, how to add space to lv?

I tried
#lvextend -L68G /dev/VolGroup00/LogVol00
New size given (2176 extents) not larger than existing size (2897 extents)
lvextend: Add space to a logical volume

lvextend
[-A|--autobackup y|n]
[--alloc AllocationPolicy]
[-d|--debug]
[-h|--help]
[-i|--stripes Stripes [-I|--stripesize StripeSize]]
{-l|--extents [+]LogicalExtentsNumber |
-L|--size [+]LogicalVolumeSize[kKmMgGtT]}
[-n|--nofsck]
[-r|--resizefs]
[-t|--test]
[--type VolumeType]
[-v|--verbose]
[--version]
LogicalVolume[Path] [ PhysicalVolumePath... ]

My vgdisplay is as follows
#vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 4
Act PV 4
VG Size 158.91 GB
PE Size 32.00 MB
Total PE 5085
Alloc PE / Size 2897 / 90.53 GB
Free PE / Size 2188 / 68.38 GB
VG UUID lyafjT-dHEX-KtY3-j4WB-fspU-Ed0Q-XmmaIt

lvdisplay is as follows

#lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID cVS7VW-taUs-3DFg-KLuM-DoEm-qhHj-HO1New
LV Write Access read/write
LV Status available
# open 1
LV Size 90.53 GB
Current LE 2897
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0

Now a partition /ds is mounted on this logical volume I need to extend its space as it is getting full
Is it necessary to take backup before I can do this (then it becomes simple)But without doing that can I increase the space???

Thanks

Regards
Jaspreet:Pengy:

WhatsHisName 01-04-2006 12:07 AM

You probably meant “-L+68G”, which means add 68G, as opposed to “-L68G”, which means make it a total of 68G. See “man lvextend” for how -L is defined.

Try:

# lvextend -L+68G /dev/VolGroup00/LogVol00

Followed by:

# resize2fs /dev/VolGroup00/LogVol00

to enlarge the ext3 filesystem to fill the available space.


It's always a good idea to have a backup when you are messing with your filesystem, but these operations are relatively safe.

haertig 01-04-2006 12:10 AM

lvextend -L68G ... will try to set the LV size to 68G. It's balking because the LV is already bigger than that ... 90Gb per your lvdisplay output.

I think you intended to ADD 68G to the existing LV, not resize it down to 68G. You need a plus sign after the L and before the 68G.

Like this: lvextend -L+68G ...

[edit]
Man, no sooner did I type that and submit the post, somebody else beat me to the punch by 3 minutes and our messages crossed paths. Guess I need to learn to type faster!
[/edit]

haertig 01-04-2006 12:16 AM

Also, adding to what WhatsHisName already said, you will probably need to run e2fsck on the lvextend'ed volume before your run resize2fs. resize2fs will probably advise you of this and refuse to do anything until you first comply with it's wishes!

jspsandhu 01-04-2006 12:29 AM

Yeah Man Thanks I tried that and it worked

That was the problem
I had to Add not to extend only

I Used -L+68G and it worked :)

Then there was another command that has to be used and the command is

ext2online /dev/VolGroup00/LogVol00

this is a good command

Even If ur partitions are online and being used u can resize ur logical volume

I am using RHEL AS 4.0 not sure about other OS

jspsandhu 01-04-2006 01:11 AM

Hey

If I use

# resize2fs /dev/VolGroup00/LogVol00

will this format my partitions??????:Pengy:

Do i have to umount this partition before doing this??????
:Pengy:

WhatsHisName 01-04-2006 01:20 AM

Yes, good point. resize2fs requires the filesystem to be unmounted.

But even “man ext2online” comes with this warning:

“...WARNING

Note that resizing a mounted filesystem is inherently dangerous and may corrupt filesystems, although no errors resulting in data loss have ever been reported to the author. In theory online resizing should work fine with arbitrarily large filesystems, but it has not yet been tested by the author on a filesystem larger than 11GB. Use with caution. Backups are always a good idea, because your disk may fail at any time, you delete files by accident, or your computer is struck by a meteor...”

haertig 01-04-2006 10:17 AM

Quote:

Originally Posted by jspsandhu
Hey

If I use

# resize2fs /dev/VolGroup00/LogVol00

will this format my partitions??????:Pengy:

Do i have to umount this partition before doing this??????
:Pengy:

No, it won't format.

Yes, you need to unmount first, since "resize2fs" implies you're using ext3 or ext2. Other filesystem types may or may not need to be mounted for resizing. I'm thinking that XFS must actually BE MOUNTED to resize, but don't quote me on that. Ditto for JFS.

jspsandhu 01-04-2006 11:02 AM

Okie Doks

Thanks for the info guys it was really helpfull

joaquin386 03-17-2010 06:20 AM

ext2online works perfectly to resize the volumes

suresh_krish 09-14-2010 02:59 PM

lvextend -L+1G /dev/ag01/agvl
Extending logical volume agvl to 2.00 GB
device-mapper: reload ioctl failed: Invalid argument
Failed to suspend agvl

suresh_krish 09-14-2010 03:04 PM

hi friends i cont able to extend lv. i got the below error pd guide

:::VG details:::
VG Name ag01
System ID
Format lvm2
Metadata Areas 6
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 6
Open LV 1
Max PV 0
Cur PV 6
Act PV 6
VG Size 5.43 GB
PE Size 4.00 MB
Total PE 1389
Alloc PE / Size 857 / 3.35 GB
Free PE / Size 532 / 2.08 GB
VG UUID xFrpeI-imJm-LXg8-uXrD-CBQb-x2Hb-JzbXJ1


::lv details::

LV Name /dev/ag01/agvl
VG Name ag01
LV UUID aB8GJC-PBLG-LAmC-f2UK-Rxni-jb1c-UecxBS
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GB
Current LE 256
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:7

::Error i got while extending lv:

lvextend -L+1G /dev/ag01/agvl
Extending logical volume agvl to 2.00 GB
device-mapper: reload ioctl failed: Invalid argument
Failed to suspend agvl


All times are GMT -5. The time now is 09:08 PM.