LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I have spce in volume group but it can not increase the size of logical volume (https://www.linuxquestions.org/questions/linux-newbie-8/i-have-spce-in-volume-group-but-it-can-not-increase-the-size-of-logical-volume-940000/)

anis123 04-16-2012 03:12 AM

I have spce in volume group but it can not increase the size of logical volume
 
Dear All

I have almost 108 Gb space .but when i increase the size of logical volume .it can not increase the size of logical volume.
i use the following command
herer is my detail of vgdisplay
VG Name xen-vol
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 150.01 GiB
PE Size 4.00 MiB
Total PE 38402
Alloc PE / Size 10502 / 41.02 GiB
Free PE / Size 27900 / 108.98 GiB
VG UUID fbfxhr-x3l3-EJCj-gwVp-tgox-1POl-x1ScSt

Here is lvdisplay details

lvdisplay
--- Logical volume ---
LV Name /dev/xen-vol/lvmtest-swap
VG Name xen-vol
LV UUID ZTV6g3-YLGv-QgoY-U5bp-UAdc-fOxD-i22lK2
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GiB
Current LE 256
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0

--- Logical volume ---
LV Name /dev/xen-vol/lvmtest-disk
VG Name xen-vol
LV UUID uiaLoC-1Z4r-EW6S-NzxM-D4hM-4KVD-e00Ou4
LV Write Access read/write
LV Status available
# open 1
LV Size 40.02 GiB
Current LE 10246
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1



lvextend -v -L +10G /dev/xen-vol/lvmtest-disk




after that i also use resize2fs /dev/xvda2

kindly help me in this regards

Thank you

linuxlover.chaitanya 04-16-2012 03:19 AM

Can we have your fdisk -l output as well? And can you edit your post to include the output from the commands in Code tags. its so frustrating to read through the output this way.

acid_kewpie 04-16-2012 03:27 AM

you said "it can not" but not said anything useful about what actually happens. Are you getting error message you're not sharing with us etc.?

anis123 04-16-2012 04:15 AM

i have volume group
 
Quote:

Originally Posted by linuxlover.chaitanya (Post 4653838)
Can we have your fdisk -l output as well? And can you edit your post to include the output from the commands in Code tags. its so frustrating to read through the output this way.

Fdisk -l

Here is my fdisk -l output here attached 2 harddisk i use /dev/sdb which size is 200GB.i create LVM on this disk and i use debian squeez

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002152b

Device Boot Start End Blocks Id System
/dev/sda1 1 499 4002816 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2 499 30402 240193537 5 Extended
/dev/sda5 499 30402 240193536 83 Linux

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029984

Device Boot Start End Blocks Id System
/dev/sdb1 1 13055 104864256 8e Linux LVM
/dev/sdb2 13056 19583 52436160 8e Linux LVM

Disk /dev/dm-0: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 43.0 GB, 42974838784 bytes
255 heads, 63 sectors/track, 5224 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table




hera is my clear output of Vgdisplay

Vgdisplay

VG Name xen-vol
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 150.01 GiB
PE Size 4.00 MiB
Total PE 38402
Alloc PE / Size 10502 / 41.02 GiB
Free PE / Size 27900 / 108.98 GiB
VG UUID fbfxhr-x3l3-EJCj-gwVp-tgox-1POl-x1ScSt

and here is my clear lvdisply out put
lvdisplay
--- Logical volume ---
LV Name /dev/xen-vol/lvmtest-swap
VG Name xen-vol
LV UUID ZTV6g3-YLGv-QgoY-U5bp-UAdc-fOxD-i22lK2
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GiB
Current LE 256
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0

--- Logical volume ---
LV Name /dev/xen-vol/lvmtest-disk
VG Name xen-vol
LV UUID uiaLoC-1Z4r-EW6S-NzxM-D4hM-4KVD-e00Ou4
LV Write Access read/write
LV Status available
# open 1
LV Size 40.02 GiB
Current LE 10246
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1

linuxlover.chaitanya 04-16-2012 04:28 AM

As I said before, please use Code tags so that it is easier for members to read the computer output.

catkin 04-16-2012 04:46 AM

What was the output from lvextend -v -L +10G /dev/xen-vol/lvmtest-disk?

Is /dev/xvda2 in resize2fs /dev/xvda2 intended to be the same device? Why is it not also /dev/xen-vol/lvmtest-disk?

acid_kewpie 04-16-2012 04:46 AM

Why do you care what fdisk says? The VG is 150GB regardless of the physical disk it's on.

anis123 04-16-2012 05:04 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 4653872)
As I said before, please use Code tags so that it is easier for members to read the computer output.

Fdisk -l

Here is my fdisk -l output here attached 2 harddisk i use /dev/sdb which size is 200GB.i create LVM on this disk and i use debian squeez

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002152b

Device Boot Start End Blocks Id System
/dev/sda1 1 499 4002816 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2 499 30402 240193537 5 Extended
/dev/sda5 499 30402 240193536 83 Linux

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029984

Device Boot Start End Blocks Id System
/dev/sdb1 1 13055 104864256 8e Linux LVM
/dev/sdb2 13056 19583 52436160 8e Linux LVM

Disk /dev/dm-0: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 43.0 GB, 42974838784 bytes
255 heads, 63 sectors/track, 5224 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table




hera is my clear output of Vgdisplay

Vgdisplay

VG Name "xen-vol"
System "ID"
Format "lvm2"
Metadata Areas 2
Metadata Sequence No 8
VG Access "read/write"
VG Status "resizable"
MAX LV "0"
Cur LV "2"
Open LV "2"
Max PV "0"
Cur PV "2"
Act PV "2"
VG Size "150.01 GiB"
PE Size "4.00 MiB"
Total PE "38402"
Alloc PE / Size "10502 / 41.02 GiB"
Free PE / Size "27900 / 108.98 GiB"
VG UUID fbfxhr-x3l3-EJCj-gwVp-tgox-1POl-x1ScSt

and here is my clear lvdisply out put
lvdisplay
--- Logical volume ---
LV Name "/dev/xen-vol/lvmtest-swap"
VG Name "xen-vol"
LV UUID "ZTV6g3-YLGv-QgoY-U5bp-UAdc-fOxD-i22lK2"
LV Write Access "read/write"
LV Status available
# open 1
LV Size "1.00 GiB"
Current LE "256"
Segments "1"
Allocation "inherit"
Read ahead sectors "auto"
- currently set to "256"
Block device "254:0"

--- Logical volume ---
LV Name "/dev/xen-vol/lvmtest-disk"
VG Name "xen-vol"
LV UUID "uiaLoC-1Z4r-EW6S-NzxM-D4hM-4KVD-e00Ou4"
LV Write Access "read/write"
LV Status "available"
# open "1"
LV Size "40.02 GiB"
Current LE "10246"
Segments "1"
Allocation "inherit"
Read ahead sectors "auto"
- currently set to "256"
Block device "254:1"



I use the following command for lvextend

lvextend -v -L +10GB -n /dev/xen-vol/lvmtest-disk

acid_kewpie 04-16-2012 05:06 AM

OK, this stuff you're posting isn't useful, and you're just repeating yourself. Can you answer the other questions you've been asked please?

anis123 04-16-2012 05:15 AM

Quote:

Originally Posted by anis123 (Post 4653891)
Fdisk -l

Here is my fdisk -l output here attached 2 harddisk i use /dev/sdb which size is 200GB.i create LVM on this disk and i use debian squeez

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002152b

Device Boot Start End Blocks Id System
/dev/sda1 1 499 4002816 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2 499 30402 240193537 5 Extended
/dev/sda5 499 30402 240193536 83 Linux

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029984

Device Boot Start End Blocks Id System
/dev/sdb1 1 13055 104864256 8e Linux LVM
/dev/sdb2 13056 19583 52436160 8e Linux LVM

Disk /dev/dm-0: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 43.0 GB, 42974838784 bytes
255 heads, 63 sectors/track, 5224 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table




hera is my clear output of Vgdisplay

Vgdisplay

VG Name "xen-vol"
System "ID"
Format "lvm2"
Metadata Areas 2
Metadata Sequence No 8
VG Access "read/write"
VG Status "resizable"
MAX LV "0"
Cur LV "2"
Open LV "2"
Max PV "0"
Cur PV "2"
Act PV "2"
VG Size "150.01 GiB"
PE Size "4.00 MiB"
Total PE "38402"
Alloc PE / Size "10502 / 41.02 GiB"
Free PE / Size "27900 / 108.98 GiB"
VG UUID fbfxhr-x3l3-EJCj-gwVp-tgox-1POl-x1ScSt

and here is my clear lvdisply out put
lvdisplay
--- Logical volume ---
LV Name "/dev/xen-vol/lvmtest-swap"
VG Name "xen-vol"
LV UUID "ZTV6g3-YLGv-QgoY-U5bp-UAdc-fOxD-i22lK2"
LV Write Access "read/write"
LV Status available
# open 1
LV Size "1.00 GiB"
Current LE "256"
Segments "1"
Allocation "inherit"
Read ahead sectors "auto"
- currently set to "256"
Block device "254:0"

--- Logical volume ---
LV Name "/dev/xen-vol/lvmtest-disk"
VG Name "xen-vol"
LV UUID "uiaLoC-1Z4r-EW6S-NzxM-D4hM-4KVD-e00Ou4"
LV Write Access "read/write"
LV Status "available"
# open "1"
LV Size "40.02 GiB"
Current LE "10246"
Segments "1"
Allocation "inherit"
Read ahead sectors "auto"
- currently set to "256"
Block device "254:1"



I use the following command for lvextend

lvextend -v -L +10GB -n /dev/xen-vol/lvmtest-disk

output of this command


Finding volume group xen-vol
Archiving volume group "xen-vol" metadata (seqno 8).
Extending logical volume lvmtest-disk to 50.02 GiB
Found volume group "xen-vol"
Found volume group "xen-vol"
Loading xen--vol-lvmtest--disk table (254:1)
Suspending xen--vol-lvmtest--disk (254:1) with device flush
Found volume group "xen-vol"
Resuming xen--vol-lvmtest--disk (254:1)
Creating volume group backup "/etc/lvm/backup/xen-vol" (seqno 9).
Logical volume lvmtest-disk successfully resized
But when i login to virtual machine it size not increase even i execute this command also

resize2fs /dev/xvda2

it also show me size has been increased
but when i check by df -h command

the size is old one.

acid_kewpie 04-16-2012 05:22 AM

You asked how to make an LV larger. You mentioned nothign at all about virtual machines. Is the LV larger or not?

anis123 04-16-2012 05:49 AM

Quote:

Originally Posted by acid_kewpie (Post 4653909)
You asked how to make an LV larger. You mentioned nothign at all about virtual machines. Is the LV larger or not?

Yes i want to increase the size of xen vitual machine disk .using lvm command .i use xen to create virtual machine .on debian squeeze

when i run lvextend -v -L +10G -n /dev/xen-vol/lvmtest-disk on host machine it show me the following message


Finding volume group xen-vol
Archiving volume group "xen-vol" metadata (seqno 8).
Extending logical volume lvmtest-disk to 50.02 GiB
Found volume group "xen-vol"
Found volume group "xen-vol"
Loading xen--vol-lvmtest--disk table (254:1)
Suspending xen--vol-lvmtest--disk (254:1) with device flush
Found volume group "xen-vol"
Resuming xen--vol-lvmtest--disk (254:1)
Creating volume group backup "/etc/lvm/backup/xen-vol" (seqno 9).
Logical volume lvmtest-disk successfully resized
when i log in to the virtual machine by following command
xm console lvmtest

and run the following command

resize2f /dev/svda2

it also show block size has increased

when i check by df -h command

it show me the old hard disk size means changes not reflected on it.

acid_kewpie 04-16-2012 05:59 AM

is the ***LV*** larger? Forget anything on it. One thing at a time.

anis123 04-16-2012 06:22 AM

i have volume group
 
Quote:

Originally Posted by acid_kewpie (Post 4653943)
is the ***LV*** larger? Forget anything on it. One thing at a time.

Don't understand

i just want to increse the size to virtual machine disk

acid_kewpie 04-16-2012 06:23 AM

you've shown us the lvdisplay, you've shown us a command's output. did the lv get larger or not?


All times are GMT -5. The time now is 04:11 AM.