[CentOS] why i can not put my swap files in /dev?

Jerry McAllister jerrymc at msu.edu
Tue Jul 6 13:14:29 UTC 2010


On Tue, Jul 06, 2010 at 06:41:06PM +0800, Tang Jianwei wrote:

> I tried to create some swap files in /dev directory for my desktop.
> the dd and mkswap were ok. but when I try to swapon it, i get this:
> 
> # swapon /dev/myswap
> swapon: /dev/myswap: Invalid argument
> 
> but when I mv the file to some other directory like /mnt or /, the 
> swapon works.
> 
> could sb. tell me why?

/dev is not a real directory for data files.
You should actually make a separate partition for swap  
Otherwise, you can put it in some real file spaca such as in /usr
or where you left a lot of space.    That is often done to increase
available swap space when the originally created  swap  partition
is not large enough - add some from file space.

////jerry



> 
> -- 
> Tang Jianwei
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos



More information about the CentOS mailing list