Force rotation of physical disks

38 views
Skip to first unread message

spadaj...@gmail.com

unread,
Mar 12, 2025, 3:38:45 AM3/12/25
to bareos-users
Hello there.
I have a setup with vchanger serving 4 physical disks. On those disks I have fixed-size media files.
It works as it should but it doesn't fulfill all my needs.
It does rotate between disks when a particular physical disk gets full (all medias on that drive are used) but it might do so - for example - mid-job.
Back when I had shorter retention it didn't care that it didn't rotate between disks for a longer time.
So ideally I'd love to have a situation when I'd have a full job and subsequent diff/inc jobs created on one disk, then rotate to another physical disk (the old one I unplug and store off-line) and do full+diff/inc there and so on. For example in a weekly schedule.
But so far the only Idea I have would be to create a separate pool on each physical disk and have multiple intertwined jobs - each with a week-long schedule and multiple-week "pause". Each job would target a different pool. The downside is of course the administrative overhead to create and maintain all those jobs and having to reconfigure it as a whole in case I add or remove disks to/from the rotation pool.
I just browsed the docs in parallel windows and I see that I can override job-level settings with schedule so maybe it's the way to go. Create separate pools per physical disk and do something like:

Schedule {
  Name = "TriDisk"
  Run = Pool=FirstDisk Full w01/w03 sat at 21:00
  Run = Pool=SecondDisk Full w02/w03 sat at 21:00 
  Run = Pool=ThirdDisk Full w03/w03 sat at 21:00           
  Run = Pool=FirstDisk Incremental Full w01/w03 mon-fri at 21:00
  Run = Pool=SecondDisk Incremental Full w02/w03 mon-fri at 21:00
  Run = Pool=ThirdDisk Incremental Full w03/w03 mon-fri at 21:00
}

Still a bit troublesome to maintain but better than defining separate jobs. Any better ideas?

MK

Andreas Rogge

unread,
Mar 12, 2025, 6:06:58 AM3/12/25
to bareos...@googlegroups.com
I have a bad and untested idea that you could try.

First of all you'll need a file autochanger for that (see PR 2090[1]).

* pre-create volumes on your disks (probably already did that)
* create a script that mimics the mtx-changer list/listall output format
but lists the volume names from the drive that is currently plugged in
* configure that script as a changer command in the file autochanger
* set autochanger = yes in the director's configuration for your storage

At this point you should be able to run "status slots" to view the disk
volumes that are currently available.
Also, "update slots" should now set the inchanger flag and update the
slot column in the volume record.

As you enabled the autochanger-flag on the Storage in the director
configuration, the inchanger flag should now be honored.
As a result Bareos should automatically select a volume that is "online".

Best Regards,
Andreas


[1] https://github.com/bareos/bareos/pull/2090

--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz

Spadajspadaj

unread,
Mar 12, 2025, 9:51:00 AM3/12/25
to bareos...@googlegroups.com
But that would require me to remember to swap the disks and then bareos would only use the disks online, do I get it right?
I hoped for the other way around - when I need to swap disks, I get a notification. I'm lazy and tend to forget such things 😉

MK

Spadajspadaj

unread,
Mar 16, 2025, 4:18:10 PM3/16/25
to bareos...@googlegroups.com
OK. Tried to do it "my way". For example:

Schedule {
Name = "DailyCycle"
Run = Pool=Swapdisk3 Level=Full w01/w03 mon at 1:00
Run = Pool=Swapdisk3 Level=Incremental w01/w03 tue-fri at 1:00
Run = Pool=Swapdisk1 Level=Incremental w01/w03 sat-sun at 1:00
Run = Pool=Swapdisk1 Level=Full w02/w03 mon at 1:00
Run = Pool=Swapdisk1 Level=Incremental w02/w03 tue-fri at 1:00
Run = Pool=Swapdisk2 Level=Incremental w02/w03 sat-sun at 1:00
Run = Pool=Swapdisk2 Level=Full w03/w03 mon at 1:00
Run = Pool=Swapdisk2 Level=Incremental w03/w03 tue-fri at 1:00
Run = Pool=Swapdisk3 Level=Incremental w03/w03 sat-sun at 1:00
}

(It is a bit skewed since I want to do fulls on saturday and the week obviously starts on monday)
But so far scheduled jobs show volume for job as "*unknown*" and there is one more issue.
The jobs which are set to be run on connection from client (laptops) do want the default pool for the job, they do not get schedule into account.
Might indeed fidlde with the changer. (I do use vchanger anyway).
Reply all
Reply to author
Forward
0 new messages