Can I expand the ext4 partition? Which program / method is better? enter image description here

  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

3 answers 3

resize2fs is a program for changing the space occupied by the ext2 / ext3 / ext4 file system on a partition (the partition of the block device, in general, is “all the same”, what kind of file system is created inside it, and whether it was created at all).

usage is described in detail in man resize2fs .

general information: to reduce the size of the file system must be unmounted. it is not necessary to unmount to increase, but there should be free space at the end of the partition . that is, you first need to increase the size of the partition (add free space at its end), and then call resize2fs to increase the size of the file system .


which way is better?

whoever asks a similar question is probably better to use the “gui-wrapper” around parted under the name gparted (the window of this “wrapper” is shown in your picture).

  • From experience I can also add that it is better to load from a separate livecd with gparted. For example gparted.org/livecd.php . Swap is better to kill and recreate (do not forget to fix the fstab later). And the order will be something like this: we boot from livecd, kill the swap, reduce sda3, expand ext4, create a new swap and move sda6 to the remaining space. PS very old versions of gparted ntfs partition was sometimes killed. The bug is very rare and went a long time ago, but it’s best to make a backup anyway if possible. - don Rumata

The most important thing in this case is to understand that the partition is a partition, and the file system is something placed in this partition, not necessarily in terms of its size.

Analogy: a field divided by a border. In each section, some part of the section may be sown with grain, which is not necessarily equal to this section.

So: when reducing the size of the partition, you must first reduce the size of the file system, then reduce the size of the partition.

When you increase - on the contrary, first we increase the partition, then - the size of the FS.

The size of the file system is changed by resize2fs in case it is ext2 / 3/4 FS, in other cases there are other utilities, for xfs - xfs_growfs, etc.

In your case, I honestly do not see where you can get a place for expansion - the unfortunate gig in the swap does not really help. As an option - to cut NTFS.

Here is a step-by-step guide on how to do this from Venda: http://www.bleepingcomputer.com/tutorials/shrink-and-extend-ntfs-volumes-in-windows/#shrink

As a result, a "raw" (RAW) place will appear, which you use with the help of your gparted :)

    I have centos7, but not the point - from the console (CLI) I made a reduction of one partition and an increase in another:

     // уменьшение любого раздела lvreduce -r -L -50G /dev/mapper/vg_dev-portal-lv_home // просмотр свободно (неразмеченного) места :) vgs // увеличение любого раздела lvextend -r -L +50G /dev/mapper/vg_dev-portal-lv_root 

    PS: all sections e ext4 me, but I think even if they were different - everything went well)