Manually splitting large disks: Difference between revisions

From wiki.zmanda.com
Jump to navigation Jump to search
m (Mention new documentation.)
(space in exclude pattern)
Line 88: Line 88:
  }      2
  }      2


In this example, it is important to notice that each subdirectory is refered to from its immediate parent directory. It doesn't work otherwise. The second thing to know is the usage of the 'exclude append' options. Using
In this example, it is important to notice that each subdirectory is refered to from its immediate parent directory. It doesn't work otherwise.


exclude append "./financial ./reports"
To use many exclude/include arguments on one line, you must put quotes around each argument:


will not work; you will get error messages about a wrong number of arguments in the reports created by [[amreport]] --- probably because of the spaces introduced, so be careful if you encounter directory names that contain spaces. It only works when using an 'exclude append' statement for each path (file, directory) that is to be excluded.
  exclude append "./financial" "./reports"


Otherwise, it works the same way as in the previous example.
Currently (Amanda version 2.4.x and 2.5.0) do not allow spaces in the exclude/include pattern:
 
exclude append "./Documents and Settings"    # Invalid!
 
You'll get an obscure error message about "wrong number of arguments" in that case.
There is no escape character to protect the space.
As workaround you can use wildcards instead:
 
exclude append "./Documents?and?Settings"    # workaround space in pattern


= See also =
= See also =


There are some important notes in the article on [[Exclude and include lists]].
There are some important notes in the article on [[Exclude and include lists]].

Revision as of 09:26, 11 May 2006

Note: This section mostly applies only to version of Amanda before 2.5.0. For more recent versions, see the page on Splitting dumps across tapes.

You may happen to run into the problem of having to back up more data than will fit onto a single tape, like when you have partitions that are much larger as a tape. Over time, the partition will hold more and more data, and if you started with a simple Amanda configuration that backs up the partition as a whole, backups will fail sooner or later. Your shiny tape changer isn't all that helpful with this because Amanda up to version 2.4.x doesn't automagically change to the next tape to continue writing on it if the dump is too large.

Thus, with Amanda < 2.5.0 the need arises to virtually split partitions into parts so that each part remains smaller than a tape. This will lead to smaller single dumps so that Amanda can continue the backup of other dumps on the next tape, if need be. One way to do that is creating appropriate entries in the disklist.

Example

Let's assume that you have two large partitions, holding several directories and subdirectories like the following:

/home/
/home/andrew
/home/anne
/home/brian
[...]
/home/wanda
/home/zeus

/share/
/share/financial
/share/financial/company-a
/share/financial/company-b
/share/reports

You created entries in your disklist to back them up:

largehost /home        my-dumptype
largehost /share       my-dumptype

That worked fine, but now on each of the partitions, there's too much data to fit onto a single tape. You will have to split up the partitions to back them up.

Splitting it up, the easy part

Considering the /home partition, it becomes obvious that you could split it alphabetically. You would create disklist entries to back up each subdirectory by using wildcards. You also want to catch anything under /home that doesn't fit into the wildcard specifications, so there:

largehost /home_a /home {
  my-dumptype
  include "./a*"
}       1
largehost /home_b /home {
  my-dumptype
  include "./b*"
}       1
[...]
largehost /home_w /home {
  my-dumptype
  include "./w*"
}       1
largehost /home_z /home {
  my-dumptype
  include "./z*"
}       1
# catch all the rest of /home:
largehost /home_rest /home {
  my-dumptype
  exclude append "./[a-z]*"
}       1

Notice the use of the 'include' and 'exclude' options. They do what you would guess, i. e. include the files specified, or exclude them. The tricky part is to use different disk names ('/home_a', '/home_b', ...) on the same partition/mount point ('/home'). You can omit specifying the spindle.

Splitting it up, the more complicated part

The /share partition is a little more complicated to split because you have to deal with the subdirectories. We assume that there's so much data in some of the directories that you have to treat them by diving into the subdirectories. You need to catch /share, /share/financial, /share/financial/company-a, /share/financial/company-b and /share/reports:

largehost /share_financial_company-a /share/financial {
  my-dumptype
  include "./company-a"
}       2
largehost /share_financial_company-b /share/financial {
  my-dumptype
  include "./company-b"
}       2
largehost /share_financial_rest /share/financial {
  my-dumptype
  exclude append "./company-a"
  exclude append "./company-b"
}       2
#
largehost /share_reports /share {
  my-dumptype
  include "./reports"
}       2
#
largehost /share_rest /share {
  my-dumptype
  exclude append "./financial"
  exclude append "./reports"
}       2

In this example, it is important to notice that each subdirectory is refered to from its immediate parent directory. It doesn't work otherwise.

To use many exclude/include arguments on one line, you must put quotes around each argument:

exclude append "./financial" "./reports"

Currently (Amanda version 2.4.x and 2.5.0) do not allow spaces in the exclude/include pattern:

exclude append "./Documents and Settings"    # Invalid!

You'll get an obscure error message about "wrong number of arguments" in that case. There is no escape character to protect the space. As workaround you can use wildcards instead:

exclude append "./Documents?and?Settings"    # workaround space in pattern

See also

There are some important notes in the article on Exclude and include lists.