resize2fs reads the partition size from the kernel, similar to reading the size of any other file. fdisk tries to update the kernel when it writes the partition table, but it will fail if the disk is in use - e.g. if 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 :-).
I believe fdisk logs a prominent message about this, as screen-shotted in this (otherwise outdated) document.
The kernel reads the partition table during startup. So you can simply restart the computer. Then resize2fs will be able to see the extra partition space, and expand the filesystem to fit.
There is a less friendly but actually up-to-date document here, which includes a more risky alternative:
https://access.redhat.com/solutions/57542
How to use a new partition in RHEL6 without reboot?
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.