Under Linux, all partitions used by the system must be listed in
/etc/fstab. This file contains the mountpoints of those partitions
(where they are seen in the file system structure), how they should be mounted
(special options) and when (automatically or not, can users mount those or not,
etc.).

Creating /etc/fstab

/etc/fstab uses a special syntaxis. Every line consists of six
fields, separated by whitespace (space(s), tabs or a mixture). Each field has
its own meaning:

The first field shows the partition described (the path to the device
file)

The second field shows the mountpoint at which the partition should be
mounted

The third field shows the filesystem used by the partition

The fourth field shows the mountoptions used by mount when it
wants to mount the partition. As every filesystem has its own mountoptions,
you are encouraged to read the mount manpage (man mount) for a full
listing. Multiple mountoptions are comma-separated.

The fifth field is used by dump to determine if the partition needs to
be dumped or not. You can generally leave this as 0 (zero).

The sixth field is used by fsck the order in which filesystems should
be checked if the system wasn't shut down properly. The root filesystem
should have 1 while the rest should have 2 (or 0 in case
a filesystem check isn't necessary).

So start nano (or your favorite editor) to create your
/etc/fstab:

# nano -w /etc/fstab

Lets take a look at how we write down the options for the /boot
partition. This is just an example, so if your architecture doesn't require a
/boot partition, don't copy it verbatim.

In our default x86 partitioning example /boot is the
/dev/hda1 partition, with ext2 as filesystem. It shouldn't
be mounted automatically (noauto) but does need to be checked. So we
would write down:

/dev/hda1 /boot ext2 noauto 1 2

Now, to improve performance, most users would want to add the noatime
option as mountoption, which results in a faster system since access times
aren't registered (you don't need those generally anyway):

/dev/hda1 /boot ext2 noauto,noatime 1 2

If we continue with this, we would end up with the following three lines (for
/boot, / and the swap partition):

auto makes mount guess for the filesystem (recommended for
removable media as they can be created with one of many filesystems) and
user makes it possible for non-root users to mount the CD.

Now use the above example to create your /etc/fstab. If you are a
SPARC-user, you should add the following line to your /etc/fstab
too:

none /proc/openprom openpromfs defaults 0 0

If you need usbfs, add the following line to /etc/fstab:

none /proc/bus/usb usbfs defaults 0 0

Reread your /etc/fstab, save and quit to continue.

Networking InformationHostname, Domainname etc.

One of the choices the user has to make is name his PC. This seems to be quite
easy, but lots of users are having difficulties finding the appropriate
name for their Linux-pc. To speed things up, know that any name you choose can
be changed afterwards. For all we care, you can just call your system
tux and domain homenetwork.

We use these values in the next examples. First we set the hostname:

# echo tux > /etc/hostname

Second we set the domainname:

# echo homenetwork > /etc/dnsdomainname

If you have a NIS domain (if you don't know what that is, then you don't have
one), you need to define that one too:

# echo nis.homenetwork > /etc/nisdomainname

Configuring your Network

Before you get that "Hey, we've had that already"-feeling, you should remember
that the networking you set up in the beginning of the gentoo installation was
just for the installation. Right now you are going to configure networking for
your Gentoo system permanently.

All networking information is gathered in /etc/conf.d/net. It uses
a straightforward yet not intuitive syntax if you don't know how to setup
networking manually. But don't fear, we'll explain everything :)

First open /etc/conf.d/net with your favorite editor (nano
is used in this example):

# nano -w /etc/conf.d/net

The first variable you'll find is iface_eth0. It uses the following
syntax:

If you use DHCP (automatic IP retrieval), you should just set iface_eth0
to dhcp. However, if you need to setup your network manually and you're
not familiar with all the above terms, please read the section on Understanding Network
Terminology if you haven't done so already.

So lets give two examples; the first one uses DHCP, the second one a static IP
(192.168.0.2) with netmask 255.255.255.0, broadcast 192.168.0.255 and gateway
192.168.0.1:

If you have several network interfaces, create extra iface_eth variables,
like iface_eth1, iface_eth2 etc. The gateway variable
shouldn't be reproduced as you can only set one gateway per computer.

Now save the configuration and exit to continue.

Automatically Start Networking at Boot

To have your network interfaces activated at boot, you need to add those to the
default runlevel. If you have PCMCIA interfaces you should skip this action as
the PCMCIA interfaces are started by the PCMCIA init script.

# rc-update add net.eth0 default

If you have several network interfaces, you need to create the appropriate
net.eth1, net.eth2 etc. initscripts for those. You can
use ln to do this:

You now need to inform Linux about your network. This is defined in
/etc/hosts and helps in resolving hostnames to IP addresses
for hosts that aren't resolved by your nameserver. For instance, if your
internal network consists of three PCs called jenny (192.168.0.5),
benny (192.168.0.6) and tux (this system) you would
open /etc/hosts and fill in the values: