-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccess-an-ntfs-usb-drive-over-a-samba-share.html
91 lines (75 loc) · 4.43 KB
/
access-an-ntfs-usb-drive-over-a-samba-share.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Access an NTFS USB drive over a Samba share - kb.haeringer.org</title>
<link href="http://fonts.googleapis.com/css?family=Arimo:400,700|Inika" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/theme/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/theme/pastie.css" />
<link href="/" type="application/atom+xml" rel="alternate" title="kb.haeringer.org Atom Feed" />
</head>
<body>
<div class="container">
<div class="row">
<div class="span10">
<div id="content">
<div class="header">
<h1>Access an NTFS USB drive over a Samba share</h1>
</br>
</div>
<p class="meta"><small><span><a href="/author/ben/">ben</a> - </span><span>Do 08 April 2010</span> - <span class="tags"><a href="/tag/SMB/">SMB</a>, <a href="/tag/USB/">USB</a></span></small></p>
<div class="entry-content">
<p>I needed to plug an NTFS formatted USB harddisk into my Debian home server (with Samba
file services already running on it) and access it from my PCs in the network.
To achieve full read/write access for the Windows users, you need the driver NTFS-3G.</p>
<p>Install ntfs-3g</p>
<div class="highlight"><pre><span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">ntfs</span><span class="o">-</span><span class="mi">3</span><span class="n">g</span>
</pre></div>
<p>Create the mointpoint for the NTFS disk, e.g.</p>
<div class="highlight"><pre><span class="n">mkdir</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">usb</span><span class="o">/</span><span class="n">ntfs</span>
</pre></div>
<!--more-->
<p>Add a line to the fstab file ("umask=000" has the effect to allow write
access for all users):</p>
<div class="highlight"><pre><span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdb1</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">usb</span><span class="o">/</span><span class="n">ntfs</span> <span class="n">ntfs</span><span class="o">-</span><span class="mi">3</span><span class="n">g</span> <span class="n">defaults</span><span class="p">,</span><span class="n">rw</span><span class="p">,</span><span class="n">umask</span><span class="o">=</span><span class="mo">000</span> <span class="mi">0</span> <span class="mi">0</span>
</pre></div>
<p>Mount the device:</p>
<div class="highlight"><pre><span class="n">mount</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdb1</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">usb</span><span class="o">/</span><span class="n">ntfs</span>
</pre></div>
<p>I then added an additional share to my Samba smb.conf so I can mount the
USB drive as a separate network drive in Windows:</p>
<div class="highlight"><pre><span class="k">[usb]</span>
<span class="na">comment</span> <span class="o">=</span> <span class="s">USB device connected to server</span>
<span class="s"> path = /mnt/usb/ntfs</span>
<span class="s"> guest ok = yes</span>
<span class="s"> browseable = yes</span>
<span class="s"> read only = no</span>
</pre></div>
</div><!-- /.entry-content -->
</div>
</div>
<div class="span2">
<div class="well">
<ul class="nav nav-list">
<li class="nav-header">Blog</li>
<!-- <li ><a href="">Home</a></li> -->
<li ><a href="index.html">Home</a></li>
<li ><a href="/tags/">Tags</a></li>
<li ><a href="/archives/">Archive</a></li>
<li class="nav-header">Pages</li>
<li><a href="/pages/about.html">About</a></li>
</ul>
</div><!-- /#menu -->
</div>
</div>
<hr />
<div class="row">
<div class="span12">
<div id="about">
<p>Proudly powered by <a href="http://twitter.github.com/bootstrap/">bootstrap</a>, <a href="http://docs.notmyidea.org/alexis/pelican/">pelican</a>, <a href="http://python.org">python</a> and <a href="http://www.julo.ch/about/">Alex</a></p>
</div><!-- /#about -->
</div><!-- /#contentinfo -->
</div>
</div>
</body>
</html>