installed Ubuntu 21.04 but then it got broke and i installed Ubuntu 20.04 alongside 21.04 ant then moved all my data from 21.04 to 20.04 ant then removed 21.04 by Gparted. now i just want to expand my 20.04 main partition by unallocated space which used to be 21.04 place. the problem is that i cant do it because i have to unmount the partition from a live disk. when i open Gparted to resize the partition, i cant unmount it because it seems it already happend and so i cant expand my partition? please help me.
You can't expand sda5, not because of its mounting status, but because there is a tiny sda4 fat32 partition in front of it. You must do something with that sda4 partition in order to expand sda5. Delete it or move it.
I suggest making sure you have solid backups before performing any partition operations.