enter image description here

That's the condition of my disks seen from live ubuntu cd.

On /dev/sd8 my ubuntu os is Installed

On /dev/sd1 windows 7 is Installed.

And i want to merge the unallocated space on top of /dev/sd7 to my ubuntu partition because I'm running out of space.

I tried solutions mentioned in internet but i couldn't figure out how to do it.

  • 1
    Then all my installed programs will be removed! – Palash Bauri Mar 15 '18 at 8:56
  • I would suggest booting a live (Ubuntu install media) deleting sda7 or your swap partition, then add space wanted to sda8 (resize), then re-create a swap partition (and fix any issues such as move causing MBR to point to wrong location and grub issues [if this occurs], a change in UUID for swap in /etc/fstab etc.) – – guiverc Mar 15 '18 at 9:05
  • Sorry - I deleted my comment which listed the wrong sda number; my text was correct (ie. delete the later recreate swap partition to allow the partition to expand) You could move swap too, but it may still mean fixing grub due to partition expansion (if /boot is moved on disk)..) – guiverc Mar 15 '18 at 9:06

This should strait forward: Delete the swap partition on /dev/sda7 and then resize the ext4 on /dev/sda8.

There is one important step before that: The live CD auto mounts the swap space, so you need to disable swap before you can remove the partition:

$ sudo swapoff

An then you can remove the swap space. If you have enough memory, you don't need it anyway. With only 2GB you will need a swap partition. So after deleting the swap partition and resizing/moving /dev/sda8, boot Windows and shrink /dev/sda5. Than you can create a new swap partition. Ubuntu doesn't care were it is.

Also shrinking the /dev/sda5 partition might be a good idear anyway, since it would solve all your problems.

  • If i delete swap partition, what problems it will cause? – Palash Bauri Mar 15 '18 at 10:00
  • My computer is 32bit with 2GB ram – Palash Bauri Mar 15 '18 at 10:00
  • None as long as you don't start Firefox or LibreOffice. – Barafu Albino Mar 15 '18 at 11:28
  • 2GB is not much... so you might need a swap partition. You have a nother partition on /dev/sda9. If that wone is free, you can use it as swap. – Simon Sudler Mar 15 '18 at 11:43
  • 1
    Thank You Guys, it worked. I deleted the swap and merged the unallocated space to my linux partition and created another linux swap. But after reboot as usual i got a grub rescue prompt but this article helped me to fix that problem medium.com/@froositadwi/… – Palash Bauri Mar 15 '18 at 13:51

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.