nfs-storage
Skill này làm gì
Công cụ này giúp thiết lập các máy tính để chia sẻ tệp qua mạng. Một máy tính đóng vai trò 'máy chủ' lưu trữ tệp, còn các máy tính khác ('máy khách') có thể truy cập các tệp này như thể chúng nằm trên ổ đĩa của chính họ.
Khi nào nên dùng
- ✓Khi bạn cần nhiều máy Linux truy cập cùng một tập tệp.
- ✓Khi muốn tạo một không gian lưu trữ trung tâm cho dữ liệu ứng dụng hoặc thư mục người dùng.
- ✓Khi thiết lập các hệ thống dùng container (như Kubernetes) cần lưu trữ chia sẻ.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/nfs-storage/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thiết lập máy chủ NFS để chia sẻ thư mục /data với quyền đọc-ghi cho mạng 192.168.1.0/24.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn cài phần mềm NFS trên máy chủ và máy khách. Sau đó, bạn cấu hình các thư mục trên máy chủ sẽ được chia sẻ và cách máy khách truy cập, đồng thời xác định quyền.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
NFS Storage
Configure NFS servers and clients for network file sharing across Linux systems. Covers NFSv4 server setup, export options, client mounting, autofs for on-demand mounts, Kerberos security, performance tuning, and Kubernetes integration.
When to Use
- Sharing directories between multiple Linux servers (web farms, build clusters)
- Providing shared storage for containerized workloads (Kubernetes ReadWriteMany)
- Centralizing home directories or application data across a fleet
- Setting up a development environment with shared project files
- Migrating from local storage to network-attached storage
Prerequisites
- NFS server:
nfs-kernel-server(Debian/Ubuntu) ornfs-utils(RHEL/CentOS) - NFS client:
nfs-common(Debian/Ubuntu) ornfs-utils(RHEL/CentOS) - Network connectivity between server and clients (TCP/UDP 2049 for NFSv4)
- Firewall rules allowing NFS traffic
- For NFSv4 Kerberos:
krb5-userand a functioning KDC
NFS Server Setup
Installation
# Debian / Ubuntu
apt update && apt install -y nfs-kernel-server
# RHEL / CentOS
dnf install -y nfs-utils
# Enable and start the NFS server
systemctl enable --now nfs-server
# Verify NFS is running
systemctl status nfs-server
rpcinfo -p | grep nfs
Export Configuration (/etc/exports)
# /etc/exports
# Syntax: <directory> <client-spec>(options)
# Share /data to a specific subnet with read-write access
/data 10.0.0.0/24(rw,sync,no_subtree_check,no_root_squash)
# Share /shared read-only to everyone
/shared *(ro,sync,no_subtree_check)
# Share /home to specific hosts
/home server01.example.com(rw,sync,no_subtree_check)
/home server02.example.com(rw,sync,no_subtree_check)
# Share /var/nfs/projects with root squash (default, map root to nobody)
/var/nfs/projects 10.0.0.0/24(rw,sync,no_subtree_check,root_squash)
# NFSv4 pseudo-root export (recommended for NFSv4)
/srv/nfs 10.0.0.0/24(rw,sync,fsid=0,crossmnt,no_subtree_check)
/srv/nfs/data 10.0.0.0/24(rw,sync,no_subtree_check,no_root_squash)
/srv/nfs/shared 10.0.0.0/24(ro,sync,no_subtree_check)
Export Options Explained
| Option | Description |
|---|---|
rw |
Read-write access |
ro |
Read-only access |
sync |
Write data to disk before replying (safe, slower) |
async |
Reply before data is written to disk (fast, risk of corruption) |
no_subtree_check |
Disable subtree checking (improves reliability) |
root_squash |
Map remote root (UID 0) to nobody (default, more secure) |
no_root_squash |
Allow remote root to act as root on the server (use cautiously) |
all_squash |
Map all remote UIDs/GIDs to nobody |
anonuid=1000 |
Map anonymous users to a specific UID |
anongid=1000 |
Map anonymous groups to a specific GID |
crossmnt |
Allow clients to traverse into sub-mounts |
fsid=0 |
Mark as the NFSv4 pseudo-root |
Applying Export Changes
# Apply changes to exports (no server restart needed)
exportfs -ra
# Show current exports
exportfs -v
# Export a new directory on the fly (temporary, not persistent)
exportfs -o rw,sync,no_subtree_check 10.0.0.0/24:/tmp/share
# Unexport a directory
exportfs -u 10.0.0.0/24:/tmp/share
Server Firewall Configuration
# UFW (Ubuntu)
ufw allow from 10.0.0.0/24 to any port nfs
ufw allow from 10.0.0.0/24 to any port 111 # rpcbind (NFSv3)
# firewalld (RHEL/CentOS)
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --permanent --add-service=mountd
firewall-cmd --reload
# NFSv4 only needs TCP 2049 (no rpcbind or mountd)
firewall-cmd --permanent --add-port=2049/tcp
firewall-cmd --reload
NFS Client Configuration
Manual Mounting
# Install NFS client
apt install -y nfs-common # Debian/Ubuntu
dnf install -y nfs-utils # RHEL/CentOS
# Discover exports from the server
showmount -e nfs-server.example.com
# Mount an NFS share manually
mkdir -p /mnt/data
mount -t nfs nfs-server.example.com:/data /mnt/data
# Mount with specific NFS version and options
mount -t nfs -o vers=4.2,tcp,hard,intr nfs-server.example.com:/data /mnt/data
# Verify the mount
mount | grep nfs
df -hT /mnt/data
# Unmount
umount /mnt/data
Persistent Mounts via /etc/fstab
# /etc/fstab entries for NFS
# Basic NFSv4 mount
nfs-server.example.com:/data /mnt/data nfs4 defaults,_netdev 0 0
# Mount with performance and reliability options
…
Câu hỏi thường gặp
NFS là gì?
NFS là viết tắt của Network File System. Đây là giao thức cho phép một máy tính truy cập tệp trên máy tính khác qua mạng như thể tệp nằm trên máy của mình.
Khác biệt giữa máy chủ NFS và máy khách là gì?
Máy chủ là máy tính lưu trữ và chia sẻ tệp. Máy khách là máy tính truy cập các tệp do máy chủ chia sẻ.
Tôi có thể chia sẻ thư mục ở chế độ chỉ đọc không?
Có, bạn có thể cấu hình thư mục chỉ cho phép đọc, đảm bảo tệp không bị máy khách sửa đổi.
Chi tiết
Mô tả gốc của tác giả
Configure NFS servers and clients. Implement network file sharing for Linux systems. Use when setting up shared storage.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5304
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.