i modified this PC to dual boot windows and Ubuntu but windows didn't boot anymore. so how can i merge the free space 776GB to the file system Partition 6 181 gb ext 4 where the Ubuntu OS is, without losing any data on the Ubuntu OS. i did format the windows os 776gb partition. but i stuck here.
-
1Does this answer your question? How to resize partitions? – guiverc Dec 08 '23 at 00:18
-
1You're best using live media so partitions are not being used for resizing, but you've got space outside of an extended partition that it appears you want to use inside the extended partition (which isn't possible by design) which complicates matters, thus https://askubuntu.com/questions/591213/how-to-expand-resize-extended-partition may also be useful – guiverc Dec 08 '23 at 00:21
-
@guiverc This is a complicated case, and the question you linked really does not answer it – Archisman Panigrahi Dec 08 '23 at 01:01
-
Now might be a good time to convert to gpt and totally reinstall so you have more standard UEFI/gpt configuration. But change from very old MBR to gpt will erase drive, so backup essential. You cannot image backup from MBR to gpt but only need /home, maybe /etc, other data partitions and an export of installed apps to make it easy to reinstall all of them. The only time to use MBR partitioning is for BIOS install of Windows. And BIOS installs only required for systems before 2012. – oldfred Dec 08 '23 at 14:53
2 Answers
Backup anything of value on your system, things can go badly wrong when changing partitions.
You are allowed four primary partition with MSDOS partitioning, and presently you have three (the extended counts as a primary). Simply make a new root in the unallocated space, put your ext4 filesystem on it, mount it, and simply copy your present root to the new one.
Run sudo update grub, and the new root should be picked up. Use blkid to get the UUID of the new root, and edit in the new UUID in the EFI/ubuntu/grub.cfg file. Probably change any direct disk partition numbers too. Boot it, and run update-grub again. Now the new root should be the default. Check that is boots. Then you may delete the old root, and shrink the extended partition on the left back to the EFI partition. Extend the new root in the newly unallocated space that the extended partition took (extending on the right may be done on a running system, but check that the filesystem is also increased in size). Some partitioning tools will run resize2fs for you, if not, you can run it yourself.

- 17,838
-
I will first try the live usb method. If that doesn't work I will try this. Thanks – andrew hofer Dec 08 '23 at 03:53
From the image it appears that the root file system is installed in logical partition sda6. All of the logical partitions exist within the extended partition sda4. The image also shows a lock icon by these partitions indicating that these are active.
In order to resize or move partitions these should not be active or mounted which can be accomplished by booting from media containing a live GNU/Linux image with GParted. The sda4 extended partition will need to have it's left boundary moved further left before the sda6 logical partition can be grown larger to the left.
For an example of working with logical and extended partitions see Moving Space Between Partitions.
As mentioned in another answer, it is prudent to back up important data before editing partitions in case something goes wrong such as a software bug, power outage, or hardware failure.

- 1,109