- I used
fdisk /dev/vdbto extend its only partition /dev/vdb1 to full capacity of 2TB from previous 1TB... See How to Resize a Partition using fdisk - Red Hat Customer Portal. - And then I did [
resize2fs /dev/vdb1]...
We can see this did not change the size of your filesystem. Here is why:
resize2fs reads the size of the partition from the kernel, similar to reading the size of any other file. fdisk tries to update the kernel after it has written the partition table. However this will fail if the disk is in use, e.g. you have mounted one of its partitions.
This is why resize2fs showed the "nothing to do" message. It did not see the extra partition space.
The kernel reads the partition table during startup. So you can simply restart the computer. Then you can run resize2fs, it will see the extra partition space, and expand the filesystem to fit.
I believe fdisk logs a prominent messagewarning when this happens, as screen-shotted in this (otherwise outdated) document.
There is a less friendly but actually up-to-date document, on the Red Hat Customer Portal:
How to use a new partition in RHEL6 without reboot?
From
partprobewas commonly used in RHEL 5 to inform the OS of partition table changes on the disk. In RHEL 6, it will only trigger the OS to update the partitions on a disk that none of its partitions are in use (e.g. mounted). If any partition on a disk is in use, partprobe will not trigger the OS to update partitions in the system because it is considered unsafe in some situations.So in general we would suggest:
- Unmount all the partitions of the disk before modifying the partition table on the disk, and then run
partprobeto update the partitions in system.- If this is not possible (e.g. the mounted partition is a system partition), reboot the system after modifying the partition table. The partitions information will be re-read after reboot. If a new partition was added and none of the existing partitions were modified, consider using the partx command to update the system partition table. Do note that the partx command does not do much checking between the new and the existing partition table in the system and assumes the user knows what they are are doing. So it can corrupt the data on disk if the existing partitions are modified or the partition table is not set correctly. So use at one's own risk.