Wednesday, January 1, 2014

mont /etc/fstab on ubuntu 13.04

Add scrip mount network For ubuntu 13.04

-----------------/etc/fstab-----------------
//192.168.x.xx/Market /media/Market    cifs user=user01,passwd=user001,uid=1000,gid=1000
--------------////------------------------------

------------------------------------------------------------
ใช้คำสั่ง dmesg | tail เพื่อตรวจสอบหาปัญหาทำไมไม่สามารถ mount path share file windows 2000 with CentOs 8 จะได้ Error: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.

การทำ Mount Drive ในกรณีที่เครื่อง Windows 2000 SMBv1 แต่เครื่อง Linux Server รุ่นใหม่(SMBv2,3) ไม่ Support SMBv1 ซึ่งเป็น Version เก่า

Allowed SMB protocol version values are:
  • 1.0 - The classic CIFS/SMBv1 protocol. This was the default.
  • 2.0 - The SMBv2.002 protocol. This was initially introduced in Windows Vista Service Pack 1, and Windows Server 2008. Note that the initial release version of Windows Vista spoke a slightly different dialect (2.000) that is not supported.
  • 2.1 - The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.
  • 3.0 - The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.

แก้ไข /etc/fstab

//172.16.0.xx/Sharefile /mnt/sharefile cifs user,uid=1000,rw,suid,username=user03,password=user003,iocharset=utf8,vers=1.0 0 0

เสร็จแล้วรันคำสั่ง
mount -a
ยกเลิกการ mount
umount /mnt/sharefie

-------------------------------------------------------------------------

การสร้างสคริป Mount Drive แบบอัตโนมัติ

vim /root/mapdrive.sh
-----------------------Start Script---------------------------------
mount -o username=user,password=xxxx,uid=1000,gid=1000 //192.168.1.10/public/share /media/support/share

------------------------End script----------------------------------

Run Script

sudo vim /etc/rc.local --> แอดสคริปให้ทำงานทุกคร้้งตอนเปิดเครื่อง
---------------------------------
# By default this script does nothing.
/root/mapdrive.sh
----------------------------------------

No comments: