5

check using volume from list

openstack volume list

set status to available to a volume

openstack volume set --state available [volume id]

resize the volume

openstack volume set --size 40 [volume id]

check size and status again

Openstack volume show [volume id]

status become in-use, size become 40. It's attached to /dev/vda.

However, login into the vm, use df -h check, didn't find /dev/vda.

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  1.8G   19G   9% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G   17M  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           379M     0  379M   0% /run/user/1000

Why it doesn't change?

3 Answers 3

2

Openstack just increases the physical disk size. You will need to use the operating system utilities to increase the disk space allocated to / for example.

5

I had exactly same issue. Than i found the solution, here's mine :

After you finally resize the Volume from Ceph (Like the question above)

Login to your VM

## Grow part (i.e resize root partition)
sudo growpart /dev/vda 1

## Check if already extend
lsblk

## Resize ‘/’ file system to fill all space on the partition
sudo resize2fs /dev/vda1

## (option) If your filesystem is XFS, it can be grown while mounted using the xfs_growfs command:

sudo xfs_growfs /

## Verify
sudo df -H

I wrote about my prod case here.

2
  • Hi Nicolas - can you clarify how your answer builds on the others and is different from them? Thanks!
    – shearn89
    Dec 17, 2021 at 10:12
  • My answer is no different I'm just wrapping up everything from the first answer and another reference. Also, I didn't see any mention growpart command which is the key for this resize action. Dec 17, 2021 at 16:07
2

I had a similar issue, and it was not clear for me how to resize the partition if you use an openstack volume. This did it for me:

Start with unmounting sudo umount /dev/sdb

Then make the system aware of the new size:

sudo e2fsck -f /dev/sdb

After that you can resize the volume

sudo resize2fs /dev/sdb

Finally mount the volume and check if the new filesize is set

sudo mount /dev/sdb /mount_point
df -h
1
  • Note that you should first use cfdisk /dev/sdb and resize the partition before you can resize the filesystem using e2fsck -f /dev/sdb && resize2fs /dev/sdb Nov 15, 2021 at 0:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .