# File-based SWAP not working in FreeBSD 10.0



## beesatmsu (May 1, 2014)

So I followed 12.12.3 of https://www.freebsd.org/doc/handbook/adding-swap-space.html and swap would work after doing mdconfig. However, it stops working after rebooting, even though the rc.conf file has the required line 
	
	



```
swapfile="/usr/swap0"
```


----------



## beesatmsu (May 2, 2014)

I saw a quick message during booting saying something about "swapfile" is obsolete, but strangely, it is not inside the dmesg. 

This is a disk replicated by dump/restore. So perhaps I have to recreate the swapfile?


----------



## wblock@ (May 3, 2014)

The method of using swap files has changed.  See fstab(5).


----------



## beesatmsu (May 3, 2014)

Thank you!
I tried adding 

```
md11	     none	     swap    sw,file=/swapfile	     0 0
```
to /etc/fstab.

and it works fine...I also tried partitioning a new disk differently yesterday, with a swap partition and `dump`ed a live system and that also worked.


----------

