No announcement yet.

Is it possible to resize standard partition in CentOS6?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to resize standard partition in CentOS6?

    I am facing a problem with expanding partition size in linux. I tied to do it with Gparted but i can't resize because un-allocated space doesn't appear.

  • #2
    I am not completely sure about the partition, but as per my knowledge you can only extend the partitions which are very close to the unallocated space. In your case, try using the Extended one.


    • #3
      In order to grow the partition, there needs to be adjacent space that isn't allocated to anyone, immediately after the partition.

      You need to disable swap, delete the swap partition, then grow the extended partition, next the SDA3 partition and file system and then re-create swap.


      • #4
        It's simple:
        • Right-click on the swap partition (/dev/sda6), do "swap off" that enables the resize/move for the swap partition.
        • Use the resize/move to shift the swap partition up (to the end of the unallocated section)
        • Use the edit-menu to complete that pending action.
        • Right-click on swap partition, do "swap on"
        • Resize /dev/sda5 by selecting it, using the resize/move dialog
        • Finally, use resize 2fs /dev/sda5 to extend the filesystem...
        • If you want to increase space in one of the other ext4 partitions (sda2 or sda3), you would have to first shrink the extended partition, moving that to provide unallocated space next to them.


        • #5
          /dev/sda4 is an extended partition with a dual partition in it. You need to first delete BOTH of these partitions. Deleting the linux-swap partition is not so hard and can be done by simply turning off swap and deleting it (swapoff -a) - however, /dev/sda5 may provide a bigger challenge.

          Without knowing more about your setup, it's not possible to advise exactly, however if it is mounted is a part of your tree, copy the data from it into a temporary directory, then umount it and move the data from the temporary space to where it belongs (Luckily there is not much data there).

          You need to do a similar thing to move the contents of /dev/sda3 into /dev/sda2.

          Once you have removed the contents of /dev/sda3 and sda5, and removed swap, you can delete these partitions, and recreate a larger partition for /dev/sda3. You might also want to create a swap file or a swap partition. Once you have created the swap area, format it with mkswap /dev/sdX or mkswap /path/to/file. You also need to go to /etc/fstab and remove / update the mounts as appropriate.


          • #6
            There is a need for unallocated space after or before a partition to extend into.

            Therefore, you can simply move sda4, then sda3 further down the drive. This will create unallocated space after sda2. Then, you can extend sda2's partition into the newly "unallocated" space.