Linux-ALL-NFS-Command
Linux-ALL-NFS-Command
Configfile :/etc/exports
or /etc/exports.d/anyname.exports
check :showmount -e
showmount -e <localhost>
showmount -e <Name/IP>
reload :exports -r
or exports-avr
============================================================
nfs-utils-2.5.4-10.el9.x86_64
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
Active: active (exited) since Mon 2023-10-16 09:37:18 +06; 26s ago
Process: 32232 ExecStart=/bin/sh -c if systemctl -q is-active gssproxy; then systemctl reload gssproxy ;
fi (code=e>
file sharing1
file sharing2
[root@localhost nfs-share]#
/nfs-share 192.168.0.0/24(rw,sync)
[root@localhost nfs-share]#
success
success
[root@localhost nfs-share]# firewall-cmd --permanent --add-service=mountd
success
success
public (active)
target: default
icmp-block-inversion: no
interfaces: ens160
sources:
ports:
protocols:
[root@localhost nfs-share]#
/nfs-share 192.168.0.0/24
[root@localhost nfs-share]#
Clientside :
============
Temporary Mount
===============
[root@newhost ~]# rpm -qa nfs-utils
[root@newhost ~]#
nfs-client.target nfs-mountd.service
nfsdcld.service nfs-server.service
[root@newhost ~]#
[root@newhost ~]#
Active: active (exited) since Mon 2023-10-16 10:01:24 +06; 23s ago
CPU: 49ms
/nfs-share 192.168.0.0/24
[root@newhost ~]#
[root@newhost ~]#
f1 f2
file sharing1
ClientSide
===================
Permanent Mount:
===================
/ : ignored
none : ignored
[root@newhost mnt]#
[root@newhost mnt]#
[root@newhost mnt]#
Autofs / Automount
===================
Configfile :/etc/auto.master.d/anyname.autofs
or /etc/auto.misc
[root@newhost mnt]#
autofs-5.1.7-27.el9.x86_64
[root@newhost mnt]#
[root@newhost mnt]#
Active: active (running) since Mon 2023-10-16 11:26:07 +06; 18s ago
Memory: 1.7M
CPU: 44ms
CGroup: /system.slice/autofs.service
/etc/auto.master
/etc/auto.misc
/etc/auto.net
/etc/auto.smb
/etc/autofs.conf
/etc/autofs_ldap_auth.conf
/etc/sysconfig/autofs
/usr/lib/systemd/system/autofs.service
[root@newhost mnt]#
/- /etc/auto.misc
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
[ autofs ]
#master_map_name = auto.master
# (such as sss).
[root@newhost auto.master.d]#
f1 f2 f3 f4
[root@newhost auto.master.d]#
[root@newhost auto.master.d]#
For Q. Solve
==================
Server side :
==================
[root@localhost ~]# mkdir /home/area -p (execute it client side also, need same username with same
uid bothside)
root@192.168.1.18's password:
[root@localhost ~]# ssh root@192.168.1.18 "useradd depo2 -d /home/area/depo2 -u 5002"
root@192.168.1.18's password:
root@192.168.1.18's password:
root@192.168.1.18's password:
# file: home/area/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
/home/area 192.168.1.0/24(rw,sync)
success
/home/area 192.168.1.0/24
Client Side :
=========================
Memory: 1.8M
CPU: 40ms
CGroup: /system.slice/autofs.service
[root@newhost ~]#
[root@newhost ~]# showmount -e 192.168.1.13
/home/area 192.168.1.0/24
/home/area/depo1
/root
/misc /etc/auto.misc
/home/area /etc/auto.misc
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
/net -hosts
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
* -rw,sync 192.168.1.13:/home/area/&
[root@newhost ~]#
[root@newhost ~]#
/home/area/depo1