天天看點

挂載WINDOWS共享目錄

1、建立需要挂載的目錄 mkdir /mnt/backup

2、手動:mount -t cifs //172.16.15.51/bakcup /mnt/backup -o username=administrator,password=hbjh@2015

3、自動連接配接windows共享目錄

   修改/etc/fstab配置檔案

[root@ntp-server1 ~]# vim /etc/fstab

#

# /etc/fstab

# created by anaconda on mon feb 22 16:31:18 2016

# 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

uuid=a3f0bca3-562f-49cf-999b-24330141317e /                       ext4    defaults        1 1

uuid=964f9756-95a4-409f-9c1f-2147efd7b948 /boot                   ext4    defaults        1 2

uuid=d24a3d1c-3a10-4ddd-b96a-1d34d00963e3 swap                    swap    defaults        0 0

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

//172.16.15.51/bakcup   /mnt/backup             cifs            auto,username=administrator,password=hbjh@2015 0         0  #增加windows共享目錄

挂載的磁盤              挂載點                  檔案系統類型    挂載的選項                                     備份    磁盤檢查  

4、 驗證挂載是否正确:df -h

[root@ntp-server1 ~]# df -h

filesystem             size  used avail use% mounted on

/dev/sda3              6.7g  1.5g  4.9g  24% /

tmpfs                  494m     0  494m   0% /dev/shm

/dev/sda1              194m   29m  155m  16% /boot

//172.16.15.51/bakcup  411g  339g   72g  83% /mnt/backup    #windows挂載正常啟動

5、進入目錄檢查檔案

[root@ntp-server1 ~]# cd /mnt/backup

[root@ntp-server1 backup]# ll

total 12772148

drwxr-xr-x. 0 root root          0 sep 16 17:06 adobe acrobat 10 pro

-rwxr-xr-x. 0 root root 4467982336 may  8  2015 centos-6.5-x86_64-bin-dvd1.iso

-rwxr-xr-x. 0 root root 3368962048 sep 10 13:29 cn_windows_server_2008_r2_standard_enterprise_datacenter_and_web_with_sp1_vl_build_x64_dvd_617396.iso

-rwxr-xr-x. 0 root root  134182051 aug  6  2014 dc3.1_build37.tgz

-rwxr-xr-x. 0 root root       4575 jun 30  2015 dewly.pfx

-rwxr-xr-x. 0 root root   19065016 oct 10 10:15 duba150921_v2015.3.3_setup.1442888834.exe

-rwxr-xr-x. 0 root root    5406720 oct 10 10:33 flashplayer_19_ax_debug_v19.0.0.185.1443174221.exe.dx5y7dw.partial

drwxr-xr-x. 0 root root          0 sep 16 17:06 heu_kms_activator_v7.8.6

drwxr-xr-x. 0 root root          0 jan 14 15:55 hp_ljm1130_m1210_full_solution

-rwxr-xr-x. 0 root root 4817616896 jun 24  2015 mu_exchange_server_2013_with_sp1_x64_dvd_4059293(1).iso

-rwxr-xr-x. 0 root root  261802911 feb  2  2015 nsdc_pre_install.tgz

drwxr-xr-x. 0 root root          0 jan 21 17:53 open×××2310

drwxr-xr-x. 0 root root          0 nov  7 00:14 open×××-2.3.8

drwxr-xr-x. 0 root root          0 dec  1 10:48 open×××-user

drwxr-xr-x. 0 root root          0 sep 17 17:40 putty-v0.63

drwxr-xr-x. 0 root root          0 sep 16 17:06 synctoysetuppackage_v21_x64

-rwxr-xr-x. 0 root root    3632112 dec 24  2014 synctoysetuppackage_v21_x64.rar

-rwxr-xr-x. 0 root root       4687 jul  7  2015 totakeawife.pfx

drwxr-xr-x. 0 root root          0 sep 16 17:06 zabbix_2.4_x86_64_13.1.x86_64-2.4.1.vhd

[root@ntp-server1 backup]#

繼續閱讀