Issues with getting bareos to see the slots in autochanger

149 views
Skip to first unread message

Philip Dalrymple

unread,
Sep 29, 2023, 3:20:25 PM9/29/23
to bareos-users
I used bareos at my last company and just installed a qualstar Q40. 

The mtx-changer command works as I expect but the status slots storage does not
(see below) 

Any Ideas on troubleshoting?

my autochanger record is 

Autochanger {
  Name = QSTAR
  Changer Device = /dev/sch0
  Device = LTO8
  Changer Command = "/usr/bin/sudo /usr/lib/bareos/scripts/mtx-changer %c %o %S %a %d"

}

my device record is

Device {
  Name = LTO8
  Media Type = LTO8
  Device Type = Tape
  Archive Device = /dev/st0
  Label Media = no;                   # yes for disk
  Random Access = No;
  Automatic Mount = yes;               # when device opened, read it
  Removable Media = yes;
  Always Open = yes;
  Autochanger = yes;
  Maximum Concurrent Jobs = 1;
  Maximum Block Size = 1048576;         
}


-----------------------------mtx-changer 
➜  bareos-config git:(main) sudo /usr/lib/bareos/scripts/mtx-changer /dev/sch0 slots  
40
➜  bareos-config git:(main) sudo /usr/lib/bareos/scripts/mtx-changer /dev/sch0 listall
D:0:E
S:1:F:1E0001L8                            
S:2:F:1E0002L8                            
S:3:F:1E0003L8                            
S:4:F:1E0004L8                            
S:5:F:1E0005L8                            
S:6:F:1E0006L8                            
S:7:F:1E0007L8                            
S:8:F:1E0008L8                            
S:9:F:1E0009L8                            
S:10:F:1E0010L8                            
S:11:F:1E0011L8                            
S:12:F:1E0012L8                            
S:13:F:1E0013L8                            
S:14:F:1E0014L8                            
S:15:F:1E0015L8                            
S:16:F:1E0016L8                            
S:17:F:1E0017L8                            
S:18:F:1E0018L8                            
S:19:F:1E0019L8                            
S:20:F:1E0020L8                            
S:21:F:CLN001L1                            
S:22:F:CLN002L1                            
S:23:E
S:24:E
S:25:E
S:26:E
S:27:E
S:28:E
S:29:E
S:30:E
S:31:E
S:32:E
S:33:E
S:34:E
S:35:E
I:36:E
I:37:E
I:38:E
I:39:E
I:40:E

---------------------------- bconsol 

status slots storage
Automatically selected Storage: bstore-eds1-sd
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Connecting to Storage daemon bstore-eds1-sd at bstore-eds1.rhsys.co:9103 ...
3306 Issuing autochanger "slots" command.
Device "LTO8" has 0 slots.
No slots in changer to scan.
*

Philip Dalrymple

unread,
Sep 29, 2023, 3:20:31 PM9/29/23
to bareos-users

Philip Dalrymple

unread,
Sep 29, 2023, 3:25:12 PM9/29/23
to bareos-users
I enabled logging on the mtx-changer script and if I call it from the command line I see entries in the log but not if.... Wait I may need to add the user bareos to the sudoers

Let me try that

Philip Dalrymple

unread,
Sep 29, 2023, 3:25:18 PM9/29/23
to bareos-users
I enabled logging on the mtx-changer script and if I call it from the command line I see entries in the log but not if.... Wait I may need to add the user bareos to the sudoers

Let me try that

On Friday, September 29, 2023 at 3:20:31 PM UTC-4 Philip Dalrymple wrote:

Philip Dalrymple

unread,
Sep 29, 2023, 3:29:57 PM9/29/23
to bareos-users
OK THAT WAS IT

A line needs to be added to /etc/sudoers file to allow the user (or group) bareos to run the mx-changer script

Philip Dalrymple

unread,
Sep 29, 2023, 3:30:03 PM9/29/23
to bareos-users
OK THAT WAS IT

A line needs to be added to /etc/sudoers file to allow the user (or group) bareos to run the mx-changer script



Bruno Friedmann (bruno-at-bareos)

unread,
Oct 2, 2023, 4:11:49 AM10/2/23
to bareos-users
Usually bareos sd user is also member of "Tape" and Disk group which greatly simplify access to that kind of devices.

Philip Dalrymple

unread,
Oct 2, 2023, 6:28:16 AM10/2/23
to Bruno Friedmann (bruno-at-bareos), bareos-users
Yes but the default command (tape) had sudo in it so needed to be in the sudoers file, I had the same issue at my last company
but that was 5 years ago and I had forgotten.

--
You received this message because you are subscribed to a topic in the Google Groups "bareos-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bareos-users/W87HSH_Jd40/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bareos-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/f7cc3801-13b0-4b09-a8bb-4779e0b354d5n%40googlegroups.com.


This email has been scanned by Inbound Shield.





--
Philip W. Dalrymple III <p...@rh-sys.com>
President & CTO
Rhodium Systems LLC

Andreas Rogge

unread,
Oct 9, 2023, 6:16:46 AM10/9/23
to bareos...@googlegroups.com
Am 02.10.23 um 12:28 schrieb Philip Dalrymple:
> Yes but the default command (tape) had sudo in it so needed to be in the
> sudoers file, I had the same issue at my last company
> but that was 5 years ago and I had forgotten.
You don't need sudo. The bareos user should be in the "tape" group and
thus doesn't need sudo to run mtx.

Best Regards,
Andreas
--
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
OpenPGP_0x00314758866BD59E.asc
OpenPGP_signature

Gregory West

