Initial configuration

File systems configuration

by ross at 05:55:53 on October 6, 2012

/etc/fstab:

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/swap0          none            swap    sw              0       0
/dev/ufs/root0          /               ufs     rw              1       1
/dev/ufs/var0           /var            ufs     rw              2       2
/dev/ufs/usr0           /usr            ufs     rw              2       3
/dev/ufs/ports0         /usr/ports      ufs     rw              2       4
/dev/ufs/home0          /usr/home       ufs     rw              2       5
/dev/cd0                /media/cdrom    cd9660  ro,noauto       0       0
/dev/da0s1              /media/flash    msdosfs rw,sync,noauto,longnames,-Lru_RU.UTF-8 0 0

As you can see I use UFS2 labels to mount partitions (parameter -L to newfs). If you forgot to label filesystems then you could boot FreeBSD installation media, choose "Shell" and create labels like this:
tunefs -L root0 /dev/ada0s1a

If you need quota support modify appropriate fs lines of fstab:

/dev/ufs/home0         /usr/home       ufs     rw,userquota,groupquota 2 5

But that's not all. Add enable_quotas="YES" to /etc/rc.conf and options QUOTA to your kernel config. Use edquota(8) to edit quota.

NFS exports

If you need help activating NFS support refer to the Handbook.

To see the list of NFS exported filesystems:

# showmount -e

To export UFS2 filesystem add to /etc/exports:

/usr/ports             -maproot=root -network 192.168.10.0 -mask 255.255.255.0

UFS2 Filesystem /usr/ports is exported to 192.168.10.0/24 read-write, remote root is mapped to local root.

To export ZFS filesystem /usr/ports of pool system, run:

# zfs set \
  sharenfs="-maproot=root -network 192.168.10.0 -mask 255.255.255.0" \
  system/usr/ports

To appy the changes reload mountd:

# service mountd onereload

Flash automount:

In case you need it you can enable flash automount by creating /etc/devd/umass.conf:

attach 100 {
        device-name "umass[0-9]+";
        action      "sleep 1; mount /media/flash";
};

detach 100 {
        device-name "umass[0-9]+";
        action      "umount -f /media/flash";
};
# mkdir /media/flash
# chmod 777 /media/flash
# service devd restart

 

Comments