wual.wwtturi.com
Linux NFS Export / share directory to other UNIX / Linux computerTo share a directory using the Network File System (NFS) in Linux, you can use the following steps:
- Install the NFS server package: If the NFS server package is not already installed on your system, you can install it using your distribution's package manager. For example, on a Debian-based system, you can use the following command:
sudo apt-get install nfs-kernel-server
- Create the directory to be shared: Create the directory that you want to share with other computers. For example:
mkdir /shared
This will create a directory called "/shared" in the root of the filesystem.
- Edit the "/etc/exports" file: Open the "/etc/exports" file in a text editor and add an entry for the directory you want to share. The entry should include the path to the directory, followed by the options for the share. For example:
/shared 192.168.1.0/24(rw,sync)
This will allow computers on the 192.168.1.0/24 network to access the "/shared" directory with read and write permissions.
- Export the directory: Run the "exportfs" command to export the directory you specified in the "/etc/exports" file. For example:
sudo exportfs -a
This will make the directory available to other computers on the network.
- Mount the shared directory on the other computers: On the other computers that you want to access the shared directory, you can use the "mount" command to mount the shared directory. For example:
mount -t nfs 192.168.1.100:/shared /mnt
This will mount the "/shared" directory from the NFS server at IP address 192.168.1.100 on the local "/mnt" directory.
Note: The steps above are just a few examples of how you can share a directory using NFS in Linux. The specific steps you need to take may vary depending on your system and the configuration of the NFS server.