Книга: Fedora™ Unleashed, 2008 edition

NFS Client Configuration

NFS Client Configuration

To configure your host as an NFS client (to acquire remote files or directories), edit the /etc/fstab file as you would to mount any local file system. However, rather than use a device name to be mounted (such as /dev/sda1), enter the remote hostname and the desired file system to be imported. For example, one entry might look like this:

# Device            Mount Point Type Options      Freq Pass
yourhost:/usr/local /usr/local  nfs  nfsvers=4,ro 0    0

NOTE

If you use autofs on your system, you need to use proper autofs entries for your remote NFS mounts. See the section 5 man page for autofs.

The options column uses the same options as standard fstab file entries with some additional entries, such as nfsvers=4, which specifies the fourth version of NFS. You can also use the mount command, as root, to quickly attach a remote directory to a local file system by using a remote host's name and exported directory. For example:

# mount -t nfs 192.168.0.11:/home/andrew
/home/andrew/test/foo

After you press Enter, the entire remote directory appears on your file system. You can verify the imported file system by using the df command, like so:

# df
Filesystem 1K-blocks     Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
            73575592 58627032  11150752  85% /
/dev/sda1     101086    18697     77170  20% /boot
tmpfs         512724        0    512724   0% /dev/shm
192.168.0.11:/home/andrew
            35740416  5554304   28341248 17% /home/andrew/test/foo

Make sure that the desired mount point exists before using the mount command. When you finish using the directory (perhaps for copying backups), you can use the umount command to remove the remote file system. Note that if you specify the root directory (/) as a mount point, you cannot unmount the NFS directory until you reboot (because Linux complains that the file system is in use).

Оглавление книги

Оглавление статьи/книги

Генерация: 1.154. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз