I am using Ubuntu 16.04 as dual boot along with Windows 10 in DELL XPS 9650. There is a media partition which I am not able to utilize (/dev/nvme0n1p9).

Partition information: Gparted

I am trying to resize and merge with / (root partition) but seems like its locked. Can anyone please let me know what's the use of media and how can i move the space from media to / (root) partition.


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:

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."

  • I chose to move the swap partition instead of removing and recreating it. Should you want to do so, you may have to turn Swap Off. – user680858 Jun 25 '17 at 6:50
  • Thanks for your answer. is it possible to delete P10 (un-allocate) first then turn off swap and extended the root partition as suggested in askubuntu.com/questions/492054/how-to-extend-my-root-partition – data_nerd Jun 25 '17 at 7:20
  • You will have to mean sure Swap is Off for P10 before you can manipulate it. But do you mean to add both P9 and P10 to the root? Ubuntu can run without a swap partition as long as there is enough free RAM in your system (8GB+) and you don't run many applications. You can use top in a terminal to check that. However I would choose to have at least some swap space of 4-8GB. – user680858 Jun 25 '17 at 7:47
  • @Manish Everybody needs swap. You'll have to swapoff to move it, and swapon when it's moved. If you delete it, or delete it and recreate it, you'll also have to edit /etc/fstab or you may not be able to boot. – heynnema Jun 25 '17 at 14:01
  • First I did the swap off and added P9 and P10 to the root. After that i created the Swap partition. Everything is working fine, only issue ubuntu is taking much time to boot. – data_nerd Jun 26 '17 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.