苗火 Nicholas
[ubuntu]Set swap file on ubuntu12.04
2015-10-14 萧


Creating the Swap File

# dd if=/dev/zero of=/swapfile bs=1024 count=512000

512000+0 records in

512000+0 records out

524288000 bytes (524 MB) copied, 10.411 s, 50.4 MB/s

# mkswap /swapfile

Setting up swapspace version 1, size = 511996 KiB

no label, UUID=7baa7ca8-c840-4c6e-bd53-038ce4e9a477



Enabling the Swap File

# swapon /swapfile



View Swap File

# free

                total       used       free     shared    buffers     cached

Mem:        501840     496152       5688          0       8964     253104

-/+ buffers/cache:     234084     267756

Swap:       511996          0     511996



Starting every time

Edit /etc/fstab, add a line after all:

/swapfile       none    swap    defaults      0       0



 

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容