View Issue Details

IDProjectCategoryView StatusLast Update
0000774bareos-corestorage daemonpublic2017-02-17 15:20
Reporterscrasa Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
PlatformLinuxOSDebianOS Version8
Product Version16.2.4 
Summary0000774: concurrent mouting same disk
DescriptionWe are using bareos to backup volumes on usb disk. We are using multi storage devices on same disk to do concurrent jobs backups. We are using internal mount script to mount disks with veracrypt encryption (veracrypt.codeplex.com) (but seems independant of mounted filesystem)

If multi jobs are launched/scheduled on the same time, they all are launching the same mouting script on the same time and same device (which could depending of the mounted filesystem count do problems ...?)
Steps To ReproduceOn storage add multi devices :

Device {
name = storage1
Automatic Mount = yes
Media Type = EncryptUsbDisk
Always Open = no
Device Type = File
Random Access = yes
Removable Media = yes
Requires Mount = yes
Maximum Concurrent Jobs = 10
Archive Device = /mnt/veracrypt-usb
mount command = "sudo /root/bin/mountScript /dev/sdb1 DISK01 %m"
Unmount Command = "sudo /root/bin/umountScript %m"
...}

Device {
name = storage2
mount command = "sudo /root/bin/mountScript /dev/sdb1 DISK01 %m"
...}

on director :

Storage {
  Name = EncryptedUsbDisk1
...
  Device = storage1
  Device = storage2
  Media Type = EncryptUsbDisk
  Maximum Concurrent Jobs = 10
}

multi jobs, same
schedule


on mount script to trace multi launch of mount command, you can do

date >> /root/bareos-log
echo "Start" >> /root/bareos-log
pstree -sp $PPID >> /root/bareos-log
mount ...
if [ $? -ne 0 ] ; then
date >> /root/bareos-log
echo "Error" >> /root/bareos-log
pstree -sp $PPID >> /root/bareos-log
exit 1
fi


If the mount command take a few second to do his job (depending filesystem)
The first job do log :
start, pid(1)

The second job do log
start , pid(2)
error, pid(2)

the second job re-lauch the mount, but enter on the if ($? -ne 0), because first mount is already launched and not terminated (multi mouting command on the same system disk device)
Additional InformationI tested the problem on bareos 14.2 and 16.2

I will test code on my mount script to avoid concurrent script launching, but is it not task of bareos to not launch again the same mount script if already launched on different storage device but same "archive device" mount path ?
TagsNo tags attached.

Activities

scrasa

scrasa

2017-02-17 11:34

reporter   ~0002574

It is the same thing for umount.

Same storage with 2 device. If you run 2 concurrents jobs, and the first finish, the second already running, the first seems to try several times to unmount the device even if the first job is running on it.
joergs

joergs

2017-02-17 15:20

developer   ~0002575

Well, for me this is the expected behaviour. For Bareos these are two independent devices. Also I don't see that extra code to handle this will be added.
On the other hand site, you could argue, that it does not make sense for a disk device to only be able to handle one access (volume) at a time (the reason why you have defined two devices at all). This is something we wanted to change in any case. However, we have to see, if this can b done until bareos-17.2.

For this reasons, I will close the ticket now.
As I assume, this is quite a common problem, there are two things you can do:

1. discuss this on the bareos-users mailing list. I assume, there are plenty of other persons with similar requirements.

2. If you scripts are done and working fine, I would like to see them shared with other people. Maybe you can push them to https://github.com/bareos/bareos-contrib ?

Issue History

Date Modified Username Field Change
2017-02-06 19:32 scrasa New Issue
2017-02-17 11:34 scrasa Note Added: 0002574
2017-02-17 15:20 joergs Note Added: 0002575
2017-02-17 15:20 joergs Status new => closed
2017-02-17 15:20 joergs Resolution open => won't fix