-1

If you see these are my two partitions 1 and 2

enter image description here

Now if we look at the partition level

enter image description here

sda2 is total of 149.5G ie root, swap, home of 50, 3.8, 25.7G each but that still not adds upto total size of the partition. So my question is where is that 149.5 - (50 + 3.8 + 25.7) i.e the 70G how can I retrieve this space and use it?

EDIT 1 : vgs enter image description here

EDIT 2 : pvs

enter image description here

EDIT 3 : Ran pvresize /dev/sda2 which gave pvs and vgs as

enter image description here

EDIT 4 : Ran lvresize -l +100%FREE /dev/vg_relcertlin2/lv_root but df -hT and lsblk are showing different output enter image description here

  • Add the output of vgs to your question. Copy and paste it instead of linking an image. – Nasir Riley May 7 at 19:44
  • Please check the updated question, I am sorry I could not copy paste cuz I am connecting to the machine using hyper V and it does not allow to copy paste – Pulkit Bhatnagar May 7 at 19:48
  • Did you grow the partition and forgot pvresize /dev/sda2? – frostschutz May 7 at 19:49
  • 1
    Add the output of pvs as well. If you ssh into the machine, then you can copy and paste the output. – Nasir Riley May 7 at 19:51
  • 1
    Then set up ssh on it and use that to connect. – Nasir Riley May 7 at 19:53
0

Your physical volume isn't using all of the space in /dev/sda2 and as a result, neither is your volume group.

To get the space:

pvresize /dev/sda2

That will extend the physical volume and volume group to use all of the space. Verify with:

pvs

vgs
| improve this answer | |
  • I did that, after that how can I use the space because its still not showing on lsblk – Pulkit Bhatnagar May 7 at 20:03
  • please help me out with this, its very important – Pulkit Bhatnagar May 7 at 20:03
  • @PulkitBhatnagar It's not going to show in lsblk because you haven't added the space to any of your logical volumes. Look at pvs and vgs again to see the difference. – Nasir Riley May 7 at 20:05
  • 1
    But how do I add this to my sda 2 partition? – Pulkit Bhatnagar May 7 at 20:06
  • 1
    @PulkitBhatnagar Read the man page. The physical volume is already extended so there's no reason to do anything else to it and you have what you want. If you want to extend the logical volumes, then you need to run lvextend against the logical volumes with the amount of extra space that's needed, not the physical volume. If you really need help, have someone where you work walk you through it. – Nasir Riley May 7 at 20:17
0

To get the space, this resizes the amount of space that a LVM volume group can use on a partition and needs to be run if you resize its partition.:

pvresize /dev/sda2

we need to resize the logical volume

lvresize -l +100%FREE /dev/vg_relcertlin2/lv_root

Finally we want to resize the actual underlying file system

resize2fs /dev/vg_relcertlin2/lv_root
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.