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