blog.up-link.ro
25Mar/100

How To keep ports collection up to date in FreeBSD

The FreeBSD Ports collection is a package management system for FreeBSD which provides an easy way of installing software packages on the FreeBSD operating system.

1. Updating the ports collection

a.) Using CVSup method

This is a quick method of getting and keeping your ports collection up to date using cvsup protocol. Make sure /usr/ports is empty before you run cvsup for the first time.

If you never updated ports collection you have to install cvsup utility:

# pkg_add -r cvsup-without-gui

Update ports collection:

# cvsup -L 2 -h cvsup.freebsd.org /usr/share/examples/cvsup/ports-supfile

Above step will take some time to fetch the files.

b.) Using portsnap method

Portsnap is an alternative system for distributing the ports collection.

Install portsnap with the following command:

# pkg_add -r portsnap

Print This Post Print This Post
25Mar/100

How To Set Up a NFS Server in FreeBSD

Network File System (NFS) is a network file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.

1. Setting up a NFS Server

The first step to setting up a NFS server is to edit the /etc/rc.conf file and add the following lines:

nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
rpcbind_enable="YES"
mountd_flags="-r"
mountd_enable="YES"

Next, you have to set up /etc/exports file to define which machines have permission to which folders.  The exports file looks something like this:

/data -maproot=user1 host1 host2 host3
/backup -alldirs host1 host2 host3
/store host2

In this example the machines host1,host2 and host3 are given the privileges of the user1 for the /data directory.

For /backup they are given access to read from all directories within backup. And for /store only host2 is given access to read just the /store directory (make sure you replace hosts with your desired host names).

To start NFS server, enter:

rpcbind
nfsd -u -t -n 4
mountd -r

2. Restarting the NFS Server

Once you have made changes to the exports file you need to restart NFS for the changes to take effect:

kill -HUP `cat /var/run/mountd.pid`
Print This Post Print This Post