Mount NAS Storage in Linux Overview 转载

Mount NAS Storage in LinuxOverviewMounting your NAS Storage to a device that runs on a Linux-based O

<h1 class=”title”>Mount NAS Storage in Linux

OverviewMounting
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…

</td>
<td valign=”top” width=”613″>

Then…

</td>

</tr>
<tr>
<td valign=”top” width=”399″>

RedHat Enterprise Linux,CentOS or CloudLinux

</td>
<td valign=”top” width=”613″>

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

root@slnastest [~]# rpm -q cifs-utilsNote: 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

</td>

</tr>
<tr>
<td valign=”top” width=”399″>

Debian or Ubuntu

</td>
<td valign=”top” width=”613″>

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

</td>

</tr>

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

    mkdir /local/mountpointmount
    -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,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…

</td>
<td valign=”top” width=”613″>

Then…

</td>

</tr>
<tr>
<td valign=”top” width=”399″>

Mount on reboot

</td>
<td valign=”top” width=”613″>

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

</td>

</tr>
<tr>
<td valign=”top” width=”399″>

Not mount on reboot

</td>
<td valign=”top” width=”613″>

Proceed to the next step.

</td>

</tr>

  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.

</td>
<td valign=”top” width=”613″>
<p align=”center”>Command

</td>

</tr>
<tr>
<td valign=”top” width=”399″>

Unmount the NAS

</td>
<td valign=”top” width=”613″>

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% /

</td>

</tr>
<tr>
<td valign=”top” width=”399″>

Mount the NAS

</td>
<td valign=”top” width=”613″>

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

</td>

</tr>

作者: dawei

【声明】:永州站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

【免责声明】本站内容转载自互联网,其发布内容言论不代表本站观点,如果其链接、内容的侵犯您的权益,烦请提交相关链接至邮箱xwei067@foxmail.com我们将及时予以处理。

Copygight © 2017-2023 https://www.0746zz.com All Rights Reserved.永州站长网

站长:xwei067#foxmail.com(请把#换成@)

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息