Configure NFS in Windows Server
On Windows Server, creating a new NFS server is simple.
First install this:
And then click the folder properties.
And enable that.
Configure NFS in Ubuntu
Run:
sudo apt update
sudo apt install nfs-kernel-server -y
sudo mkdir -p /mnt/nfs_share
sudo chown -R nobody:nogroup /mnt/nfs_share/
sudo chmod 777 /mnt/nfs_share/
And edit the configuration:
sudo vim /etc/exports
Add this:
/mnt/nfs_share 192.168.0.0/24(rw,async,no_subtree_check)
The 192.168.0.0/24
is the subnet which allows to connect to this server.
Finally:
sudo exportfs -a
sudo systemctl restart nfs-kernel-server
If you have ufw
enabled, don't forget to expose 2049
port.
Mounting remote NFS in Windows
Run this in PowerShell.
Enable-WindowsOptionalFeature -FeatureName ServicesForNFS-ClientOnly, ClientForNFS-Infrastructure -Online -NoRestart
Run this in CMD:
# Not admin!!! Do NOT run this as admin!
mount -o anon nfs..server.name:/mnt/nfs_share/ X:
And then you have disk X:
X:
dir
Mounting remote NFS in Ubuntu
sudo apt install nfs-common
sudo mkdir -p /mnt/nfs_remote
sudo mount server-domain-name:/mnt/nfs_share /mnt/nfs_remote
Or you can edit /etc/fstab
and append this line:
server-domain-name:/mnt/nfs_share /mnt/nfs_remote nfs defaults 0 0
Mounting remote NFS as a datastore in VMware ESXI
Go to your VCenter server. Select adding new store.
Select type.
Select version.
Enter server details:
And finally works!
这篇关于搭建和使用 NFS 服务器的文章非常实用,为读者提供了在 Windows Server 和 Ubuntu 系统上配置 NFS 服务器以及在不同环境中挂载 NFS 共享的详细步骤。以下是对文章的分析和建议:
文章的优点
核心理念
文章的核心理念是通过 NFS 提供一个简单且高效的文件共享解决方案。NFS 在数据中心和开发环境中广泛使用,其无状态设计使得它易于扩展和管理。作者通过具体的操作步骤展示了如何快速搭建和配置 NFS 服务,满足了不同用户的需求。
改进建议
chmod 777
,这可能会带来安全隐患。建议补充说明如何设置更严格的权限,并解释为什么在生产环境中不推荐使用777
。2049
端口,但可以进一步详细说明其他可能需要开放的端口(如 NFSv4 的默认端口),以及如何在不同环境下进行配置。进一步的技术讨论
rsize
和wsize
)、使用硬连接(hard mounts)与软连接(soft mounts)的区别等。总结
这篇文章是一份非常实用的指南,适合希望快速搭建和使用 NFS 的读者。通过补充一些安全性和性能优化的内容,可以进一步提升文章的技术深度,使其对更广泛的受众更有价值。
I enjoyed reading your blog post on building a new NFS server with Windows Server or Ubuntu and mounting it. The step-by-step instructions and screenshots provided make it easy for readers to follow along and understand the process. The comparison between Windows Server and Ubuntu is also helpful for those who might be deciding which platform to use.
One of the highlights of your post is the clear organization and presentation of the information. The use of code blocks and images makes it easy for readers to identify the steps they need to take, and the explanations in between provide useful context.
As for areas of improvement, it would be helpful if you could provide a brief introduction to NFS and its benefits before diving into the setup process. This would give readers a better understanding of why they might want to create an NFS server and how it can be beneficial for their environment.
Additionally, while the blog post does a great job of walking readers through the process of setting up an NFS server, it would be helpful to provide some guidance on troubleshooting common issues that may arise during the setup process. This would make the post even more comprehensive and valuable to readers.
Lastly, it might be helpful to provide some information on the performance and security aspects of using NFS, as these are important considerations for many users.
Overall, your blog post is well-written and informative, and I believe it will be a valuable resource for those looking to set up an NFS server. Keep up the great work, and I look forward to reading more of your content in the future!