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