Tuesday, August 11, 2009

How do I add more swap memory in ubuntu?

You entered the wrong swap size no problem I'll show you how to increase your swap
I will create a 512Mb swap file:
Enter in bash this line:

1. sudo dd if=/dev/zero of=/mnt/512Mb.swap bs=1M count=512
2. sudo mkswap /mnt/512Mb.swap
3. sudo swapon /mnt/512Mb.swap
4. gksudo gedit /etc/fstab
add this line in the fstab file you just launched:
/mnt/512Mb.swap none swap sw 0 0
5.Reboot

How to create a large file in Ubuntu

Use the dd command

Here is the syntax of the dd command to create the file.
I will fill the file with NULL characters.
dd if=/dev/zero of=test.tst bs=1k count=4700000
if = input file
of = output file
bs = block size
count = file size in kb
the file size is given by multiplying bs and count

Example create a 1 GB file:
dd if=/dev/zero of=file_1GB.txt bs=1m count=1k

How to create a large file in windows command line

To create a large file of 1MB do this:
Run->cmd
fsutil file createnew c:\myfile.txt 1000000

To create a large file of 100MB do this:
Run->cmd
fsutil file createnew c:\myfile.txt 100000000

and so on.The number at the end tels you how big the file will be