TransWikia.com

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
here

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!

Ask a Question

Get help from others!

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