The root is locked because your Ubuntu is running from it.
/media/ is the mountpoint for automounting USB drives, a.o. Currently your P9 is also mounted there.
You must boot from the Ubuntu Live USB to be able to manipulate the root partition. Unfortunately the swap partition P10 is in between P8 and P9, so the required actions are a bit more than you might expect:
NB
The actions you are about to take can irreversibly corrupt your system.
Make sure you backup any files you don't want to lose !!
- As said, boot from Live USB, select the Try Ubuntu option.
- Start
gparted
- Select P9 and delete it. Execute (Green tick).
- Select P10, Resize/Move, select the slider in the middle and move it to the right. Execute. You should now have Unallocated space between P8 and P10.
- Select P8, Resize/Move, select the right arrow of the slider and move it to the right. The size indicator should grow. Execute. You should now have a larger root.
- Exit
gparted and reboot the system.
Addition as suggested by heynnema (also see comments):
"In terminal issue a sudo mkswap /dev/new_swap_partition_name_here, note the new UUID. Edit that UUID into /etc/fstab with gksudo gedit /etc/fstab and edit the line with "swap" in it. Replace the UUID that's there now. Save the file and quit gedit. Then type swapon -a. Then use free -h and swapon to confirm swap usage."