LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-17-2003, 05:17 PM   #1
flv7a
LQ Newbie
 
Registered: Apr 2003
Posts: 20

Rep: Reputation: 0
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
 
Old 11-17-2003, 05:23 PM   #2
flv7a
LQ Newbie
 
Registered: Apr 2003
Posts: 20

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

Thanks...all is well now
 
Old 01-03-2006, 11:47 PM   #3
jspsandhu
Member
 
Registered: Dec 2004
Location: Slough, UK
Distribution: Fedora, FreeBSD, RHEL
Posts: 85

Rep: Reputation: 15
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
 
Old 01-04-2006, 12:07 AM   #4
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
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.
 
Old 01-04-2006, 12:10 AM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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]

Last edited by haertig; 01-04-2006 at 12:12 AM.
 
Old 01-04-2006, 12:16 AM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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!
 
Old 01-04-2006, 12:29 AM   #7
jspsandhu
Member
 
Registered: Dec 2004
Location: Slough, UK
Distribution: Fedora, FreeBSD, RHEL
Posts: 85

Rep: Reputation: 15
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
 
Old 01-04-2006, 01:11 AM   #8
jspsandhu
Member
 
Registered: Dec 2004
Location: Slough, UK
Distribution: Fedora, FreeBSD, RHEL
Posts: 85

Rep: Reputation: 15
Hey

If I use

# resize2fs /dev/VolGroup00/LogVol00

will this format my partitions??????

Do i have to umount this partition before doing this??????
 
Old 01-04-2006, 01:20 AM   #9
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
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...”
 
Old 01-04-2006, 10:17 AM   #10
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by jspsandhu
Hey

If I use

# resize2fs /dev/VolGroup00/LogVol00

will this format my partitions??????

Do i have to umount this partition before doing this??????
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.
 
Old 01-04-2006, 11:02 AM   #11
jspsandhu
Member
 
Registered: Dec 2004
Location: Slough, UK
Distribution: Fedora, FreeBSD, RHEL
Posts: 85

Rep: Reputation: 15
Okie Doks

Thanks for the info guys it was really helpfull
 
Old 03-17-2010, 06:20 AM   #12
joaquin386
LQ Newbie
 
Registered: Mar 2010
Posts: 12

Rep: Reputation: 0
ext2online works perfectly to resize the volumes
 
Old 09-14-2010, 02:59 PM   #13
suresh_krish
LQ Newbie
 
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
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
 
Old 09-14-2010, 03:04 PM   #14
suresh_krish
LQ Newbie
 
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
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
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I resize LVM volume group? rconan Fedora 5 04-22-2009 07:45 PM
Cannot Remove Volume Group Icon from Desktop rsmith Linux - Newbie 0 01-16-2005 07:21 PM
Does Anyone Know About The Hard Drive Volume Group harley51 Fedora 1 11-21-2004 07:13 PM
Hard Drive Volume Group harley51 Fedora 0 11-20-2004 07:26 PM
Volume group data missing Smthian AIX 1 07-28-2004 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:35 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
Open Source Consulting | Domain Registration