zoukankan      html  css  js  c++  java
  • Mount NAS Storage in Linux Overview 转载

    Mount NAS Storage in Linux

    Overview

    Mounting your NAS Storage to a device that runs on a Linux-based Operating System can be done using a series of simple commands in the shell or terminal within the OS.  This procedure outlines the steps required to mount NAS Storage on any of the following operating systems:

    • RedHat Enterprise Linux
    • CentOS
    • CloudLinux
    • Debian
    • Ubuntu

    Please note that while the majority of steps apply to all of the operating systems listed above, the commands required to determine if your CIFS utility is installed on Debian and Ubuntu are unique.  Follow the steps below to mount NAS Storage to your Linux-based OS.

    Mount NAS Storage

      1. Determine if the OS on your device is RedHat Enterprise Linux, CentOS or CloudLinux -OR- Debian or Ubuntu.

    If your device is running…

    Then…

    RedHat Enterprise Linux, CentOS or CloudLinux

    Determine if the cifs-utils utility is installed by running the following command:

    root@slnastest [~]# rpm -q cifs-utils

    Note: If cifs-utils is not installed, the following message will appear:

    package cifs-utils is  not installed



    • If cifs-utils is installed, proceed to the next step.
    • If cifs-utils is not installed, install the utility using the following command:


    root@slnastest [~]# yum install cifs-utils

    Debian or Ubuntu

    Determine if the cifs-utils utility is installed by running the following command:

    root@slnastest:~# dpkg-query -S cifs-utils

    Note: If cifs-utils is not installed, the following message will appear:

    dpkg-query: no path found matching   pattern *cifs-utils*.

    • If cifs-utils is installed, proceed to the next step.
    • If cifs-utils is not installed, install the utility using the following command:


    root@slnastest [~]# apt-get install cifs-utils
    root@slnastest:~# dpkg-query -S cifs-utils
    cifs-utils: /usr/share/doc/cifs-utils
    cifs-utils: /usr/share/doc/cifs-utils/changelog.gz
    cifs-utils: /usr/share/doc/cifs-utils/NEWS.Debian.gz
    cifs-utils: /usr/share/doc/cifs-utils/changelog.Debian.gz
    cifs-utils: /usr/share/doc/cifs-utils/copyright

      1. Create the directory and mount the device using the following commands:

        mkdir /local/mountpoint
        mount -t cifs //Hostname/Username -o username=username,password=password,rw,nounix,iocharset=utf8,file_mode=0644,dir_mode=0755 /mnt

        Example:

            root@slnastest [~]# mkdir /mnt/nas
            root@slnastest [~]# mount -t cifs //nas05.service.softlayer.com/SL12345-1 -o username=SL12345-1,password=NASPASSWORD rw,nounix,iocharset=utf8,file_mode=0644,dir_mode=0755 /mnt/nas
            root@slnastest [~]# df -Th /mnt/nas/
        Filesystem    Type    Size  Used Avail Use% Mounted on
            //nas05.service.softlayer.com/SL12345-1
                      cifs     54T   49T  5.3T  91% /mnt/nas
      2. Determine if the NAS should mount on reboot.

    If the NAS should…

    Then…

    Mount on reboot

    Add the following command to the /etc/fstab file:

        //nas05.service.softlayer.com/SL12345-1        /mnt/nas         cifs defaults,username=SL12345-1,password=NASPASSWORD 0 0

    Not mount on reboot

    Proceed to the next step.

      1. Unmount and mount the NAS to verify that the fstab was edited correctly.  Refer to the table below for the unmount and mount commands.

    Action

    Command

    Unmount the NAS

    root@slnastest [~]# umount /mnt/nas/

    root@slnastest [~]# df -Th /mnt/nas

    Filesystem    Type    Size  Used Avail Use% Mounted on

    /dev/xvda2    ext3     25G  4.6G   19G  20% /

    Mount the NAS

    root@slnastest [~]# mount /mnt/nas/

    root@slnastest [~]# df -Th /mnt/nas/

    Filesystem    Type    Size  Used Avail Use% Mounted on

    //nas05.service.softlayer.com/SL12345-1

                  cifs     54T   49T  5.3T  91% /mnt/nas

  • 相关阅读:
    成都Uber优步司机奖励政策(2月18日)
    北京Uber优步司机奖励政策(2月18日)
    滴滴快车奖励政策,高峰奖励,翻倍奖励,按成交率,指派单数分级(2月18日)
    优步UBER司机全国各地最新奖励政策汇总(持续更新...)
    新年Uber司机端换新装啦!
    百度参投 Uber中国12亿美元融资已到账
    人民优步+(拼车)自动接单功能上线
    vi 调到第一行,或最后一行
    linux文本操作界面 vi面板如何复制一行
    Apache支持多端口配置处理
  • 原文地址:https://www.cnblogs.com/davidwang456/p/3333214.html
Copyright © 2011-2022 走看看