Imported Upstream version 2.4.4p3
[debian/amanda] / docs / SAMBA
1 Notes for adding PC hosts to the Amanda backup system.
2
3 ============
4 Installation
5 ============
6
7 Amanda is able to back up Microsoft Windows shared disks by using Samba,
8 a package that implements a SMB client and server for Unix:
9
10   http://www.samba.org
11
12 Releases from 1.9.18p5 up to 1.9.18p10 logged information in the tar
13 files produced, making them unusable!  If you really must use a release
14 prior to Samba 2.0.6, a patch that fixes the problem is available in
15 the Amanda patches page:
16
17   http://www.amanda.org/patches.html
18
19 Amanda no longer supports Samba releases prior to 1.9.18.  If you're
20 using Samba from 1.9.18 through 1.9.18p3, make sure you don't set a low
21 logging/debugging level in smb.conf.  This flag may prevent estimate
22 sizes from printing correctly and Amanda will report an estimate failure.
23
24 This problem may also occur if you have large (>2GB) shares with Samba
25 prior to 2.0.4.  In this case, apply samba-largefs.patch from the Amanda
26 patches page.
27
28 After building and installing samba with the selected patches, Amanda
29 must be configured with smbclient support.  Amanda will automatically
30 find smbclient if it is in your PATH when you run configure, or you may
31 add the following argument:
32
33   --with-smbclient=/full/path/to/smbclient
34
35 =====
36 Setup
37 =====
38
39 Once Amanda and Samba are installed, the only difference between a Unix
40 client/disk and PC client/share is in how the backup disks are specified
41 in the disklist file.  For each PC share, the entry lists the 'samba
42 server' host (where the patched Samba software is installed) and the
43 disk field is the share name.  The remaining fields are like any other
44 disklist entry.
45
46 A user must be created on the PC with full access rights (read/write)
47 to the share.  Amanda, via the Samba server, will connect to the PC via
48 this user.  If the user does not have full access, incremental backups
49 will not work and the whole share will be backed up every time (Archive
50 bits are never reset).
51
52 File /etc/amandapass must be created by hand.  It contains share name
53 to user name, password and workgroup mapping.  Each line consists of two
54 or three whitespace separated fields:
55
56   * Share name followed by optional directory.
57   
58     Must use forward slashes (/), not backslashes (\).
59
60     Must match the disklist entry exactly (case sensitive).
61
62     May be asterisk (*) to match all remaining shares for this Samba
63     server.  The first match in the file is used, so specific entries
64     must be listed first.
65
66     The directory is appended to the share name as full M$ network path.
67     Like //thepc/c$/mydir . No blanks in directory!
68
69   * User name and password.
70
71     Separated by a percent sign (%).  See the description of the -U
72     option to smbclient.
73
74     No whitespace allowed in either the user name or password.
75
76   * Workgroup (optional).
77
78 This file must be owned by the amanda user, and disallow world access
79 privileges.  Blank lines are ignored.  A '#' on a line at the start of a
80 field (including start of line) causes the rest of the line to be ignored.
81
82 =======
83 Example
84 =======
85
86 The Amanda client software and patched Samba is installed on host
87 'pcserver'.  A share to be backed up called 'backupc' is on PC 'thepc'.
88 The share will be accessed via PC user 'bozo' and password 'f00bar'
89 and does not require a workgroup.
90
91 The entry in the disklist file is:
92
93 pcserver        //thepc/backupc         nocomp-user-gnutar
94
95 ^ samba installed unix host
96                 ^ pc host and share name
97                                         ^ dumptype must include the tar option
98
99 In /etc/amandapass on the machine 'pcserver':
100
101 //thepc/backupc         bozo%f00bar
102
103 If smbclient requires a workgroup specification (-W), you may add it as
104 a third argument in /etc/amandapass line:
105
106 //thepc/backupc         bozo%f00bar     NTGROUP
107
108 This will cause smbclient to be invoked with -W NTGROUP.
109
110 An example dumptype in amanda.conf would be:
111
112 define dumptype nocomp-user-gnutar {
113     program "GNUTAR"
114     comment "user partitions dumped with tar and no compression"
115     options no-compress
116     priority medium
117 }
118
119 Essentially, the disklist entry is a 'pseudo-disk' which contains all the
120 relevant information needed by the smbclient program to backup the disk,
121 but in an Amanda compatible way.
122
123 Amcheck does a quick check to see if smbclient exists and tries to connect
124 to the PC clients.  It also checks for the existence and permissions of
125 /etc/amandapass.
126
127 ==============
128 Bugs and notes
129 ==============
130
131 Samba will not back up open files (such as PAGEFILE.SYS and registry
132 files) nor Access Control List data.  Furthermore, at restore time,
133 smbclient is unable to overwrite read-only files.  Hence, Amanda+Samba is
134 not a perfect solution for backing up (restoring, actually) system disks.
135
136 Samba does not use the Windows Backup API, so configuring the Amanda
137 backup user as a member of group backup on the Windows host is useless.
138 You will probably have to configure it as an Administrator, and make
139 sure it can read and change permission of *all* files in the share.
140
141 It seems impossible to detect when a per-user based login fails, e.g. the
142 username doesn't have sufficient access.  It connects but cannot see any
143 files (e.g. backups do nothing).  The selfcheck code isn't particularly
144 robust in this area either, so you may get no warnings when a disk isn't
145 being backed up.  Just check to see that level 0 dumps are bigger than
146 64K, otherwise it means the backup was empty.
147
148 The estimate and totals are probably a bit off since tar pads to the
149 nearest 512 bytes after each file (i think).  Not sure how much of a
150 problem this is.
151
152 Smbclient only supports excluding a single file from the command line,
153 not a file of patterns like GNU tar.  So "exclude" is supported from a
154 dumptype but not "exclude list".
155
156 The size estimate calculation does not use the same method as the
157 dump, so it may be inaccurate.  It also does not support any type of
158 exclusion ("exclude" is ignored).  Things are done this way because
159 doing a simulated dump to /dev/null, like other dump programs, would
160 take forever with current implementations of Samba.
161
162 If you compile with smbclient support, gnutar support is automatically
163 enabled.  If you aren't using the gnutar part, you may get warnings
164 about the availability of /usr/local/bin/gtar (or whatever it was
165 compiled with).  These may safely be ignored, unless you enable index
166 generation for those filesystems.
167
168 Original text by:
169 Michael Zucchi
170 School of Computer and Information Science
171 University of South Australia
172 M.Zucchi@CIS.UniSA.Edu.Au
173
174 Updated by:
175 John R. Jackson
176 Purdue University Computing Center
177 jrj@purdue.edu