Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LVM2: Help, need to resize vg but cant?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
feld
Guru
Guru


Joined: 29 Aug 2004
Posts: 593
Location: WI, USA

PostPosted: Sun Oct 02, 2005 3:41 pm    Post subject: LVM2: Help, need to resize vg but cant? Reply with quote

ok heres the deal. this is on an 80 gig hard drive

hdd1 /boot 64MB primary
hdd2 /swap 256MB primary
hdd3 / 1024mb primary
hdd4 lvm 7xgb with other partitions in it --taking up the rest of the hard drive. (logical volume)

and then after the lvm i for some odd reason wanted to put another partition there or something... i dont know. bad idea, cuz its like impossible. i dont know what i was thinking. well my volume group is only 58gb on hdd4. i want it to take up ALL of that partition.

well as you can see i have approx 20gb on the hard drive NOT being used. i want to use it right now (extend some lvs)


what do i have to do to get that volume group to take up the rest of the hard drive? vgextend is a null command... hasnt been implemented yet. i've tried creating another vg on that partition so that i could try the vgmerge but u cant have 2 vg's on the same partition.


does ANYONE have any idea of what i need to do? i'm lost; clueless and i really want this hard drive space! my only other choice would be to backup and ript it all apart, redo the VG and lv's, and put it all back on but i dont want to go thru that. what do I have to do?



-Feld
_________________
< bmg505> I think the first line in reiserfsck is

if (random(65535)< 65500) { hose(partition); for (i=0;i<100000000;i++) print_crap(); }
Back to top
View user's profile Send private message
ecosta
Guru
Guru


Joined: 09 May 2003
Posts: 477
Location: Brussels,BE

PostPosted: Mon Oct 03, 2005 8:51 am    Post subject: Reply with quote

Are you sure vgextend doesn't work?
I haven't had the oportunity to test it yet but on my LVM2 the command seems to be working:
Code:

# vgextend
  Please enter volume group name and physical volume(s)
  vgextend: Add physical volumes to a volume group

vgextend
        [-A|--autobackup y|n]
        [-d|--debug]
        [-h|--help]
        [-t|--test]
        [-v|--verbose]
        [--version]
        VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...]


Please, please, please make a backup before you work with LVM, you can lose a lot of data very easily if you are not very carefull.

This is what I do to extend a Logical Volume:

if lvm was at 100 MB...
Code:

# umount /dev/vg00/lvol0
# lvextend -L 200 /dev/vg00/lvol0
# e2fsck -f /dev/vg00/lvol0 && resize2fs /dev/vg00/lvol0
# mount /dev/vg00/lvol0 /foo/bar


On the other hand, how did you set the size of your VG? I thought that a VG would take the whole PV it would be given. I can't see anything saying that vgcreate can be set to a specific size.

Look for the following and see if you have any free extents (Free PE):
Code:

# vgdisplay
  --- Volume group ---
  VG Name               vg00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               34.29 GB
  PE Size               4.00 MB
  Total PE              8778
  Alloc PE / Size       2517 / 9.83 GB
  Free  PE / Size       6261 / 24.46 GB
  VG UUID               M2Nohj-Ve4u-YVWX-642U-TKm2-TOzo-FQPcQu


Send me a bit more info and I might be able to help more.
Ed.
_________________
Linux user #201331
A8N-SLI Delux / AMD64 X2 3800+ / 1024 MB RAM / 5 x 250 GB SATA RAID 1/5 / ATI Radeon X700 256MB.
Back to top
View user's profile Send private message
feld
Guru
Guru


Joined: 29 Aug 2004
Posts: 593
Location: WI, USA

PostPosted: Mon Oct 03, 2005 5:39 pm    Post subject: Reply with quote

fdisk

Code:

Disk /dev/hdd: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1               1           9       72261   83  Linux
/dev/hdd2              10          41      257040   82  Linux swap / Solaris
/dev/hdd3              42         166     1004062+  83  Linux
/dev/hdd4             167        9729    76814797+  8e  Linux LVM

CFDisk shows hdd4 being at 78658.36MB

VGDisplay
Code:

skeletor feld # vgdisplay
  --- Volume group ---
  VG Name               vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  20
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                6
  Open LV               6
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               57.22 GB
  PE Size               4.00 MB
  Total PE              14649
  Alloc PE / Size       14592 / 57.00 GB
  Free  PE / Size       57 / 228.00 MB
  VG UUID               nKLMgv-0aTU-tT1f-mJEF-2Swy-c6a6-yk1ihg

Notice it is only 57.22GB? Wtf is up with that?

pvdisplay
Code:

skeletor feld # pvdisplay
  --- Physical volume ---
  PV Name               /dev/hdd4
  VG Name               vg
  PV Size               57.22 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              14649
  Free PE               57
  Allocated PE          14592
  PV UUID               P118Tt-IRIW-oupY-OR2k-EUO8-DFNp-kx96eG

yup, still 57.22GB. not the correct size...


Code:

NAME
       vgextend - add physical volumes to a volume group
DESCRIPTION
       vgextend  allows  you to add one or more initialized physical vol-
       umes ( see pvcreate(8) ) to an existing volume group to extend  it
       in size.


i dont think thats what i'm looking for.....

i'll keep thinking and looking around.


thanks


-feld
_________________
< bmg505> I think the first line in reiserfsck is

if (random(65535)< 65500) { hose(partition); for (i=0;i<100000000;i++) print_crap(); }
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum