Add disk space to lvgroup
Add disk space to lvgroup
Hi all,
I'm probably missing something silly here but I'm stuck. I've got a linux CentOs 6.10 box (yes I know, I don't own it, I'm helping out a customer, I have told them to upgrade) that is in VMware. I've grown the disk form 35GB to 43GB and now need to add that disk space.
Normally I'd create a partition and use pvcreate to kick off the process of growing the LVM but the partition is only giving me 1MB of space:
[root@serverone ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 43G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 34.5G 0 part
│ ├─VolGroup-lv_swap (dm-0) 253:0 0 7.8G 0 lvm [SWAP]
│ └─VolGroup-lv_root (dm-1) 253:1 0 26.7G 0 lvm /
└─sda3 8:3 0 1008K 0 part
[root@serverone ~]#
I can see the disk space as part of sda2? I haven't grown it so I'm confused as to why sda2 is 34.5G?
df -h shows:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
27G 4.2G 21G 17% /
Clearly I've missed something somewhere!
help!
Thanks.
I'm probably missing something silly here but I'm stuck. I've got a linux CentOs 6.10 box (yes I know, I don't own it, I'm helping out a customer, I have told them to upgrade) that is in VMware. I've grown the disk form 35GB to 43GB and now need to add that disk space.
Normally I'd create a partition and use pvcreate to kick off the process of growing the LVM but the partition is only giving me 1MB of space:
[root@serverone ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 43G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 34.5G 0 part
│ ├─VolGroup-lv_swap (dm-0) 253:0 0 7.8G 0 lvm [SWAP]
│ └─VolGroup-lv_root (dm-1) 253:1 0 26.7G 0 lvm /
└─sda3 8:3 0 1008K 0 part
[root@serverone ~]#
I can see the disk space as part of sda2? I haven't grown it so I'm confused as to why sda2 is 34.5G?
df -h shows:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
27G 4.2G 21G 17% /
Clearly I've missed something somewhere!
help!
Thanks.
Re: Add disk space to lvgroup
If you didn't reboot after expanding the "disk" then you need to or it will only show you the space that was there before. On KVM (vs vmware) you can do a virsh blockresize to tell the guest that the disk has changed size but I don't think a vmware equivalent to that exists. I suspect you just happened to have 1MB left on the existing disk size which is why it will only make the new partition that size. So, reboot to get the disk recognised at its new size, then use fdisk or whatever to add a new partition then reboot again since the partition table will be in use and the change won't be seen, then you can pvcreate the new partition and add it to the VG...
Because that's how big it was before. 34.5GB + the 0.5GB given to /boot = 35GB, the original disk size.I'm confused as to why sda2 is 34.5G?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Add disk space to lvgroup
I have rebooted and I still get the same issue.
Re: Add disk space to lvgroup
I've deleted the partition and rebooted again but I'm still not able to add the disk space to the new parition:
Disk /dev/sda: 46.2 GB, 46170898432 bytes
64 heads, 32 sectors/track, 44032 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007b94a
Device Boot Start End Blocks Id System
/dev/sda1 * 2 501 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 502 35840 36187136 8e Linux LVM
Partition 2 does not end on cylinder boundary.
/dev/sda3 1 1 1008 83 Linux
Partition table entries are not in disk order
/dev/sda is 46.2 GB but /dev/sda3 still goes to 1Mbit.
lsblk gives me this:
AME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 43G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 34.5G 0 part
│ ├─VolGroup-lv_swap (dm-0) 253:0 0 7.8G 0 lvm [SWAP]
│ └─VolGroup-lv_root (dm-1) 253:1 0 26.7G 0 lvm /
└─sda3 8:3 0 1008K 0 part
Disk /dev/sda: 46.2 GB, 46170898432 bytes
64 heads, 32 sectors/track, 44032 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007b94a
Device Boot Start End Blocks Id System
/dev/sda1 * 2 501 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 502 35840 36187136 8e Linux LVM
Partition 2 does not end on cylinder boundary.
/dev/sda3 1 1 1008 83 Linux
Partition table entries are not in disk order
/dev/sda is 46.2 GB but /dev/sda3 still goes to 1Mbit.
lsblk gives me this:
AME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 43G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 34.5G 0 part
│ ├─VolGroup-lv_swap (dm-0) 253:0 0 7.8G 0 lvm [SWAP]
│ └─VolGroup-lv_root (dm-1) 253:1 0 26.7G 0 lvm /
└─sda3 8:3 0 1008K 0 part
Re: Add disk space to lvgroup
Weird. This process worked like a charm on another server. It just appears that one of the machines is not happy.
I'm going to break out a partition editor to see if I can see what's going on.
I'm going to break out a partition editor to see if I can see what's going on.
Re: Add disk space to lvgroup
This partition is being allocated in freespace right at the start of your disk not in the new gigabytes of it that you just added./dev/sda3 1 1 1008 83 Linux
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Add disk space to lvgroup
So it is! That answers that, thank you. That was driving me mad.
Is there a way to tell fdisk to use the freespace that is at the end of the disk?
Is there a way to tell fdisk to use the freespace that is at the end of the disk?
Re: Add disk space to lvgroup
Yes, it should ask you when you tell it to create a new partition. It should ask for a starting sector number and it defaults to the first bit of freespace it can find. Even if it's minute. Print out the existing partition table entries, make a note of the ending sector of the last partition and add at least 1 to it (making sure that it's aligned to a 1MB boundary on the disk to avoid problems with 4KB sectors). It should then pick the end address of the freespace starting there as the default ending sector when it asks about that too.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Add disk space to lvgroup
Thanks for the help TrevorH - Much appreciated.
I've a few more servers to add space to so I'll try it again
I've a few more servers to add space to so I'll try it again