0

I am trying to extend my Ubuntu storage. I am on a dual boot and have done all the steps except the one where we need to merge the partitions.

The reason I am not able to do that is the swap partition is in between the Ubuntu and the Unallocated partition. (Didn't probably realise when creating the dual boot partition)

Can anyone help me out?

Cheers!

My partitions screenshot

Serg
  • 824
  • 7
  • 14
  • Unallocated space isn't a partition, it's just space not partitioned. And there's no such thing as "merge partitions" (unlike what some commercial software may pretend there is). You'll have to swapoff, delete swap, move the partition to be resized all the way to the left, resize it, then create a new swap partition and edit the fstab accordingly. This has a very high potential of data loss. Hope you have backups. – ChanganAuto May 13 '21 at 20:39
  • First back up your files. Second boot from the Ubuntu installation USB in the Try Ubuntu mode. Third, disable swap by right clicking on the swap partition in the bottom part of the Gparted window and clicking on Swapoff. Fourth you move the home partition to the right. Fifth, you move the swap partition to the right. Sixth, you expand the root partition. – user68186 May 13 '21 at 20:42
  • Please add the output of parted -l to your question, formatted as code, i.e. with a line consisting of 3 backticks ``` before and after. – HuHa May 13 '21 at 20:43
  • 1
    An alternative is to just format as ext4, give yourself ownership & permissions & permanently mount using fstab. You can move all or some of your data folders from /home. sudo du -hc --max-depth=1 to see sizes. https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting & https://askubuntu.com/questions/1058756/installing-all-applications-on-a-ssd-disk-and-putting-all-files-on-hdd-dis – oldfred May 13 '21 at 21:25
  • Thanks, everyone for the help. I will back up data and go with the method mentioned by @ChanganAuto. – Munakala Lohith May 19 '21 at 21:45

1 Answers1

0

Including the unallocated space to the Ubuntu root partition would require 1) removing the swap partition, 2) moving the Ubuntu root partition to the front, then 3) expanding the Ubuntu root partition, optionally leaving some space to 4) create a new swap partition.

The problem here is 2). Moving a partition can be a lengthy process, and it may fail. The other operations are a matter of minutes.

Alternatively, you limit yourself to creating a data partition with a linux file system (most commonly ext4) in the allocated space, and use that partition as extra data storage. In Linux, any storage on different partitions can easily be made available from within the home directory of the user using symbolic links. Symbolic links for daily usage act and feel as regular folders. The user is not aware that, moving into these links, he/she may be redirected to a totally different place in the file system, even on different partition that can be on a different drive.

vanadium
  • 88,010
  • Any headstart on how I could do the second method you have mentioned? It would be of great help. Thanks! – Munakala Lohith May 19 '21 at 21:48
  • Start by creating an ext4 partition, then 2) continue including this partition in /etc/fstab so it is mounted automatically, then 3) create a folder for the user (as root), and change the permissions of that folder so the user has write access then 4) as normal user, move the data there and create either a link to that folder, or several links to subfolders as you see fit and convenient.
  • – vanadium May 20 '21 at 07:51