0

I installed Ubuntu 14.04 alongside windows 8 for the first time yesterday, and I thought I would give it 75GB of space from my C: however, I didn't know I had to use 50GB for the installation and 16GB of swap space.

How do I give Ubuntu more space form my D: when installed already?

I'm am very new to this, so please be very specific. Looking forward to your answers, thanks in advance

5
  • You DON'T have to use anything like that. Especially on Wubi, swap is pointless. 30GB is enough for the average user for root.
    – muru
    Aug 21, 2014 at 10:40
  • @muru wubi?! He can not be using wubi... Siem: gparted live dvd. and resize your partitions. " I didnt know I had to use 50GB for the instalation and 16GB of swamp space. ". Hmm you do not? 16Gb swap is overkill most times. And 50Gb? I can install and use Ubuntu on 15Gb total so I seriously doubt that claim ;-)
    – Rinzwind
    Aug 21, 2014 at 10:43
  • Ah, I forgot Wubi makes a fixed size disk and got confused. The point remains: Swap size more than RAM is only needed if you hibernate. 30GB is enough for root for the average user (which is why Wubi uses that much).
    – muru
    Aug 21, 2014 at 10:47
  • What has wubi to do with this?!
    – Alvar
    Aug 21, 2014 at 11:30
  • everydaylinuxuser.com/2014/05/… I used that giude, it says 50GB for instalation and double your RAM for swap space
    – Siem
    Aug 21, 2014 at 16:57

1 Answer 1

0

Having a dedicated Swap partition is good but 16 GB of space just for swap is a serious waste of space since most modern systems come with 4 GB of memory so for day to day use, you're very very unlikely to run out of memory.

As Rinzwind mentioned, you don't need more than even 15-20 GB of Ubuntu partition to use it on daily basis. So as you've asked to get more space for currently installed Ubuntu while keeping the swapping intact. Here's what I'd suggest you to do.

What we're gonna do is merge that swap partition back into your Ubuntu partition using following steps.

Firstly, get rid of your Swap partition, follow this link for the same.

Second, merge that unallocated space left out by deleted Swap partition back into Ubuntu partition by resizing it, follow this article.

Now comes the part where we create swap memory without having a dedicated partition.

Open terminal using Ctrl + Alt + T.

Run following command to create swap file by running following command.

sudo dd if=/dev/zero of=/swapfile bs=1M count=512

Notice the value of count, which denotes the size of your file in MB that you want to use as Swap memory, replace that with appropriate value as per your system memory. You can refer to Ubuntu Official Docs to know how much swap memory is recommended. 2 GB (2048 MB) of swap memory is enough for a machine with 4 GB of RAM.

The parameter of suggests location and name of swap file, here we create it in / (which is root) and name it as swapfile. I suggest you to leave it as it is.

This command will take a few seconds to complete, depending on how much size you set.

Now, format the newly created file as swap memory using following command.

sudo mkswap /swapfile

Once done, you need to tell Ubuntu to mount this file as Swap memory on startup, to do that, run following command.

sudo gedit /etc/fstab

This will open fstab (File System Table) file in text editor. Add following line at the end of the file. DO NOT CHANGE ANYTHING ELSE IN THIS FILE

/swapfile none swap sw 0 0

Now save the file and close the editor.

Now just restart Ubuntu, and you'll see the Swap memory available in System Monitor.

I understand this is overwhelming for first time user like you but it is worth trying to gain additional storage, so feel free to drop in comments if you're stuck anywhere. :)

5
  • The first guide you suggested didn't work for me, I installed the Ubuntu on a USB, why do I need a CD then?
    – Siem
    Aug 22, 2014 at 9:43
  • @Siem: Yes you don't need a CD! that's understood, first guide involves removing swap partition, and that cannot be done while running Ubuntu since it is actively using the partition, you need to boot Ubuntu from LiveUSB or DVD and then use Gparted from there to perform any operations on partition.
    – Kushal
    Aug 22, 2014 at 10:05
  • But I dont have Gparted...
    – Siem
    Sep 3, 2014 at 16:01
  • @Siem: Gparted is available by default in Live session once you have booted from Live USB or DVD. Just search for "Gparted" in Unity Dash.
    – Kushal
    Sep 4, 2014 at 5:56
  • That is what I was trying to say, I don't have a Live USB or something, I searched for GParted and nothing came up
    – Siem
    Sep 6, 2014 at 17:27

Not the answer you're looking for? Browse other questions tagged .