0

As part of add additional partition – sda3 we extend the OS disk from 50g to 120g from the vsphere client ( VM Linux server )

And we perform rescan , instead of reboot

lsblk
NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                8:0    0  120G  0 disk
├─sda1             8:1    0    1G  0 part /boot
└─sda2             8:2    0  119G  0 part
  ├─Vlpr-lvm_root 253:0    0   10G  0 lvm  /
  ├─Vlpr-lvm_swap 253:1    0  3.9G  0 lvm  [SWAP]
  └─Vlpr-lvm_var  253:2    0  10G  0 lvm  /var


fdisk /dev/sda

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p0
Partition number (3,4, default 3): 3
No free sectors available

Command (m for help):

As we can see above we have the partitions – sda1 sda2 , but when we select the partition number – 3 from fdisk then its complain about - No free sectors available In spite we are not use sda3

Any suggestions why fdisk give the error - No free sectors available

I just to mention that we prefer to not do a reboot if this is the solution ?

sheffadmin
  • 49
  • 1
  • 7

1 Answers1

0

You don't need to create a third partition because you have already resized the second partition to use the newly allocated space. Now you need to go on to the next steps, resizing the PV, resizing the LV, and finally resizing the filesystem.

Resize the PV:

pvresize /dev/sda2

Resize the LV:

lvextend -l +100%FREE /dev/mapper/Vlpr-lvm_root

Finally resize the filesystem. (You did not give the filesystem type but you can easily look up this command.)

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • about - resizing the PV, resizing the LV, and finally resizing the filesystem , can you please add the instructions about how to do it? in your post – sheffadmin Nov 15 '20 at 11:38
  • maybe I am not explain my self , we need to add additional partition , and create on this partition new file system – sheffadmin Nov 15 '20 at 13:38
  • @sheffadmin You DO NOT need a new partition. I added the commands you need to the answer. I did not include them originally because I thought you already had them in the tutorial you were following. – Michael Hampton Nov 15 '20 at 22:48
  • about the resize the FS I get --> resize2fs /dev/sda2 resize2fs 1.42.9 (28-Dec-2013) resize2fs: Device or resource busy while trying to open /dev/sda2 Couldn't find valid filesystem superblock. – sheffadmin Nov 15 '20 at 23:23
  • @sheffadmin Your filesystem isn't on `/dev/sda2`! Use the correct device `/dev/mapper/Vlpr-lvm_root` – Michael Hampton Nov 15 '20 at 23:25
  • but anyway this is the solution that I searched - https://serverfault.com/questions/1042636/how-to-increase-the-free-space-in-a-volume-group-in-lvm-after-expend-vm-disk-siz – sheffadmin Nov 15 '20 at 23:25