How can expand ext4 while it is inside an extended partition

Super User Asked by Antsamotady on October 7, 2020

I have my hard-drive divided as shown on the screenshot

I’d like to expand sda8 by taking some space from sda6.
With GParted I was already able to shrink sda6 before expecting to merge it with sd8 but it was not possible.
Also, should I do it while the system is running or have I to boot externally from USB or live CD?

I just want more space on this sda8 where my system is,
can someone show me the steps please?

One Answer

You don't have any space for expansion, extended partition or not. GParted would be able to resize a logical partition just fine1, but it cannot merge the contents of two filesystems into one.

If you want to merge both partitions into one, you will need to:

  1. Back up everything from /home to another disk (either as files, or as a whole partition image);
  2. Remove /home from the /etc/fstab file;
  3. Boot into a LiveCD (preferably one which has GParted on it);
  4. Delete the sda6 (home) partition;
  5. Grow the sda8 (OS) partition to the empty space on the right;
  6. Restore all your files from backup.

If you want to adjust the sizes, but keep the partitions separate, you will need to:

  1. Back up everything from /home to another disk (either as files, or as a whole partition image);
  2. Boot into a LiveCD which has GParted;
  3. Shrink the sda6 partition from the start (this will be a slow process as it needs to shift all data);
  4. Grow the sda8 partition to fill the new empty space.

Although these tasks could sort-of be done from a running system (ext4 can be grown while mounted), it would still involve closing all your programs, probably even stopping the GUI and carefully typing numbers into fdisk in console mode. Doing the resize from a LiveCD will be quite a bit easier.

1 But if your firmware allows, you really should consider switching to UEFI boot mode and GPT disk partitioning which does not need "extended" or "logical" partitions at all.

Answered by user1686 on October 7, 2020

Add your own answers!

Related Questions

(SSL)How to convert .der file to .cer file?

1  Asked on September 16, 2020 by a-dziedziczak


Access local machines from Virtualbox VM on VPN

1  Asked on September 13, 2020 by matthieu-v


Remove one of multiple Operating System

2  Asked on September 12, 2020 by lapin


Jenkins job creating build files owned by root

0  Asked on September 11, 2020 by mython-paster


I need to view my windows credentials password

2  Asked on September 9, 2020 by caleb-mglaughlin


VNC Viewer for Windows with NATIVE SSH tunneling support?

1  Asked on September 8, 2020 by a-neumann


dropbear dbclient + scp, equivalent to openssh “-oStrictHostKeyChecking”

1  Asked on September 8, 2020 by brian-mcfarland


tar: Exiting with failure status due to previous errors

9  Asked on September 6, 2020 by morpheous


Alternative ways to enter English letters in Ubuntu

1  Asked on September 5, 2020 by pavel-varenik


How to remove supervisor BIOS password from Toshiba laptop

2  Asked on September 2, 2020 by user2816759


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP