The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Things look quiet here. But I've been doing a lot of blogging at dan.langille.org because I prefer WordPress now. Not all my posts there are FreeBSD related. I am in the midst of migrating The FreeBSD Diary over to WordPress (and you can read about that here). Once the migration is completed, I'll move the FreeBSD posts into the new FreeBSD Diary website.

Adding more swapfiles 6 October 2000
Need more help on this topic? Click here
This article has no comments
Show me similar articles
If you want to add a swapfile, perhaps you should read swap files first.  This article deals with adding a additional swapfile after adding your first swapfile.  So if you already have a swap file (and I'm not talking about a swap partition), and you want to add another, then this is the article for you.
Out of swap space again
I need yet more swap.  So I went and created a new swap file:
# dd if=/dev/zero of=/usr2/swapfile bs=15m count=20
10+0 records in
20+0 records out
314572800 bytes transferred in 40.594 secs (387462 bytes/sec)

Note that the above should have give you a 300Mb file (bs=15m, count=20 or 15Mx20 = 300Mb).  Enjoy.

Creating a new device
Before we can use this swapfile, we need to create a new vnconfig device.  Here's how I did that:
# cd /dev
# ./MAKEDEV vn1
Telling vnconfig about the new swapfile
Before I started this article, my /etc/vntab contained this:
/dev/vn0c /usr4/swapfile swap

After adding the new device, here's what the config file looked like:

/dev/vn0c /usr4/swapfile swap
/dev/vn1c /usr2/swapfile swap

My thanks to Glenn Johnson for his advice on the MAKEDEV and the config file.

Restarting vnconfig
Actually, I just rebooted to check some NFS issues, but I suspect the following would be sufficient:
vnconfig -ae
The results
Now I have this as swap space:
$ swapinfo
Device          1K-blocks     Used    Avail Capacity  Type
/dev/ad0s1b         70776     2128    68648     3%    Interleaved
/dev/rvn0c         153472     2088   151384     1%    Interleaved
/dev/rvn1c         307072     2248   304824     1%    Interleaved
Total              531320     6464   524856     1%

We'll see how that goes.


Share
Need more help on this topic? Click here
This article has no comments
Show me similar articles