1) I gave it a try. Using the mtx-changer script directly (without using bconsole after booting up) seems to work. I mounted a tape via the script and then umounted it:
./mtx-changer /dev/changer1 unload 8 /dev/nst0 0
+ test ! -r /etc/bareos//mtx-changer.conf
+ . /etc/bareos//mtx-changer.conf
+ offline=0
+ offline_sleep=0
+ load_sleep=0
+ inventory=0
+ vxa_packetloader=0
+ debug_log=0
+ uname
+ OS=Linux
+ ready=ONLINE
+ test -f /etc/debian_version
+ grep mt-st
+ mt --version
+ test 0 -eq 1
+ MTX=/usr/sbin/mtx
+ test ! -x /usr/sbin/mtx
+ MT=/bin/mt
+ test ! -x /bin/mt
+ dbgfile=/var/bareos/logs/mtx.log
+ test 0 -ne 0
+ check_parm_count 5 5
+ pCount=5
+ pCountNeed=5
+ test 5 -lt 5
+ ctl=/dev/changer1
+ cmd=unload
+ slot=8
+ device=/dev/nst0
+ drive=0
+ debug Parms: /dev/changer1 unload 8 /dev/nst0 0
+ test -f /var/bareos/logs/mtx.log
+ date +%Y%m%d-%H:%M:%S
+ echo 20210307-18:32:02 Parms: /dev/changer1 unload 8 /dev/nst0 0
+ debug Doing mtx -f /dev/changer1 unload 8 0
+ test -f /var/bareos/logs/mtx.log
+ date +%Y%m%d-%H:%M:%S
+ echo 20210307-18:32:02 Doing mtx -f /dev/changer1 unload 8 0
+ test 0 -eq 1
+ test 0 -ne 0
+ make_err_file
+ mktemp /var/bareos/working/mtx.err.XXXXXXXXXX
+ ERRFILE=/var/bareos/working/mtx.err.pJijcI8Tu2
+ test x/var/bareos/working/mtx.err.pJijcI8Tu2 = x
+ /bin/mt -f /dev/nst0 eject
+ sleep 10
+ /usr/sbin/mtx -f /dev/changer1 unload 8 0
Unloading drive 0 into Storage Element 8...done
+ rtn=0
+ cat /var/bareos/working/mtx.err.pJijcI8Tu2
+ rm -f /var/bareos/working/mtx.err.pJijcI8Tu2
+ exit 0
2) mount and unmount a tape and thereby loading and unloading a tape from a freshly booted machine via bconsole works.
3) mount a tape, running a backup job and then trying to umount/unloading the tape does not work and leads to the error message "ERR=Child died from signal 15: ". Unload the tape with mtx_changer works however: The debug mode of the mtx-changer script shows an error message "/dev/nst0: No medium found" which is consistent: The previously failing umount command issued an eject command. The tape is ejected from the drive but not unloaded into the magazine. When subsequently running the mtx_changer command,the medium is indeed no longer in the drive -- but also not yet in its slot
*status storage=TapeStorage1
Connecting to Storage daemon TapeStorage
Version: 19.2.6 (11 February 2020) Linux-4.15.0-112-generic ubuntu Ubuntu 18.04.4 LTS
Daemon started 07-Mär021 18:55. Jobs: run=2, running=0, self-compiled binary
Sizes: boffset_t=8 size_t=4 int32_t=4 int64_t=8 bwlimit=0kB/s
Running Jobs:
No Jobs running.
====
Jobs waiting to reserve a drive:
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
===================================================================
..
2730 Full 42,072 16.36 G OK 07-Mär021 21:25 BackupTgvs2ToTape
====
Device status:
Autochanger "AutoChanger1" with devices:
"TapeDrive1" (/dev/nst0)
Device "TapeDrive1" (/dev/nst0) is mounted with:
Volume: Tgvs2Tape-14
Pool: Tgvs2-Tape
Media type: DDS-4
Slot 9 is loaded in drive 0.
Total Bytes=16,380,499,968 Blocks=253,913 Bytes/block=64,512
Positioned at File=17 Block=0
==
====
Used Volume status:
Tgvs2Tape-14 on device "TapeDrive1" (/dev/nst0)
Reader=0 writers=0 reserves=0 volinuse=0
====
====
*umount storage=TapeStorage1
Connecting to Storage daemon TapeStorage1 ...
3307 Issuing autochanger "unload slot 9, drive 0" command.
3995 Bad autochanger "unload slot 9, drive 0": ERR=Child died from signal 15: Termination
Results=Program killed by BAREOS (timeout)
3002 Device ""TapeDrive1" (/dev/nst0)" unmounted.
#> mtx -f /dev/changer1 status
Storage Changer /dev/changer1:1 Drives, 12 Slots ( 0 Import/Export )
Data Transfer Element 0:Full (Storage Element 9 Loaded)
Storage Element 1:Full
Storage Element 2:Full
Storage Element 3:Full
Storage Element 4:Full
Storage Element 5:Full
Storage Element 6:Full
Storage Element 7:Full
Storage Element 8:Full
Storage Element 9:Empty
Storage Element 10:Full
Storage Element 11:Full
Storage Element 12:Full
#> ./mtx-changer /dev/changer1 unload 9 /dev/nst0 0
+ test ! -r /etc/bareos//mtx-changer.conf
+ . /etc/bareos//mtx-changer.conf
+ offline=0
+ offline_sleep=0
+ load_sleep=0
+ inventory=0
+ vxa_packetloader=0
+ debug_log=0
+ uname
+ OS=Linux
+ ready=ONLINE
+ test -f /etc/debian_version
+ grep mt-st
+ mt --version
+ test 0 -eq 1
+ MTX=/usr/sbin/mtx
+ test ! -x /usr/sbin/mtx
+ MT=/bin/mt
+ test ! -x /bin/mt
+ dbgfile=/var/bareos/logs/mtx.log
+ test 0 -ne 0
+ check_parm_count 5 5
+ pCount=5
+ pCountNeed=5
+ test 5 -lt 5
+ ctl=/dev/changer1
+ cmd=unload
+ slot=9
+ device=/dev/nst0
+ drive=0
+ debug Parms: /dev/changer1 unload 9 /dev/nst0 0
+ test -f /var/bareos/logs/mtx.log
+ date +%Y%m%d-%H:%M:%S
+ echo 20210307-21:59:39 Parms: /dev/changer1 unload 9 /dev/nst0 0
+ debug Doing mtx -f /dev/changer1 unload 9 0
+ test -f /var/bareos/logs/mtx.log
+ date +%Y%m%d-%H:%M:%S
+ echo 20210307-21:59:39 Doing mtx -f /dev/changer1 unload 9 0
+ test 0 -eq 1
+ test 0 -ne 0
+ make_err_file
+ mktemp /var/bareos/working/mtx.err.XXXXXXXXXX
+ ERRFILE=/var/bareos/working/mtx.err.Lfbq8DDkK5
+ test x/var/bareos/working/mtx.err.Lfbq8DDkK5 = x
+ /bin/mt -f /dev/nst0 eject
+ sleep 10
+ /usr/sbin/mtx -f /dev/changer1 unload 9 0
Unloading drive 0 into Storage Element 9...done
+ rtn=0
+ cat /var/bareos/working/mtx.err.Lfbq8DDkK5
/dev/nst0: No medium found
+ rm -f /var/bareos/working/mtx.err.Lfbq8DDkK5
+ exit 0
# mtx -f /dev/changer1 status
Storage Changer /dev/changer1:1 Drives, 12 Slots ( 0 Import/Export )
Data Transfer Element 0:Empty
Storage Element 1:Full
Storage Element 2:Full
Storage Element 3:Full
Storage Element 4:Full
Storage Element 5:Full
Storage Element 6:Full
Storage Element 7:Full
Storage Element 8:Full
Storage Element 9:Full
Storage Element 10:Full
Storage Element 11:Full
Storage Element 12:Full
Thanks
Tilman