ย้ายจาก samba ไป nfs สำหรับ dosemu (ro)

การใช้งาน samba กับ dosemu พบว่าตั้งแต่ samba รุ่น 3.0.27 เป็นต้นมา สำหรับแชร์ที่เป็นแบบอ่านเขียน มีการล็อคเรคอร์ดที่ดีขึ้น ด้วยพารามิเตอร์ directio

แต่สำหรับแชร์ที่เป็นแบบอ่านอย่างเดียว พบว่ามีปัญหามาก เพราะถึงแม้ว่าเราจะกำหนดให้เป็นแบบอ่านอย่างเดียว แต่เขาไม่ยอมให้เปิดไฟล์ซ้ำ

อย่ากระนั้นเลย เนื่องจากเป็นแบบอ่านอย่างเดียว เราไม่จำเป็นต้องทำเรื่องล็อคเรคอร์ด ขอย้ายมาใช้ nfs เลยดีกว่า

ที่เซิร์ฟเวอร์

ติดตั้ง

# aptitude install nfs-common nfs-kernel-server

ทำการแชร์ สมมุติว่าจะแชร์ไดเรกทอรีชื่อ /samba/app ให้เป็นแบบอ่านอย่างเดียว โดยให้ทุกเครื่องในวงภายในคือ 192.168.*.* สามารถใช้งานได้

# vi /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#       to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes  gss/krb5i(rw,sync)
#
/samba/app   192.168.0.0/16(ro)

เริ่ม nfs ใหม่

# /etc/init.d/nfs-kernel-server restart

เสร็จแล้ว

ที่เครื่องลูกข่าย

ติดตั้ง

$ sudo aptitude install nfs-client

เมานต์ สมมุติว่าเซิร์ฟเวอร์ชื่อ server1 และจะเมานต์ไปที่ /mnt/app

$ sudo mount -t nfs server1:/samba/app /mnt/app

ใช้งานได้แล้ว

อ้างอิง

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <blockquote> <img> <h3> <h4> <h5>
  • Lines and paragraphs break automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.