CentOS7挂载NAS共享存储

2020-05-27   83 次阅读


  • 记一次在centos7下挂载惠普nas存储的操作,这台惠普nas存储的访问协议有两种:CIFS和NFS,本次采用nfs协议
  • 环境介绍:
    • NSA存储:HP Store Once 3540
    • 采用协议:NFS
    • 磁盘容量:500G
    • 挂载路径:10.1.1.133:/nas/nfs-ts
    • 操作系统:centos7

1.在nas上创建共享存储

nas-1

2.在操作系统上安装依赖包

[root@localhost]$ yum install -y samba samba-client nfs-utils 
[root@localhost]$ rpm -qa samba*
samba-client-libs-4.10.4-11.el7_8.x86_64
samba-common-libs-4.10.4-11.el7_8.x86_64
samba-common-tools-4.10.4-11.el7_8.x86_64
samba-client-4.10.4-11.el7_8.x86_64
samba-common-4.10.4-11.el7_8.noarch
samba-libs-4.10.4-11.el7_8.x86_64
samba-4.10.4-11.el7_8.x86_64
[root@localhost]$ rpm -qa nfs-utils
nfs-utils-1.3.0-0.66.el7.x86_64

3.创建一个挂载目录

mkdir /backup

4.使用mount命令挂载

[root@localhost]$ mount -t nfs 10.1.1.133:/nas/nfs-ts /backup
[root@localhost]$ df -Th
文件系统                类型      容量  已用  可用 已用% 挂载点
devtmpfs                devtmpfs  3.8G     0  3.8G    0% /dev
tmpfs                   tmpfs     3.9G     0  3.9G    0% /dev/shm
tmpfs                   tmpfs     3.9G   12M  3.8G    1% /run
tmpfs                   tmpfs     3.9G     0  3.9G    0% /sys/fs/cgroup
/dev/mapper/centos-root xfs        95G  1.5G   94G    2% /
/dev/sda1               xfs      1014M  149M  866M   15% /boot
tmpfs                   tmpfs     781M     0  781M    0% /run/user/0
10.1.1.133:/nas/nfs-ts  nfs4      466G  4.0M  466G    1% /backup

5.写入fstab文件让它开机自动挂载

[root@localhost]$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Apr 23 14:04:20 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=e694a4b4-101f-480a-81d3-dfcd916e126d /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
10.1.1.133:/nas/nfs-ts /backup                  nfs     defaults        0 0

脑无理想 枉活一世