12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Network Services—Local Network ServicesYou also need to run the NFS client rc script manually, for the first time:# /etc/rc.d/nfsclient startYou can now mount the NFS shares using the mount(8) utility. The followingexample shows how to mount one of the exports we have done recently:# mount 192.168.0.5:/usr/ports/distfiles /mntThis will mount the export /usr/ports/distfiles from host 192.168.0.5 on the/mnt mount point. You can then verify if the share has been mounted:# mount/dev/da0s1a on / (ufs, local)devfs on /dev (devfs, local)/dev/da0s1e on /tmp (ufs, local, soft-updates)/dev/da0s1f on /usr (ufs, local, soft-updates)/dev/da0s1d on /var (ufs, local, soft-updates)fdescfs on /dev/fd (fdescfs)192.168.0.5:/usr/ports/distfiles on /mnt (nfs)You can then unmount the mounted share using the umount(8) command:# umount /mntMounting a NFS share manually is quite straightforward. This is useful whenyou want to mount a share temporarily, any time. But it is highly likely that youmay want to have your mounts activated automatically, during system boot. Justas in every other file system you can achieve this by adding necessary mountinginformation to the /etc/fstab file. However, this might be a little bit tricky. Thefollowing example shows mounting the same share we used in the recent examplevia the /etc/fstab file. To achieve this, the following line should be added tothe fstab file:192.168.0.5:/usr/ports/distfiles /mnt nfs -b 0 0This line in the fstab file will mount the share /usr/ports/distfiles from192.168.0.5 on /mnt, during system boot up.Normally your system will fail to boot if the specified share is notavailable and therefore cannot be mounted. This is the reason why-b flag is used. This flag tells mount_nfs(8) to fork a backgroundprocess if it fails to mount the share for any reason, and retry the mountin the background. This will avoid any boot problem if your share isbeing mounted from the fstab file during the boot-up process.[ 242 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!