The computer has 2 systems installed: linux and windows and 1 ssd disk. At some point linux started to run out of memory. So I created free space by separating it from the main partition (where windows was installed, with Aomei Partition Assistant), hoping that I could attach it to the linux partition. And question: How to attach partition (1) to partition (2), (see screenshot)? Can you please tell me how! enter image description here
short answer: what you try to achieve is not easily doable without commercial tools. It demands a reshuffling of the partitions on disk.
long answer:
Solutions:
a) Since you already have 4 primary partitions, you cannot create a new partition to use the empty space. The maximum number of primary partitions for the legacy partition table you use is 4. You can only assign the space to any of the existing neighboring partitions, i.e. /dev/sda1 or /dev/sda2.
b) To be able to use the free space for linux, the two rescue partitions would have to be moved right to the end of the windows partition, then the extended partition would have to be expanded into the free sectors and then /dev/sda5 could be extended with the free space. I am not aware of any free tools which do that reliably. All this moving, shrinking and extending of partitions demands that the tool used knows the partition table and is able to read / write / modify all involved filesystems.
c) Save all your important work from the linux installation. Remove the extended partition. Move the two windows recovery partitions (/dev/sda2 and /dev/sda3) next to the windows partition and create a new extended partition with logical partitions for your linux installation.
d) Get rid of the Windows recovery partition /dev/sda2 and create a new, larger partition which contains also the freed space. Depending on where you need the space in Linux, you could mount /home (all your data) or / (all the operating system data) on that volume. As a downside, you will lose some windows recovery functionality.
Best regards, Marc