Disk size of OVA file

Hello, we have deployed a new Graylog OVA instance. I expanded the virtual disk size to 400GB static before powering on the virtual machine. Upon powering it on, if i do a “df -kh” , the / root shows to be only 15G which is expected as per the documentation.
How do i make the / root extend or use all the 400GB i have allocated?

I have looked at http://docs.graylog.org/en/2.4/pages/configuration/graylog_ctl.html#extend-disk-space .
I m not adding a new disk such as /dev/sdb as mentioned in the above link. Mine is already existing /dev/sda

If i do a fdisk -l , below is the output

ubuntu@graylog:~$ sudo fdisk -l

Disk /dev/sda: 429.5 GB, 429496729600 bytes
255 heads, 63 sectors/track, 52216 cylinders, total 838860800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000efa42

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758    40957951    20228097    5  Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5          501760    40957951    20228096   8e  Linux LVM

Disk /dev/mapper/graylog--vg-root: 16.4 GB, 16416505856 bytes
255 heads, 63 sectors/track, 1995 cylinders, total 32063488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/graylog--vg-root doesn't contain a valid partition table

Disk /dev/mapper/graylog--vg-swap_1: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders, total 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/graylog--vg-swap_1 doesn't contain a valid partition table

Output of lsblk

I’m sorry dude but that kind of question is really, really outside the scope of these forums. This is Linux-101 material.

Basically you’ll need to learn about partitioning and about LVM: Linux Volume Manager. I can give you a short summary though:

  • Your VM already had one disk and you expanded that one disk to make it larger.
  • This means that the disk is larger than the system initially expected.
  • You can probably add a new partition using fdisk, for example sda6.
  • You can then make this new partition into a new LVM device /dev/sda6
  • You can add the new device to the existing volume group graylog--vg-root
  • You can then use lvresize and the relevant resize command for the file system type to resize /.

One important caveat: the Graylog OVA is not intended for production use. It is intended to just try out the product.

HI Tess, you are right this was out the scope, my bad. I have already tried doing whatever you suggested but it errors out when trying to create a new LVM device /dev/sda6 as shown below even though my “fdisk -l output shows /dev/sda to be 400GB” . The reason i asked this question was it is easy to add a new separate disk and move the graylog data to use that new larger disk (as explained in the documentation) but my question here was whether its possible to expand the existing graylog_root lvm to use any unallocated space on the disk. There is something specific with the way .ova image has its partition table created that causes this error…

EDIT :
Hang on, no… I’m wrong.

Originally your fdisk did show that the disk had grown… so it’s interesting that it would say there are no free sectors.

Basically doing the following -should- work:

sudo fdisk /dev/sda
n         # new
p         # primary

And so on… Fdisk already indicates that the drive is 430GB in size…

If the disk itself is already 430Gb and my interpretation of the fdisk is correct, the extended sda5 partition is also already something like 400Gb large, you probably need to vgextend the volume group occupying it (if it hasn’t occupied the full size already), then lvextend the root vg, then use the appropriate filesystem resize command to grow your filesystem (e.g. for ext4 you’d use resize2fs).

Looks like sda5 is still 40M sectors, which could correlate to the 20GB size we saw for /. Partitions don’t get auto-resized.

Guess then you can always delete sda5 and re-create it in the same session at the same starting block but occupying the whole disk, then pvextend the physical volume that lvm has on it, then lvextend and fs resize…

Oooff! Living on the edge! :smiley:

Of course OP could’ve also just added an /dev/sdb and added that to LVM :wink:

Well, as long as OP doesn’t try to run production on this jiggery OVA…

Hi [benvanstaveren] , Unfortuantely can’t delete /sda5 because it has the root LVM. As you know its a pain to extend root partitions. Even “vgextend” doesn’t see 400GB available.

I guess, I will just redeploy the OVA with the default options, attach a separate disk of 400GB (sdb ) instead of wasting time in expanding the existing sda disk.

We can close this thread. Thank you all for your inputs

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.