Welcome to FreeBSDFreaks.net!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to add swap to a diskless workstation on FreeBSD 4.5x

 
   FreeBSD Hosting (Home) -> FreeBSD Handbook RSS
Next:  How to add swap to a diskless workstation on Free..  
Author Message
Neil Sandow

External


Since: Aug 03, 2003
Posts: 2



(Msg. 1) Posted: Sun Aug 03, 2003 5:25 pm
Post subject: How to add swap to a diskless workstation on FreeBSD 4.5x
Archived from groups: comp>unix>bsd>freebsd>misc (more info?)

There does not appear to be a good explanation available on the
newsgroups for how to set up a swap partition on diskless workstation
or server using FreeBSD 4.5x or more recent versions. I'm using a
RAID-5 nfs and dhcp server. It provides the diskless clients with the
O/S via tftpboot/pxeboot and also provides all the software/data used
in serving web pages in my particular case.

I'm not going to go into how to set up the diskless workstations. The
documentation is out there if you look hard enough. Providing swap
space for the diskless clients, however, has proved elusive. I've
read a lot about adding lines to the dhcpd.conf file like:

option swap-path code 128 = string;
option swap-size code 129 = integer 32;
option swap-path "192.168.4.4:/netswapvolume/netswap";
option swap-size 64000 ;

Whatever... - When I add this stuff to dhcpd.conf and restart dhcpd I
get syntax error messages. I assume that worked for earlier versions
of FreeBSD but not with 4.5x from my experience.

Here's how I was able to get it to work without adding any lines to
dhcpd.conf.:


A. Create a swap file in a filesystem of the nfs server that is
mounted read/write (rw) by the diskless workstation. Do not use the
root partition of the dhcp server which provides the O/S and config
files as it is read only.

(The info in the FreeBSD handbook

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/adding-swap-space.html

works just fine. You don't have to create the file with the
diskless workstation but you can if you want it to take a little
longer.)

Example 6-1. Creating a Swapfile on FreeBSD 4.X

1.Be certain that your kernel configuration includes the vnode
driver. It is not in recent versions of GENERIC.
pseudo-device vn 1 #Vnode driver (turns a file into a device)

2.create a vn-device:

# cd /dev
# sh MAKEDEV vn0

3.create a swapfile (/rw_directory/swap0):

# dd if=/dev/zero of=/path_to_mounted_rw_directory/swap0 bs=1024k
count=64

(this creates a 64 megabyte swap. If you want more/less change the
count=)

(where mounted_rw_directory is a directory on the nfs server that gets
mounted rw by the diskless server

for example: /usr/local/mount/swap0 )

4. set proper permissions on (/usr/swap0):

# chmod 0600 /path_to_mounted_rw_directory/swap0


5. enable the swap file in /etc/rc.conf:

swapfile="/path_to_mounted_rw_directory/swap0" # Set to name of
swapfile if aux swapfile desired.

-This line is placed in the rc.conf file used when the diskless
workstation boots. It is located on the dhcpd server.
(In my system it is located in:
/usr/local/diskless/conf/192.168.1.x/etc/rc.conf)

6. Reboot the machine or to enable the swap file immediately, type
(using the diskless workstation):

# vnconfig -e /dev/vn0b /path_to_mounted_rw_directory/swap0 swap


Run top and you should see that swap is now present.

Voila! That wasn't so tough, after all.

-Neil

 >> Stay informed about: How to add swap to a diskless workstation on FreeBSD 4.5x 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[FreeBSD-Announce] FreeBSD 5.3-RELEASE Announcement - This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig59305AECC7EFDF2CAA9A02BA Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit It is my great pleasure and privilege to announce the..

FreeBSD From Scratch (ie. My Own Custom FreeBSD) -

FreeBSD weakness. - On Mon, 21 Jun 2004 00:59:58 -0600 Lloyd Hayes <wyoming_antelope@yahoo.com> wrote: > >Linux is for people who hate Micro$oft. > >BSD is for people who love Unix. > > Under these conditions, I guess that I need to go for Linux......

Reference to freeBSD 5.3 - In the FreeBSD Handbook, < http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sound-setup.html > there is a reference to freeBSD 5.3. Is this a misprint, wishfull thinking, or perhaps a glimpse of what is to come? Thanks Gerard Seibert..

cannot install freebsd - while i am trying to install freebsd 5.2.1 i get and error: something about video card timing 10.000msec panic:ohci_add_done: addr 0x00004000 not found cpuid = 0; i have searched most of the freebsd handbook, any forum i could find, and talking to a..
   FreeBSD Hosting (Home) -> FreeBSD Handbook All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]