How to Resize a Partition using fdisk or parted
Updated -
Refer to the following sections of our Red Hat Enterprise Linux (RHEL) documentation on how to resize a partition.
18 Comments
link - Step 9 How to Grow an ext2/3/4 File System with resize2fs displays Page "Access Denied"
Thanks for bringing that to my attention! This should be fixed now :)
The RHEL 7 Storage Admin Guide's section 12.4 Resizing a Partition redirects to here. However, when you run fdisk on a disk with a GPT, the following message is displayed
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
It seems that parted is better supported in this case than fdisk.
Between step 3 and 6 disk layout changed: /dev/vda1 2048 3048 500+ 83 Linux to /dev/vda1 2048 1026047 512000 83 Linux but you are working on vda2. It can be confusing as I send this article to my colleagues and I have got a lot of unnecessary question.
Can you please fix this?
Need to add in Prerequisites:- The partition should be the last partition on that particular disk.
This procedure DOES NOT WORK AT ALL. PERIOD.
The exemples used in this article are confusing. On time is used vda disk and another time is used vdb. I think that author should use the same disk in this article.
Thank you for pointing this out. I'm with the documentation team and I'll work with a subject matter expert on rewriting the procedure both in this Red Hat Knowledgebase article and in the Red Hat Enterprise Linux 7 Storage Administration guide.
Hello everybody,
Thank you very much for commenting and and leaving suggestions for improvement. The author of this article is no longer with Red Hat. I'm sorry that nobody responded earlier.
I'm with the Red Hat documentation team, and I'll work with a subject matter expert on improving this Red Hat Knowledgebase article as well as the procedure in the Red Hat Enterprise Linux 7 Storage Administration Guide.
Article lacks consistency, probably does more harm than good if not updated. Especially on a topic so sensitive to data loss.
once I have a disk with 900GB, then extended to 8TB, filesystem is ext3. How to Resize a Partition using parted? plz help.
nice article
This article is confusing, in step 1 & 2 the device "vdb" is being used, in step 3 "vda" is used. Further down, it is shown as modifying partition table for device "vda" and later e2fsck is run on "vdb1". ....... confusing..... :(
Agree with Red Hat saying that is not in scope, however, please try to correct these simple mistakes which makes document much sensible.
Also, I came across this guide where similar mistakes are there: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/s2-disk-storage-parted-resize-part
Please correct these errors. Also, it is shown that "e2fsck" command being run a whole device "/dev/vda" instead of partitions.
I find this document because I encounter issue when trying to resize centos6+ext4 virtual machine. I found my issue due to the fdisk use unknown unit to create partitions, but print with difference units. I must input "u" key to change to "sector" units when creating partition, and then input the start sector same as old partition.
as artical we need to delete partition first but if we dont want to delete the partition as it contain data , is there any way to increase the size such as in window we can extend the space?
After resizing the partition with fdisk, partprobe must be run.
When the partition table of a disk is changed, the changes aren't noticed by the kernel (on memory) partition table. Running partprobe updates the kernel's table. If partprobe is not available a reboot is needed.
Thx
fdisk is not good with large disk resize, there is parted utility that is more efficient and can resize without restarting a system.