How To:Backup to Virtual Tapes on a non-UNIX Filesystem: Difference between revisions
m (→Setup) |
(Storing vtapes on Samba shares and CIFS which may not have symbolic links) |
||
Line 3: | Line 3: | ||
== Introduction == | == Introduction == | ||
Amanda has the ability to use a harddisk to store the contents of backups onto virtual tapes (vtapes) using the [[file driver]]. The vtapes can be located on any filesystem, even a remote one | Amanda has the ability to use a harddisk to store the contents of backups onto virtual tapes (vtapes) using the [[file driver]]. The vtapes can be located on any filesystem, even a remote one. | ||
If you are following the instructions under '''Using chg-disk''' in [[How To:Set Up Virtual Tapes]] and get to the point where you run | |||
$ ln -s slot1 data | |||
and get | |||
ln: creating symbolic link `data': Operation not supported | |||
you likely are trying to put your virtual tapes (vtapes) on a file system that does not support symbolic links. Unlike the chg-multi changer script, chg-disk uses a symbolic link to point to the currently active slot of your virtual tape changer. If you can't create the link above, neither can Amanda. | |||
A common example of this is using CIFS to store our vtapes on a Windows machine. This is not specific to Windows, many [http://en.wikipedia.org/wiki/Network-attached_storage NAS] devices support CIFS. | |||
The best way to solve this would be to change anything concerning the share or file system that would permit symbolic links. If using NAS, it may be as simple as checking a check box on the server side. On the client side, it may be possible to mount the share or file system with certain options to allow symbolic linking. | |||
If creating symbolic links within the share or file system you want to use is not an option, below is a way to work around it. Another way would be to use the chg-multi changer script instead of chg-disk. For full details this and setting up vtapes, please see [[How To:Set Up Virtual Tapes]]. | |||
== Setup == | |||
1. If it does not already exist, create the directory space on your non-symlink-supporting share or file system where the vtapes will actually be saved. If the full share is writable by the Amanda user, you can simply create this directory as this user. | |||
-bash-3.00$ '''mkdir -p /mnt/samba/vtapes/DailySet1''' | |||
If you must be root to create this directory, make sure to set proper permissions for your Amanda user: | |||
[root:/]# '''mkdir -p /mnt/samba/vtapes/DailySet1''' | |||
[root:/]# '''chown amandabackup:disk /mnt/samba/vtapes/DailySet1''' | |||
[root:/]# '''chmod 750 /mnt/samba/vtapes/DailySet1''' | |||
2. Create a virtual slot directory for every vtape you will be using (in this example, 15 tapes). As the Amanda user | |||
. | -bash-3.00$ '''mkdir /mnt/samba/vtapes/DailySet1/slots''' | ||
-bash-3.00$ '''cd /mnt/samba/vtapes/DailySet1/slots''' | |||
-bash-3.00$ '''for ((i=1; $i<=15; i++)); do mkdir slot$i; done''' | |||
3. On an available file system that supports symbolic linking, create a directory structure for vtapes and use this directory as the file driver for the ''tapedev'' parameter in your ''amanda, conf'', for ex. '''tapedev file:/var/lib/amanda/vtapes/DailySet1'''. The vtape directory will result in a small directory structure containing links and will require very little space of the file system (a few Kb). You can create this right in your Amanda user's home directory, for instance. | |||
As the Amanda user, create a directory for vtapes for your backup configuration | |||
[amandabackup~]$ '''mkdir -p /var/lib/amanda/vtapes/DailySet1''' | |||
If you create this in a place that requires root permission, make sure you set proper permissions for the new directory for your Amanda user | |||
[root:/]# '''mkdir -p /var/lib/amanda/vtapes/DailySet1''' | |||
[root:/]# '''chown amandabackup:disk /var/lib/amanda/vtapes/DailySet1''' | |||
[root:/]# '''chmod 750 /var/lib/amanda/vtapes/DailySet1''' | |||
4. Enter this directory and create the links to the virtual slots in '''/var/lib/amanda/vtapes/DailySet1/slots''' as the Amanda user: | |||
-bash-3.00$ '''cd /var/lib/amanda/vtapes/DailySet1''' | |||
-bash-3.00$ '''for ((i=1; $i<=15; i++)); do ln -s /mnt/samba/vtapes/DailySet1/slots/slot$i slot$i; done''' | |||
-bash-3.00$ '''ln -s slot1 data''' | |||
-bash-3.00$ '''ls -al''' | |||
lrwxrwxrwx 1 amandabackup disk 5 Jun 15 11:27 data -> slot1 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot1 -> /mnt/samba/vtapes/DailySet1/slots/slot1 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot2 -> /mnt/samba/vtapes/DailySet1/slots/slot2 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot3 -> /mnt/samba/vtapes/DailySet1/slots/slot3 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot4 -> /mnt/samba/vtapes/DailySet1/slots/slot4 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot5 -> /mnt/samba/vtapes/DailySet1/slots/slot5 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot6 -> /mnt/samba/vtapes/DailySet1/slots/slot6 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot7 -> /mnt/samba/vtapes/DailySet1/slots/slot7 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot8 -> /mnt/samba/vtapes/DailySet1/slots/slot8 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot9 -> /mnt/samba/vtapes/DailySet1/slots/slot9 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot10 -> /mnt/samba/vtapes/DailySet1/slots/slot10 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot11 -> /mnt/samba/vtapes/DailySet1/slots/slot11 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot12 -> /mnt/samba/vtapes/DailySet1/slots/slot12 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot13 -> /mnt/samba/vtapes/DailySet1/slots/slot13 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot14 -> /mnt/samba/vtapes/DailySet1/slots/slot14 | |||
lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot15 -> /mnt/samba/vtapes/DailySet1/slots/slot15 | |||
5. You can now label the tapes to be used by Amanda as the Amanda user: | |||
-bash-3.00$ '''for ((i=1; $i<=9; i++)); do amlabel DailySet1 DailySet1-0$i slot $i; done''' | |||
labeling tape in slot 1 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-01, checking label, done. | |||
labeling tape in slot 2 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-02, checking label, done. | |||
labeling tape in slot 3 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-03, checking label, done. | |||
labeling tape in slot 4 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-04, checking label, done. | |||
labeling tape in slot 5 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-05, checking label, done. | |||
labeling tape in slot 6 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-06, checking label, done. | |||
labeling tape in slot 7 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-07, checking label, done. | |||
labeling tape in slot 8 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-08, checking label, done. | |||
labeling tape in slot 9 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-09, checking label, done. | |||
-bash-3.00$ '''for ((i=10; $i<=15; i++)); do amlabel DailySet1 DailySet1-$i slot $i; done''' | |||
labeling tape in slot 10 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-10, checking label, done. | |||
labeling tape in slot 11 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-11, checking label, done. | |||
labeling tape in slot 12 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-12, checking label, done. | |||
labeling tape in slot 13 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-13, checking label, done. | |||
labeling tape in slot 14 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-14, checking label, done. | |||
labeling tape in slot 15 (file://var/lib/amanda/vtapes/DailySet1): | |||
rewinding, reading label, not an amanda tape (Read 0 bytes) | |||
rewinding, writing label DailySet1-15, checking label, done. | |||
== Performance == | == Performance == |
Revision as of 02:11, 12 November 2008
This article is a part of the How Tos collection.
Introduction
Amanda has the ability to use a harddisk to store the contents of backups onto virtual tapes (vtapes) using the file driver. The vtapes can be located on any filesystem, even a remote one.
If you are following the instructions under Using chg-disk in How To:Set Up Virtual Tapes and get to the point where you run
$ ln -s slot1 data
and get
ln: creating symbolic link `data': Operation not supported
you likely are trying to put your virtual tapes (vtapes) on a file system that does not support symbolic links. Unlike the chg-multi changer script, chg-disk uses a symbolic link to point to the currently active slot of your virtual tape changer. If you can't create the link above, neither can Amanda.
A common example of this is using CIFS to store our vtapes on a Windows machine. This is not specific to Windows, many NAS devices support CIFS.
The best way to solve this would be to change anything concerning the share or file system that would permit symbolic links. If using NAS, it may be as simple as checking a check box on the server side. On the client side, it may be possible to mount the share or file system with certain options to allow symbolic linking.
If creating symbolic links within the share or file system you want to use is not an option, below is a way to work around it. Another way would be to use the chg-multi changer script instead of chg-disk. For full details this and setting up vtapes, please see How To:Set Up Virtual Tapes.
Setup
1. If it does not already exist, create the directory space on your non-symlink-supporting share or file system where the vtapes will actually be saved. If the full share is writable by the Amanda user, you can simply create this directory as this user.
-bash-3.00$ mkdir -p /mnt/samba/vtapes/DailySet1
If you must be root to create this directory, make sure to set proper permissions for your Amanda user:
[root:/]# mkdir -p /mnt/samba/vtapes/DailySet1 [root:/]# chown amandabackup:disk /mnt/samba/vtapes/DailySet1 [root:/]# chmod 750 /mnt/samba/vtapes/DailySet1
2. Create a virtual slot directory for every vtape you will be using (in this example, 15 tapes). As the Amanda user
-bash-3.00$ mkdir /mnt/samba/vtapes/DailySet1/slots -bash-3.00$ cd /mnt/samba/vtapes/DailySet1/slots -bash-3.00$ for ((i=1; $i<=15; i++)); do mkdir slot$i; done
3. On an available file system that supports symbolic linking, create a directory structure for vtapes and use this directory as the file driver for the tapedev parameter in your amanda, conf, for ex. tapedev file:/var/lib/amanda/vtapes/DailySet1. The vtape directory will result in a small directory structure containing links and will require very little space of the file system (a few Kb). You can create this right in your Amanda user's home directory, for instance. As the Amanda user, create a directory for vtapes for your backup configuration
[amandabackup~]$ mkdir -p /var/lib/amanda/vtapes/DailySet1
If you create this in a place that requires root permission, make sure you set proper permissions for the new directory for your Amanda user
[root:/]# mkdir -p /var/lib/amanda/vtapes/DailySet1 [root:/]# chown amandabackup:disk /var/lib/amanda/vtapes/DailySet1 [root:/]# chmod 750 /var/lib/amanda/vtapes/DailySet1
4. Enter this directory and create the links to the virtual slots in /var/lib/amanda/vtapes/DailySet1/slots as the Amanda user:
-bash-3.00$ cd /var/lib/amanda/vtapes/DailySet1 -bash-3.00$ for ((i=1; $i<=15; i++)); do ln -s /mnt/samba/vtapes/DailySet1/slots/slot$i slot$i; done -bash-3.00$ ln -s slot1 data -bash-3.00$ ls -al lrwxrwxrwx 1 amandabackup disk 5 Jun 15 11:27 data -> slot1 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot1 -> /mnt/samba/vtapes/DailySet1/slots/slot1 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot2 -> /mnt/samba/vtapes/DailySet1/slots/slot2 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot3 -> /mnt/samba/vtapes/DailySet1/slots/slot3 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot4 -> /mnt/samba/vtapes/DailySet1/slots/slot4 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot5 -> /mnt/samba/vtapes/DailySet1/slots/slot5 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot6 -> /mnt/samba/vtapes/DailySet1/slots/slot6 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot7 -> /mnt/samba/vtapes/DailySet1/slots/slot7 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot8 -> /mnt/samba/vtapes/DailySet1/slots/slot8 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot9 -> /mnt/samba/vtapes/DailySet1/slots/slot9 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot10 -> /mnt/samba/vtapes/DailySet1/slots/slot10 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot11 -> /mnt/samba/vtapes/DailySet1/slots/slot11 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot12 -> /mnt/samba/vtapes/DailySet1/slots/slot12 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot13 -> /mnt/samba/vtapes/DailySet1/slots/slot13 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot14 -> /mnt/samba/vtapes/DailySet1/slots/slot14 lrwxrwxrwx 1 amandabackup disk 40 Jun 15 11:26 slot15 -> /mnt/samba/vtapes/DailySet1/slots/slot15
5. You can now label the tapes to be used by Amanda as the Amanda user:
-bash-3.00$ for ((i=1; $i<=9; i++)); do amlabel DailySet1 DailySet1-0$i slot $i; done labeling tape in slot 1 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-01, checking label, done. labeling tape in slot 2 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-02, checking label, done. labeling tape in slot 3 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-03, checking label, done. labeling tape in slot 4 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-04, checking label, done. labeling tape in slot 5 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-05, checking label, done. labeling tape in slot 6 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-06, checking label, done. labeling tape in slot 7 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-07, checking label, done. labeling tape in slot 8 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-08, checking label, done. labeling tape in slot 9 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-09, checking label, done. -bash-3.00$ for ((i=10; $i<=15; i++)); do amlabel DailySet1 DailySet1-$i slot $i; done labeling tape in slot 10 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-10, checking label, done. labeling tape in slot 11 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-11, checking label, done. labeling tape in slot 12 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-12, checking label, done. labeling tape in slot 13 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-13, checking label, done. labeling tape in slot 14 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-14, checking label, done. labeling tape in slot 15 (file://var/lib/amanda/vtapes/DailySet1): rewinding, reading label, not an amanda tape (Read 0 bytes) rewinding, writing label DailySet1-15, checking label, done.
Performance
Performance using CIFS via Samba is known to be poorer than protocols such as FTP, HTTP and even CIFS on Windows. This is apparently due to Samba not using asynchronous writes, so each write has to be acknowledged by the server before the next one can take place.
Before deciding to use CIFS it would be advisable to test the speed of a transfer to a CIFS mount from your amanda server. Although bandwidth is an issue, latency also plays a big part.
More research on increasing performance is done and the results will be posted here.