Howto mount Windows share on Centos 6.3 or Redhat RHEL

Howto mount Windows share on Centos 6.3 or Redhat RHEL

 

1. Share one folder name Software on Windows (192.168.0.103) with username kevin

2. On Centos , mount that share folder to mnt folder on Server

[root@localhost ~]# mount -t cifs -o username=kevin,password=Passw0rd //192.168. 0.103/Software /mnt

3. Now we can use that folder as our local disk

[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 13G 2.5G 9.5G 21% /
tmpfs 495M 100K 495M 1% /dev/shm
/dev/sda1 291M 33M 244M 12% /boot
//192.168.0.103/Software
196G 32G 164G 17% /mnt
[root@localhost ~]#

4. If you want to keep the mount when server reboots, we have to add to fstab file

[root@localhost ~]# cat /etc/fstab
# /etc/fstab
# Created by anaconda on Fri Jan 4 10:36:43 2013
#
# 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=5239d6c9-2742-4a94-b628-f71e0e442ea7 / ext4 defaults 1 1
UUID=3bbdbf55-e9e1-4d5c-a18f-941aa122a7a9 /boot ext4 defaults 1 2
UUID=3eb80b0d-6b3d-4ea7-b5a6-d410cd987d26 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
//192.168.0.103/Software /mnt cifs username=kevin,password=Passw0rd 0 0
[root@localhost ~]#
[root@localhost ~]# init 6
login as: root
root@192.168.0.108’s password:
Last login: Thu Jan 10 04:54:07 2013 from 192.168.0.103
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 13G 2.5G 9.5G 21% /
tmpfs 495M 88K 495M 1% /dev/shm
/dev/sda1 291M 33M 244M 12% /boot
//192.168.0.103/Software
196G 32G 164G 17% /mnt
[root@localhost ~]#

That’s all. Thanks for using IThelpblog.com.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>