-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi spadajspadaj,

I never came back to say "thanks", so here you go:
Thank you!

On Wed, 22 Apr 2020, Spadajspadaj wrote:

Firstly I must say that for me it was essential to have a removable storage.
This is my home backup setup so I'm backing up to a usb-attached disks. I
have a single USB-SATA cradle in which I'm simply changing disks so I needed
a low-effort solution that I could easily keep some backups offline. I'm not
sure how it would work with a permanently attached storage.

I used a howto as reference but I see that it's no longer available. Maybe
it's permanent, maybe not. Anyway, for reference, the howto used to be here
http://www.revpol.com/offsitebackups

Having said that, here goes my setup (on CentOS if it has any significance).

First element of the config is the automount setup.

/etc/auto.master:
+dir:/etc/auto.master.d
+auto.master
/srv/backupstor /etc/auto.master.d/auto.vchanger --timeout=30

/etc/auto.master.d/auto.vchanger:
* -fstype=auto,rw :/dev/disk/by-uuid/&

With this setup I can just do a cd /srv/backupstor/UUID and the automounter
should mount the drive if I know the UUID (easily obtainable by blkid).

So in case of:

blkid /dev/sda1

/dev/sda1: UUID="7B06F568090A6704" TYPE="ntfs" PTTYPE="dos"
PARTUUID="aae626c7-da6c-4707-8c91-0cb52703893c"

I just do cd /srv/backupstor/7B06F568090A6704 and am in the partition's root
directory (regardless of the filesystem type - in this case it's NTFS).


I obviously skipped the automount part (my disks are spinning 24/7), but the vchanger config really got me started - so far, it looks, like it's all perfect. Now, I only need to fully understand, what I configured there ;-) (and especially, what I was doing wrong before).


Second part is the vchanger setup

/etc/vchanger/vchanger.conf:

Storage Resource = vchanger-1
User = bareos
Group = bareos
Logfile = /var/log/vchanger/vchanger-1.log
Work Dir = /var/spool/vchanger/vchanger-1
Log Level = 7
Magazine = /srv/backupstor/bde48cec-03db-4f36-bb68-dbd14455b700
Magazine = /srv/backupstor/7B06F568090A6704
Magazine = /srv/backupstor/46786fd5-4bc4-4799-aaa4-a7459bc5b603
Magazine = /srv/backupstor/881564a0-63db-4e49-8f31-9a4ccd7d5d22
bconsole config = /etc/bareos/bconsole.conf

Here you can see that I'm using four different disks in rotation.

If I remember correctly, I had to do some file rights sanitization on
logfile and work dir.

yes, `chown bareos:baroes ...` was necessary



And the bareos bart looks like this:

Storage daemon:

/etc/bareos/bareos-sd.d/autochanger/vchanger1.conf
Autochanger {
    Name = vchanger1
    Device = vchanger-1-0
    Changer Command = "/usr/local/bin/vchanger %c %o %S %a %d"
    Changer Device = /etc/vchanger/vchanger.conf
}

/etc/bareos/bareos-sd.d/device/vchanger1.conf

Device {
    Name = vchanger-1-0
    DriveIndex = 0
    Autochanger = yes
    Device Type = File
    Media Type = Offsite-File
    Label Media = no

would auto-labeling work, if one configured "yes", here? (have you tried that and it did not work?)

    Random Access = yes
    Removable Media = yes
    Automatic Mount = yes
    Archive Device = /var/spool/vchanger/vchanger-1/0
}

Director:

/etc/bareos/bareos-dir.d/storage/vchanger-1.conf:
Storage {
  Name = vchanger-1-changer
  Address = backup1                # N.B. Use a fully qualified name here
(do not use "localhost" here).
  Password = "password"
  Device = vchanger1
  Media Type = Offsite-File
  Autochanger = yes
}

/etc/bareos/bareos-dir.d/pool/Offsite-eSATA.conf:
Pool {
  Name = Offsite-eSATA
  Storage = vchanger-1-changer
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 3 weeks
  Recycle Oldest Volume = yes
  Maximum Volume Bytes = 42949672960  # Small (40GB) easy to move/transfer
volume sizes
}

In this setup after initial disk plugin I create volumes like this:

/usr/local/bin/vchanger -u bareos -g bareos /etc/vchanger/vchanger.conf
createvols 3 104

Where 3 is a disk number (in this case if we look it up in vchanger.conf
we'll see that it corresponds to
/srv/backupstor/881564a0-63db-4e49-8f31-9a4ccd7d5d22 (units are numbered
from 0)) and 104 is number of volumes to create.

Initially the volumes are created empty and can grow to Maximum Volume Bytes
so in this case it's a 4TB drive.

It's supposed to perform a label command automaticaly but for some reason it
wasn't working too god for me and I dind't have much time to debug it so
after creating volumes I run bconsole and do "label barcodes".

After that the only commands I use after the initial creation of volumes are
mount and update slots. Just keep in mind that the volume name is one off
vs. slot number in vchanger. So if the console message wants you to, for
example, mount volume vchanger-1_1_0030 you have to mount slot 29.

I had to use this only once - for whatever reason, it dit not mount the first volume, but all others were mounted automatically (thank god, this works - an evening worth of backup spans multiple volumes here)


Hope this makes some sense :-)

If you have any more questions don't hesitate to ask. I might be able to
recall something back from when I deployed this.




Ah, just in case anyone is interested in vchanger for arch linux: I can provide a (quite trivial) PKGBUILD for that, if that's desired.

Cheers,
Erich

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE3p92iMrPBP64GmxZCu7JB1Xae1oFAl6klT8ACgkQCu7JB1Xa
e1p0bRAAgYcFtSVF8Fh71hJy6YmlXHoBtEQQabKsMblFyf4CLKtMXH5DOksdCJmq
bStcGf710nquOzSVNNpSy9HgkTdfdqMIn4j9vre+XoPw+MC9PLp5+muiR6LUo26P
1eX6aV3PI8OzERMpo1DsZyQ+SwvzIFmF8/W4T/E6vuBN/qrHqlMgU4bigaxOcVLR
MbUAQqbZXrbQoMMjK92uhfJXODRKRhXow6fMsNl8j96oafppz1ZPQv5wExEQqUfR
0xIzKuxd6jyxDjs1zzG1B+zHdpuWSTcSZsCHb3jDKEzGgDXQzbL22NQMgZoq0+t3
7u0j8zJqOSX4mFD8ZYbvyuYZyjazP1dJFfGbsE/ABxnlrXogv5kpve/7UZ8+72Px
oYMGoXeXQnixjwCexL4yMUsP+5f1tlDhtdIrE9HZQq4MZRqUnzuInozcbsMZoVcf
GiRLAD+Qnu1UtIw5dmIh9BF5ROZqUnLpgvOkPlBxO1bcO/sEELtxnHumlEPpfEZq
9iFk/VWkQGLrlcZOTQnfnZ35gDfcFUeSorohEOWnuretx6KRb2utslBhc4psOjvB
ncaas37ZAq12EQkFIdC2he4OQkdpw0q/Mn41EGml2DcM5sJ8YQH5wiO3wCeU23Sv
tqGsLKA/GHTEfpCByMRUiqYqi+daO+owc6c44fUc2+9IiqT9AYw=
=u+11
-----END PGP SIGNATURE-----

--
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/alpine.LNX.2.22.419.2004252143520.12758%40desk.ddns.eckner.net.

Reply via email to