unread,
Apr 11, 2026, 12:26:36 PM (4 days ago) Apr 11
to bareos-users
The TAPE group is OK, but not the complete story.   For some reason my setup has sch0 (the name given to my autochanger) as a cd/dvd.  I have added CRROM to by bareos user and i still does not work.   Looking into have to change sch0 from CDROM to TAPE.
root@backup:~# lsscsi
[0:0:0:0]    tape    HP       Ultrium 5-SCSI   Z6DW  /dev/st0
[0:0:0:1]    mediumx HP       1x8 G2 AUTOLDR   4.30  /dev/sch0
[3:0:0:0]    disk    ATA      Samsung SSD 850  2B6Q  /dev/sda
[4:0:0:0]    disk    ATA      WDC WD5000AAKX-0 1H19  /dev/sdb
[5:0:0:0]    cd/dvd  HL-DT-ST DVD-RAM GH10N    EX02  /dev/sr0
[6:0:0:0]    disk    ATA      WDC WD7501AALS-0 0K05  /dev/sdc

Greg

Gregory West

unread,
Apr 11, 2026, 12:41:53 PM (4 days ago) Apr 11
to bareos-users
OK now I am really confused.   sch0 WAS showing up as cd/dvd now it is showing up as mediummx.  This is after I added bareos to the sudo group.
dumb question.   I am running bconsole as root.   Is this an issue?
When I try and run bconsole as a generic user get the following: Config error: Cannot open config file "/etc/bareos/bconsole.conf": Permission denied

Going to add user to bearos group.
Greg

Oleg Cherkasov

unread,
Apr 12, 2026, 1:35:41 PM (3 days ago) Apr 12
to bareos...@googlegroups.com
On 11.04.2026 20:41, Gregory West wrote:
> OK now I am really confused.   sch0 WAS showing up as cd/dvd now it is
> showing up as mediummx.  This is after I added bareos to the sudo group.
> dumb question.   I am running bconsole as root.   Is this an issue?
> When I try and run bconsole as a generic user get the following: Config
> error: Cannot open config file "/etc/bareos/bconsole.conf": Permission
> denied
>
> Going to add user to bearos group.
> Greg
>
> On Saturday, April 11, 2026 at 11:26:36 AM UTC-5 Gregory West wrote:
>
> The TAPE group is OK, but not the complete story.   For some reason
> my setup has sch0 (the name given to my autochanger) as a cd/dvd.  I
> have added CRROM to by bareos user and i still does not work.
>  Looking into have to change sch0 from CDROM to TAPE.
> root@backup:~# lsscsi
> [0:0:0:0]    tape    HP       Ultrium 5-SCSI   Z6DW  /dev/st0
> [0:0:0:1]    mediumx HP       1x8 G2 AUTOLDR   4.30  /dev/sch0
> [3:0:0:0]    disk    ATA      Samsung SSD 850  2B6Q  /dev/sda
> [4:0:0:0]    disk    ATA      WDC WD5000AAKX-0 1H19  /dev/sdb
> [5:0:0:0]    cd/dvd  HL-DT-ST DVD-RAM GH10N    EX02  /dev/sr0
> [6:0:0:0]    disk    ATA      WDC WD7501AALS-0 0K05  /dev/sdc
>
It seems you are on the correct path but need to locate the HP
Autoloader device. Have you tried to run as root:

mtx -f /dev/sch0 status

It shall print the status of the Drive and all slots. If you are not
sure about the device name, then try all available devices that look
like Autoloader.

As far as I can recall, on Linux, I had to update the udev configuration
to specify the exact /dev/sg? name using the UUID of the device. If the
device is not customized in udev, then after a reboot, the device jumped
between /dev/sg{1,2,3}. If you are using `lsscsi -g` then the last
column would be the device name you need to try with mtx command.

Regarding the bconsole, I always run it as root, and the actual DIR
daemon is running as the bareos user. I do not think it is an issue.


Cheers,
Oleg

Gregory West

unread,
Apr 13, 2026, 3:13:13 AM (2 days ago) Apr 13
to bareos-users
I did the mtx command, and it worked perfectly:
root@backup:~# mtx -f /dev/sch0 status
  Storage Changer /dev/sch0:1 Drives, 8 Slots ( 0 Import/Export ) Data Transfer Element 0:Empty
      Storage Element 1:Full :VolumeTag=DBW501L5
      Storage Element 2:Full :VolumeTag=DBW502L5
      Storage Element 3:Empty
      Storage Element 4:Empty
      Storage Element 5:Empty
      Storage Element 6:Empty
      Storage Element 7:Empty
      Storage Element 8:Empty
root@backup:~#

Greg

Bruno Friedmann (bruno-at-bareos)

unread,
Apr 13, 2026, 4:02:25 AM (2 days ago) Apr 13
to bareos-users
Did you try to use the real device /dev/sgXXX for the changer. I've seen several failure using /dev/sch0 (and redo a change in our documentation recently) 
It's seems kernel/udev rules are filtering essential scsi io command to manipulate correctly the autochanger.

Recently I've rechange working sch0 to generic sgX device for my autochanger and everything work correctly since then,

Bruno Friedmann (bruno-at-bareos)

unread,
Apr 13, 2026, 7:36:25 AM (2 days ago) Apr 13
to bareos-users
And by the way change the value of 
Maximum File Size to something suitable for real LTO7/8/9 hardware ~100GB or more would works.

Gregory West

unread,
Apr 13, 2026, 10:02:03 AM (2 days ago) Apr 13
to bareos-users
That was the answer!!!!!     THANK YOU!!!!!

Changed sch0 to sg1 (after verifying the autochanger is at sg1) and did the:  update slots scan,   and it worked!

Greg

Bruno Friedmann (bruno-at-bareos)

unread,
Apr 13, 2026, 10:34:11 AM (2 days ago) Apr 13
to bareos-users
Great, Have fun now :-)

Reply all
Reply to author
Forward
0 new messages