Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just formatted my laptop with Windows 7 and Ubuntu. I've a 250gb drive and I've split it in 3 partitions:One for Windows 7, one for Ubuntu and a shared partition for both windows and Ubuntu. I've format the drive correctly and I've installed the 2 operating systems. Using gParted there are 4 partitions 3 NTFS (Windows 7, a small partition for Windows and the shared one) and an ext4 partition for Ubuntu . I can't create a swap file . I follow this tutorial

I can't figure out what to do. I tried the fallocate comand and nothing happens .

terminal shows these:

ubuntu@ubuntu:~$ sudo dd if=/dev/zero of=/mnt/512MiB.swap bs=1024 count=524288
524288+0 records in
524288+0 records out
536870912 bytes (537 MB) copied, 1.34189 s, 400 MB/s
ubuntu@ubuntu:~$ sudo chmod 600 /mnt/512MiB.swap
ubuntu@ubuntu:~$ sudo mkswap /mnt/512MiB.swap
Setting up swapspace version 1, size = 524284 KiB
no label, UUID=fc09b869-8a61-4dde-8e42-ba00397e2abb

What i'm doing wrong? and how much space should i have to give? I have 2gb ram

thanks in advice and happy new year!!

share|improve this question
@viyyer asked: "@slimik can you detail the errors on running fallocate command to help solve the issues?" – Scott Severance Jan 3 '12 at 7:05
possible duplicate of How to increase swap space? – Sampo Sarrala Sep 23 '14 at 22:13

You have succeeded in creating a swap file. You didn't finish the tutorial and activate the swap file though. Finish following the tutorial by running swapon and editing /etc/fstab.

share|improve this answer

I belive is a limitation on the number of partitions your filesystem can handle. primary partitions are limited to 4 partitions, I recently had a similar problem with a friend notebook and took me sometime to figure it out. you have 2 choices, change the partitions scheme and add the swap partition as logical by creating space through resizing the common between win/ubuntu or if you have ample ram i.e >4gb giveup on using a swap file.

share|improve this answer
He's trying to create a swap file, not a partition. – psusi Jan 3 '12 at 4:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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