Tuesday, November 27, 2012

How to map a Windows share folder on Linux

- Create the required mount point:

[root@erpapp1 ~]# mkdir /mnt/TimeSheets
[root@erpapp1 ~]#

[root@erpapp1 ~]# cd /mnt/TimeSheets
[root@erpapp1 TimeSheets]#


- Get the UID for the user who will own the shared files:

[root@erpapp1 /]# id apstage1
uid=500(apstage1) gid=54326(dba) groups=54326(dba),54321(oinstall)
[root@erpapp1 /]#



Windows machine: file-server
Windows shared folder: TimeSheets 
Linux mount point: /mnt/TimeSheets
local user (uid=500) will become the owner of the mounted files.


[root@erpapp1 ~]# cat /root/smblogin.txt
username=rsteel/erp.auto
password=ERP112233
[root@erpapp1 ~]# 

where:
Domain Name: rsteel
Windows User Name: erp.auto
Windows user passwd: ERP112233


***********************
***********************
*** Once you mounted the folder, you can remove your password from smblogin.txt
***********************
***********************

[root@erpapp1 mnt]# diff /etc/fstab /etc/fstab_25Nov2012
10d9
\\file-server\TimeSheets /mnt/TimeSheets cifs credentials=/root/smblogin.txt,uid=500,user 0 0
[root@erpapp1 mnt]#


[root@erpapp1 TimeSheets]# mount /mnt/TimeSheets
[root@erpapp1 TimeSheets]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p3      19G   16G  2.9G  85% /
/dev/cciss/c0d0p6     209G  174G   25G  88% /home
/dev/cciss/c0d0p5      15G  4.5G  9.1G  33% /usr
/dev/cciss/c0d0p1      99M   25M   69M  27% /boot
tmpfs                 7.7G   16M  7.7G   1% /dev/shm
//file-server/test    420G  129G  291G  31% /mnt/TimeSheets
[root@erpapp1 TimeSheets]#

[root@erpapp1 TimeSheets]# cd /mnt/TimeSheets
[root@erpapp1 TimeSheets]# ls
setup.msi
[root@erpapp1 TimeSheets]#



Regards,
Mohamed

No comments:

Post a Comment