I have noticed and I am running the latets container now, and vchanger seems to work. Let me run it for some more days, and I will give you a notice whether it is running solidly.
As for instructions: the vChanger documentation is pretty good and it explains well what to do, and there is a mailing list where the author helps out. I made a short tutorial how to configure it with USB drives:
## Docker
- map USB mass storage folders to the following pathes in the bacula container:
- `/mnt/usb0`
- `/mnt/usb1`
- `/mnt/usb2`
- etc.
## vChanger
```
#/opt/bacula/etc/vchanger1.conf
#
bconsole = "/usr/bin/bconsole"
bconsole config = "/opt/bacula/etc/bconsole.conf"
User = "bacula"
Group = "tape"
#
Storage Resource = "usb-storage"
Log level = 7
Logfile = "/opt/bacula/log/vchanger/vchanger1.log"
Work Dir = "/opt/bacula/working/vchanger/vchanger1"
Default Pool = "Scratch"
Magazine = "/mnt/usb0"
Magazine = "/mnt/usb1"
Magazine = "/mnt/usb2"
#
#eof
```
## Dir
```
Storage {
Name = "usb-storage"
Description = "USB storage"
Device = "vchanger1"
MediaType = "usb-file"
Autochanger = "usb-storage"
}
```
## SD
```
Autochanger {
Name = "vchanger1"
Description = "vChanger for USB mass storage devices"
Device = "vchgr1-mag0"
Device = "vchgr1-mag1"
Device = "vchgr1-mag2"
ChangerDevice = "/opt/bacula/etc/vchanger1.conf"
ChangerCommand = "/usr/local/bin/vchanger %c %o %S %a %d"
}
Device {
Name = "vchgr1-mag0"
Description = "USB device FS 1"
MediaType = "usb-file"
DeviceType = "File"
ArchiveDevice = "/opt/bacula/working/vchanger/vchanger1/0"
RemovableMedia = no
RandomAccess = yes
LabelMedia = yes
Autochanger = yes
DriveIndex = 0
}
Device {
Name = "vchgr1-mag1"
Description = "USB device FS 2"
MediaType = "usb-file"
DeviceType = "File"
ArchiveDevice = "/opt/bacula/working/vchanger/vchanger1/1"
RemovableMedia = no
RandomAccess = yes
LabelMedia = yes
Autochanger = yes
DriveIndex = 1
}
Device {
Name = "vchgr1-mag2"
Description = "USB device FS 3"
MediaType = "usb-file"
DeviceType = "File"
ArchiveDevice = "/opt/bacula/working/vchanger/vchanger1/2"
RemovableMedia = no
RandomAccess = yes
LabelMedia = yes
Autochanger = yes
DriveIndex = 2
}
```
# Operation
- vChanger CANNOT create volumes automatically, you MUST create them manually
- compute how many volumes may fit on a USB filesystem depending on the maximum volume size defined -> `<num-vols>`
- create an according number of volumes on the USB filesystem (e.g. `/mnt/usb0` is disk 0, -> `<disk> is 0`), run the `vchanger` command on the console of the container
- `vchanger -u bacula -g tape /opt/bacula/etc/vchanger1.conf createvols <disk> <num-vols>`
- if the currently used disk is not full, create more new empty volumes
- if the currently used disk is full, create volumes on the next empty disk