LinuxSay - A Discussion Forum for Linux Enthusiasts

How to resize the partition in ext4 filesystem


I want to extend my 6th partition. How can we get it done.

Parted command could not support ext4 filesystem to resize.

Is there any other way to increase or decrease my partition.

Please help me…

You need to boot from external device (USB, CDROM) and use application to resize - the idea is that the disk should not be used durring resize
You can use for example:

If you have setup LVM it would be a matter of 2 commands but in your case you need to perform external booting.


On which Linux distribution you want to resize the partition? I think its CentOS 7?

You are using the ext4 partition for increasing

# resize2fs /dev/sda6 NEWSIZE


I am using CentOS 6.6 Linux distribution


Hi if you want to resize the 6th partition by using parted utility you can resize it by using resize parted command, you can increase or decrease the partition size of a partition once look at below

1 Like


Parted command will support only ext2 filesystem. I am using ext4 filesystem


Hi you can try gparted instead of parted or you can use cfdisk to resize the partition

#cfdisk /dev/sda

after that delete the partition (6th) no need to worry about your data, it will remain there until using mkfs.ext4 (dont use mkfs.ext4)

Now recreate the same partition with the size you want. But here you must and should give the same sector as the original one otherwise you will loose the data.

Now run resize2fs to resize the filesystem

#resize2fs /dev/sda6


I have the free space in my system. But as you told i have run the command i am getting the error

Pls let us know what to do and how to solve this error


Dear Balaji

if you have free space fro ex: 2GB on /dev/sda6 then you can reduce it by using the resize2fs /dev/sda6 1G
But for extending please fallow the below steps

  • Unmount the partition /dev/sda6

#umount /dev/sda6

  • Now delete the 6th partition

#fdisk /dev/sda

print the partitions and note the starting sector of the /dev/sda6 partition §
delete the partition /dev/sda6 (d)
save and exit (wq)

  • Recreate the partition /dev/sda6 with more size and with the same sector (starting sector) of /dev/sd6

#fdisk /dev/sda

print the partitions §
create the partition (n)
select the partition type (l)
assign the number to partition (6)

Note: you have to mention only the sectors not M or G
now here you have to give the starting sector of old /dev/sda6
next you can give your won sector based on your size

save and quit (wq)

  • finally you have to resize the file system by using

#resize2fs /dev/sda6

and also once post the output of

#fdisk -l

1 Like


Thanks for your reply and support

You can resize partition if there is enough space after partition
otherwise you must backup next partition, decrease it, restore it
for LVM, you can add other partition or device