I'm not sure if this is a configuration problem or not. The problem recurred later in the day when the pool filled up.
I don't think this is a configuration problem, but a version 7.0.5 bug. I was able to reproduce this error using version 7.0.5, but it worked fine using version 7.2.0:
***** using version 7.0.5 (output from debug mode):
bacula-sd: dircmd.c:802-0 Found changer device vDrive-1
3001 OK mount requested. Device="vDrive-1" (/opt/bacula/volumes)
bacula-sd: file_dev.c:173-62 open failed: file_dev.c:172 Could not open(/opt/bacula/volumes/Teste-0312,OPEN_READ_WRITE,0640): ERR=No such file or directory
bacula-sd: mount.c:746-62 Create new volume label vol=Teste-0312
bacula-sd: file_dev.c:173-62 open failed: file_dev.c:172 Could not open(/opt/bacula/volumes/Teste-0312,OPEN_READ_WRITE,0640): ERR=No such file or directory
Ana: what are you using to quickly test these configurations? I suspect a VM or similar.
You're welcome. Yes, I have VMs for testing purposes :).
I run tests with exactly your configuration and had the same issue. The drive index 0 must exist and belongs to the autochanger resource. You have an Index 0 drive in your configuration: vRestore. But it is not in the Autochanger definition. If you put it there, it will work:
I tried defining the vRestore drive with "autoselect = no" (this work for physical autochangers). But it seems to make no sense when dealing with virtual disk autochangers.
Do we need vRestore in there? Instead, I renumbered my Drive Index fields from zero.
No, I just added it to the device list because vRestore was configured as an autochanger drive with index 0. I think your solution is better, since we cannot select a specific drive for restores in the case of virtual autochangers.
FYI, I made a change. I now use vDrive-0 .. vDrive-4
I renamed the devices to match the drive indexes. There is no technical reason for this. I did it because I like the matching numbers.
Device {
Name = vDrive-1
Media Type = File
Archive Device = /usr/local/bacula/volumes
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Autochanger = yes
Drive Index = 0
Maximum Concurrent Jobs = 1
Volume Poll Interval = 15
}
Device {
Name = vDrive-2
...same as above
Autochanger = yes
Drive Index = 1
Maximum Concurrent Jobs = 1
Volume Poll Interval = 15
}
Device {
Name = vDrive-3
...same as above
Autochanger = yes
Drive Index = 2
Maximum Concurrent Jobs = 1
Volume Poll Interval = 15
}
Device {
Name = vDrive-4
...same as above
Autochanger = yes
Drive Index = 3
Maximum Concurrent Jobs = 1
Volume Poll Interval = 15
}
Device {
Name = vDrive-5
...same as above
Autochanger = yes
Drive Index = 4
Maximum Concurrent Jobs = 25
Volume Poll Interval = 15
}
Having a single drive for restores worked for me. I was able to restore files from jobs/volumes that used the autochanger for backup.
Device {
Name = Restore
-Drive
Media Type = File
Archive Device = /usr/local/bacula/volumes
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = yes
AlwaysOpen = yes
}
I have this in my bacula-sd.conf:
Device {
Name = Restore-Drive
Media Type = File
Archive Device = /usr/local/bacula/volumes
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Maximum Concurrent Jobs = 1
Volume Poll Interval = 15
}
When I run a restore job, it selects vDrive-1 automatically.
Yes, if you select the virtual autochanger storage for restore, the drive index 0 will be selected for the restore.
How did you get the restore to use Restore-Drive?
I configured the Restore-Drive as a storage in bacula-dir.conf (both Restore-Drive and VirtualDisk drives configured with the same archive device). This way we can choose the Restore-Drive for restoring files that are in volumes in the same mount point as the virtual autochanger.
That is what I suspected, but I wanted to make sure I did not misunderstand. I've done the same and can restore from the Restore-Drive.
Today, being the first Sunday of the month, full backups are underway. The original problem has returned.
06-Sep 07:05 crey-sd JobId 216727: New volume "FullAuto-3234" mounted on device "vDrive-2" (/usr/local/bacula/volumes) at 06-Sep-2015 07:05.
06-Sep 07:09 crey-sd JobId 216721: End of medium on Volume "FullAuto-3233" Bytes=5,368,688,700 Blocks=83,220 at 06-Sep-2015 07:09.
06-Sep 07:09 bacula-dir JobId 216721: There are no more Jobs associated with Volume "FullAuto-3235". Marking it purged.
06-Sep 07:09 bacula-dir JobId 216721: All records pruned from Volume "FullAuto-3235"; marking it "Purged"
3906 File device ""vDrive-0" (/usr/local/bacula/volumes)" is always mounted.
*m
You have no messages.
*m
06-Sep 11:54 bacula-dir JobId 216721: Created new Volume="FullAuto-4875", Pool="FullFile", MediaType="File" in catalog.
06-Sep 11:54 bacula-dir JobId 0: Max configured use duration=86,400 sec. exceeded. Marking Volume "TwoHourly-4395" as Used.
06-Sep 11:54 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4875" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4875,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 11:54 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4875" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4875,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 11:54 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4875" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4875,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 11:54 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4875" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4875,OPEN_READ_WRITE,0640): ERR=No such file or directory
It is having a similar problem with another volume creation:
06-Sep 11:00 crey-sd JobId 216727: Job zuul_jail_snapshots.2015-09-06_03.05.47_33 is waiting. Cannot find any appendable volumes.
Please use the "label" command to create a new Volume for:
Storage: "vDrive-2" (/usr/local/bacula/volumes)
Pool: FullFile
Media type: File
06-Sep 11:55 bacula-dir JobId 216727: Created new Volume="FullAuto-4876", Pool="FullFile", MediaType="File" in catalog.
06-Sep 11:55 crey-sd JobId 216727: Warning: mount.c:212 Open of file device "vDrive-2" (/usr/local/bacula/volumes) Volume "FullAuto-4876" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4876,OPEN_READ_WRITE,0640): ERR=No such file or directory
I have confirmed the Catalog contains the Volume:
bacula=# select mediaid, mediatype from media where volumename = 'FullAuto-4875';
mediaid | mediatype
---------+-----------
4875 | File
(1 row)
However, it is not on disk:
[dan@crey:~] $ ls -ld /usr/local/bacula/volumes
drwxr-xr-x 3 bacula bacula 2706 Aug 30 11:22 /usr/local/bacula/volumes
[dan@crey:~] $
$ ls -ld /usr/local/bacula/volumes/FullAuto-487*
ls: /usr/local/bacula/volumes/FullAuto-487*: No such file or directory
Disk space seems to not be the cause:
[dan@crey:~] $ df -h
Filesystem Size Used Avail Capacity Mounted on
system/usr/jails/crey 3.8T 820M 3.8T 0% /
Then I tried another mount, this time, with incorrect values:
*mount
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
The defined Storage resources are:
1: CreyFile
2: CreyFileRestore
3: CompaqStorageWorksTapeLibrary
Select Storage resource (1-3): 1
Enter autochanger drive[0]: 2
Enter autochanger slot: 2
3001 OK mount requested. Specified slot ignored. Device="vDrive-2" (/usr/local/bacula/volumes)
You have messages.
*m
06-Sep 13:03 crey-sd JobId 216727: Labeled new Volume "FullAuto-4876" on file device "vDrive-2" (/usr/local/bacula/volumes).
06-Sep 13:03 crey-sd JobId 216727: Wrote label to prelabeled Volume "FullAuto-4876" on file device "vDrive-2" (/usr/local/bacula/volumes)
06-Sep 13:03 crey-sd JobId 216727: New volume "FullAuto-4876" mounted on device "vDrive-2" (/usr/local/bacula/volumes) at 06-Sep-2015 13:03.
*
But it continued to have trouble with FullAuto-4875
So I tried this, which failed:
*mount
The defined Storage resources are:
1: CreyFile
2: CreyFileRestore
3: CompaqStorageWorksTapeLibrary
Select Storage resource (1-3): 1
Enter autochanger drive[0]: 2
Enter autochanger slot: 2
3906 File device ""vDrive-2" (/usr/local/bacula/volumes)" is always mounted.
*m
06-Sep 13:39 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4875" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4875,OPEN_READ_WRITE,0640): ERR=No such file or directory
Try a different approach:
*mount
The defined Storage resources are:
1: CreyFile
2: CreyFileRestore
3: CompaqStorageWorksTapeLibrary
Select Storage resource (1-3): 2
3906 File device ""Restore-Drive" (/usr/local/bacula/volumes)" is always mounted.
No, that didn't mount.
BUT THEN THIS WORKED:
*mount
The defined Storage resources are:
1: CreyFile
2: CreyFileRestore
3: CompaqStorageWorksTapeLibrary
Select Storage resource (1-3): 1
Enter autochanger drive[0]: 3
Enter autochanger slot: 2
3001 OK mount requested. Specified slot ignored. Device="vDrive-3" (/usr/local/bacula/volumes)
*m
You have no messages.
*m
You have no messages.
*m
06-Sep 13:39 crey-sd JobId 216721: Labeled new Volume "FullAuto-4875" on file device "vDrive-3" (/usr/local/bacula/volumes).
06-Sep 13:39 crey-sd JobId 216721: Wrote label to prelabeled Volume "FullAuto-4875" on file device "vDrive-3" (/usr/local/bacula/volumes)
06-Sep 13:39 crey-sd JobId 216721: New volume "FullAuto-4875" mounted on device "vDrive-3" (/usr/local/bacula/volumes) at 06-Sep-2015 13:39.
*
FYI, later in the day, things worked OK:
06-Sep 15:03 crey-sd JobId 216721: End of medium on Volume "FullAuto-4879" Bytes=5,368,688,700 Blocks=83,220 at 06-Sep-2015 15:03.
06-Sep 15:03 bacula-dir JobId 216721: Created new Volume="FullAuto-4880", Pool="FullFile", MediaType="File" in catalog.
06-Sep 15:04 crey-sd JobId 216721: Labeled new Volume "FullAuto-4880" on file device "vDrive-3" (/usr/local/bacula/volumes).
06-Sep 15:04 crey-sd JobId 216721: Wrote label to prelabeled Volume "FullAuto-4880" on file device "vDrive-3" (/usr/local/bacula/volumes)
06-Sep 15:04 crey-sd JobId 216721: New volume "FullAuto-4880" mounted on device "vDrive-3" (/usr/local/bacula/volumes) at 06-Sep-2015 15:04.
It seems that once you run out of Volumes, things get confused.... but once it picks up again, all is OK.
In that case, I specified 'autochanger drive' 3 and slot 2.
06-Sep 21:41 bacula-dir JobId 216715: Using Device "vDrive-0" to write.
06-Sep 21:41 crey-sd JobId 216715: Job supernews.2015-09-06_03.05.15_21 is waiting. Cannot find any appendable volumes.
Please use the "label" command to create a new Volume for:
Storage: "vDrive-0" (/usr/local/bacula/volumes)
Pool: FullFile
Media type: File
I amended the pool to increase Max # Volumes for the pool. Then:
*reload
*m
06-Sep 21:44 bacula-dir JobId 216715: Created new Volume="FullAuto-4905", Pool="FullFile", MediaType="File" in catalog.
06-Sep 21:44 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
NOTE: it goes to try creating another Volume:
06-Sep 21:44 bacula-dir JobId 216721: Created new Volume="FullAuto-4906", Pool="FullFile", MediaType="File" in catalog.
06-Sep 21:44 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4906" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4906,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4906" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4906,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4906" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4906,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4906" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4906,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:44 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4906" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4906,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:45 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:45 crey-sd JobId 216721: Warning: mount.c:212 Open of file device "vDrive-3" (/usr/local/bacula/volumes) Volume "FullAuto-4906" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4906,OPEN_READ_WRITE,0640): ERR=No such file or directory
If I mount ON THE DRIVE it is looking for, it proceeds:
3001 OK mount requested. Device="vDrive-3" (/usr/local/bacula/volumes)
You have messages.
*m
06-Sep 21:46 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:46 crey-sd JobId 216721: Labeled new Volume "FullAuto-4906" on file device "vDrive-3" (/usr/local/bacula/volumes).
06-Sep 21:46 crey-sd JobId 216721: Wrote label to prelabeled Volume "FullAuto-4906" on file device "vDrive-3" (/usr/local/bacula/volumes)
06-Sep 21:46 crey-sd JobId 216721: New volume "FullAuto-4906" mounted on device "vDrive-3" (/usr/local/bacula/volumes) at 06-Sep-2015 21:46.
*
Let's try that theory again, on drive 0, which is where it's waiting:
*m
06-Sep 21:47 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
06-Sep 21:48 crey-sd JobId 216715: Warning: mount.c:212 Open of file device "vDrive-0" (/usr/local/bacula/volumes) Volume "FullAuto-4905" failed: ERR=file_dev.c:172 Could not open(/usr/local/bacula/volumes/FullAuto-4905,OPEN_READ_WRITE,0640): ERR=No such file or directory
*mount
The defined Storage resources are:
1: CreyFile
2: CreyFileRestore
3: CompaqStorageWorksTapeLibrary
Select Storage resource (1-3): 1
Enter autochanger drive[0]: 0
Enter autochanger slot: 0
3001 OK mount requested. Device="vDrive-0" (/usr/local/bacula/volumes)
*m
06-Sep 21:48 crey-sd JobId 216715: Labeled new Volume "FullAuto-4905" on file device "vDrive-0" (/usr/local/bacula/volumes).
06-Sep 21:48 crey-sd JobId 216715: Wrote label to prelabeled Volume "FullAuto-4905" on file device "vDrive-0" (/usr/local/bacula/volumes)